Have you ever needed to copy files from one media to another, on the go?

As you might, or might not know, I like taking pictures. A lot of them. I do go on a weekend getaways with a complete set of tech gadgets one can take and run without access to the power outlet – so, anything with a battery.

You know what I also like? Making backups. As a wise somebody once said, people are divided into ones making backups and ones that will make backups. It seems I fit the first group, having previously lost a whole summer worth of photos because of single memory card failure.

So, I would like to make a copy on a separate physical drive. What would you use? A laptop? Sure, probably the easiest way. But running your laptop in the car is hardly convenient. Believe me, I’ve tried. One of those extremely overpriced HDDs, which have an option to connect SD card, then? Hell no, have you seen their price tags?

I, being me, decided to build something instead. And yes, it’s not the fastest solution, it’s most likely not the best solution. But hey – it works, it made me learn something new, and it provided me with something to do for a few evenings.

This is essentially just a Raspberry Pi with a touchscreen. I had one laying around, collecting dust, so I’ve installed some heatsinks (who would have thought, that copying files uses so much resources!) and a resistive touch screen, and started coding away!

Well, not straight away, as first I’ve done some research. I wanted it to have stupid-simple UI, and ideally, boot up, run the app, copy files and shutdown. I’ve decided to go with Python, as it’s the language I’ve never used before. Perfect. That, and some Linux scripting, and we’re ready to go!

I’ve loaded Raspbian Light onto microSD card and booted the Pi; Installed touch screen drivers, openbox (we don’t need anything fancier than that), and wrote a script to run the Python app after boot and shutdown the Pi when the app process exits. So far so good. Time to code.

I’ve tried to install wxPython using pip. That failed. It seems RPi does not have enough memory to compile the library. Dang. But of course, it’s Linux – so I’ve installed it from the repo, because, of course it exists. Okay, time to code (again).

I’ve used ZetCode’s tutorial on wxPython and Python itself – which are great, and you should totally check them out. I’ve got some basics, the syntax, and yay – I’m good to go!

It then took me a few days and a lot of Google searches to tape together a script I can use. It’s not great (yet), but it works! I still need to figure out some snags, though. Does anyone know if Python supports threads…?

Anyway – I got something to work on for the next few days, and hopefully I’ll have it ready on Friday, so I can test it in the field this weekend.

Which of course means – more pictures!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.