Date: Fri, 16 Dec 2016 17:12:44 -0800
From: Toby Schachman
Subject: RFID reader microservice
I got a near-field RFID reader broadcasting its RFID reads. It's hosted on a CHIP computer ($9 all in, built in wifi and memory).

Inline image 1

You can go to http://chiprfid1.local to see the latest tag read.

Code is here:
https://github.com/dynamicland/rfid-keyboard-server

You can ssh into **************** (******************


Here are my notes on setup, mostly for my future reference:

1. I plugged the chip directly into my laptop with a USB cable, then logged in over serial with:

    screen /dev/tty.usbmodem1421 115200

(I first had to find the device with `ls /dev/tty*`)

Reference: http://docs.getchip.com/chip.html#headless-chip

2. Connect wifi

    sudo nmcli device wifi connect 'YCR' ******************

Reference: http://docs.getchip.com/chip.html#wifi-connection

3. Changed hostname (the .local address) by changing the default "chip" in these two places:

    sudo nano /etc/hostname
    sudo nano /etc/hosts

and restart:

    sudo /etc/init.d/avahi-daemon restart

Reference: http://docs.getchip.com/chip.html#zero-configuration-networking

4. Made it auto boot into console:

    sudo systemctl set-default multi-user.target

Reference: http://docs.getchip.com/chip.html#boot-into-console

5. Installed requirements:

    sudo apt-get update
    sudo apt-get install git
    sudo apt-get install nodejs

6. Cloned the repo:

    git clone https://github.com/dynamicland/rfid-keyboard-server.git

7. Modified rc.local to run my script on startup,

    sudo nano /etc/rc.local

added this line before `exit 0`,

    /usr/bin/nodejs /home/chip/rfid-keyboard-server/index.js < /dev/tty1

Normally scripts in rc.local run in the background kinda, and keyboard input doesn't get to them. That's why we need the `< /dev/tty1` at the end.


The chip outputs video over composite (there are pink cables in the bin). Our bigger projectors take composite input so I used that as a monitor.

I had a ton of trouble with what I assume are power issues with usb devices. It didn't seem to like the apple usb keyboard at all. And I couldn't ever get a mouse and keyboard working with it simultaneously (even with a usb hub).