Many Pies

Many Pies

Thursday, January 03, 2013

Raspberry Pi - doing something useful

My second most popular post of 2012 was Raspberry Pi in real life and a tiny wireless access point. (The first was the ever popular Firebug equivalent for IE written back in 2007.) My analytics shows that people are searching for Raspberry Pi and access points.

Anyway, I thought I ought to write another Raspberry Pi post. When I got mine I had problems with booting from the SD card. For some reason it would only boot if you put in on an antistatic bag and then used your fingers to short the bag to some of the pins. I got a different card which has worked fine.

Over Christmas I had time to do some more stuff with it. I got the latest Raspbian image which thankfully includes wireless support from an icon on the desktop, rather than fiddling around with firmware and typing arcane commands. I added VNC support, enabled SSH and I was cooking on gas, as they say.

I wrote a script which would detect when the SD card from my camera was plugged in and copy photos from it to the PC where I archive them. When I discussed with someone my plans to do this they pointed out that I would probably spend more time developing it than I would save in doing it the old way (running a script on the PC). However, that's not the point! The interesting thing is finding out how to do it.

Although I've been using Unix for 24 years I don't use it regularly, so it took a bit of digging to find out that mount -t smb is now mount -t cifs. The script is now working, so I need to schedule it with cron and we're away.

2 comments:

Anonymous said...

"Arcane commands"?! You'll have to imagine the smoke coming out of my ears. Needless to say, some crazy people such as myself generally prefer the "arcane" (read "powerful, reliable, and ubiquitous") command-line to graphical configuration tools :)

Did you know that you can use a udev rule to launch the script in Linux as soon as the SD card is plugged in? No need to use cron in this case, and the copying will kick off pretty much instantly.

Paul Morriss said...

OK, maybe arcane is a bit unfair. Especially with double dashed options now available :-)

I have no problem with command line stuff, but here are the instructions for getting my adapter to work, including this line:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- KSRC=path/to/kernel KVER=3.1.9+ MODDESTDIR=path/to/SD/lib/modules/3.1.9+/kernel/drivers/net/wireless/

Thanks for the udev tip. I wasn't aware of that.