woensdag 10 april 2013

Raspberry PI Checkin devices

the brief

We have a project at work called the "uitpas" it's sort of a point card for cultural events. (more info about the uitpas can be found at http://www.uitpas.be/ ) when you have a certain ammount of points, you can exchange it for ceratin prizes (movie tickets, hiking maps ... )

There are a lot of events however where people either buy their tickets before hand or where no tickets are needed. So  there was a need for a check-in device that could opperate without a person manning it. 

The Uitpas cards are rfi cards (DESfire mifare to be exact) 

the sollution  

hardware 

ingredients 
  * Raspberry pi (orignally i used the 256mb kind, currently we are using the the 512mb) 
  ** 4 gig SD card 
  ** case for the raspberry pi  (i chose this one because it still allows me access if one side is glued to the backplate of our setup)
  * powerd usb hub 
  * a small screen that we got from adafruit http://www.adafruit.com/products/946 
   * short mini usb cables
Optional
  * sme small wifi adaptors (i got an edimax one from amazon , but i guess any would do .. check the raspberry pi wifi compatibility page for details)

testing setup

you can see everything (exept the screen) hooked to the left here. In this example it was hooked up via HDMI to a PC screen because that was easier to debug on (A 4 inch screen makes the console hard to read)

The raspberry pi is hooked up to the USB hub twice, once as it's host, and once in order to be fed some yummy yummy electricity
the reason for hooking up like this is that the raspberry pi does not supply enough amps on it's usb ports to power the RFID reader.




the card reader required these packages to be added

libccid : PC/SC driver for USB CCID smart card readers
libpcsclite1:armhf : Middleware to access a smart card using PC/SC (library)
pcscd : Middleware to access a smart card using PC/SC (daemon side)


we have a software partner ( lodgon ) that writes all the clients and they supplied us with a java application that reads the card does the oauth handshake with the server and writes directly to the frame buffer.

in order to run that software the PI user has to lgin automatically at boot-time

to do this you have to edit  /etc/inittab  end replace the line
1:2345:respawn:/sbin/getty --noclear 38400 tty1
with
1:2345:respawn:/bin/login -f pi tty1
/dev/tty1 2>&1

Autorunning the java application is done by adding the command that starts it to the end of the /home/pi/.bashrc file.


Accessing them remotely

They willl be dropped at locatios where they will not have a public IP adress. but i still need to be able to access them remotely. mainly for trouble-shoting, but also for monitoring them and seeing that they do OK.
i could set up VPN tunnels but that's a hasslte to maintain on my end and can cause "issues". So i requested a bunch of IPv6 tunnels from the nice people at Sixxs.
Because the raspberry pi does not have a battery for it's onboard clock the tunnels did not start reliably at bootup
so i have a script that runs at bootup that checks wether or not the tunnel is up. (by calling ifconfig and checking if the sixxs interface is present) .. if it is not i runt "ntpd -qg" and restart the tunnel. it's a little dirty, but it works.

The casing 

We have a previous version that's running an arduino ... the new Raspberry pi version should be recognizable and be able to use the "pedestals" of the arduino version, but obviously it should be bigger (more stuff inside, bigger screen ). and it should also solve a few "usability problems". 
I feel compelled to write here that the "industrial design" on the arduino version was done by an external partner .. all i did was the electronics. and they placed the rfid antenna behind 1 cm of plexy and a working 16*2 lcd screen .. so it does not read to well , and to add to the troubles your card blocks the screen if you present it to the reader. 

siblings
the small one on the right is the old version 
the one on the right is the new version. 



metal piece of the casing
so we made some basic design (in cardboard) had some meetings and found someone to build us a piece of metal as a frame. we also found someone to print and cut the frontplate as well as bend and cut a piece of plastic to cover the back.




screen and rfid reader inside


using some double-sided 3M tape to paste it all together. ANd adding some short USB cables where possible to keep it from becomming a big cable-knot.
All the electronics inside

So We've had about 10 of them in the field now and they seem to be performing well.
one Check-in device in the public library in Lede





4 opmerkingen:

Eva Smith zei
Deze reactie is verwijderd door een blogbeheerder.
luth zei

Hi,

I try to install the pcscd and libccid package on raspberry pi. I downloaded pcscd (1.8.4-1+deb7u1, armhf) and libccid (1.4.7-1, armhf) according to the version of libpcsclite1 (1.8.4-1+deb7u1) that is already installed. But when I try to run pcscd, it gave me a segmentation error. I am wondering if you have encountered such problem? which exact version did you choose? Thank you!

vivien

Wouter Simons zei

h vivien

i just got them from the repositories
so commandline execute
apt-get install libccid pcsc


these are the versions i am running
libpcsclite1:armhf 1.8.4-1
pcscd 1.8.4-1

luth zei

Thank you very much! It works! :D Strangely, the one from debian depository of wheezy didn't work.

vivien