Well it’s been a productive weekend. The ESX server is built (a separate post on that to follow) but also the Arduino kit I’ve ordered has turned up. I’ve got the Adafruit RFID reader shield (link) with an Arduino Ethernet POE (link), a few stacking headers for shields (link), an FTDI serial cable (link) and a pile of RFID cards.
Having unpacked everything the good news for someone who likes playing is that the Arduino definitely doesn’t just work out of the box. First issue is the Ethernet POE version of the Arduino. The height of the ethernet connector and POE injector are slightly too big for standard stacking pins so I’ve had to add in a stacking shield just to raise the height of the RFID reader a little.
Everything all connected up I downloaded the Arduino IDE to get going, created the world’s simplest “Hello World!” program over the serial port and hit the “Upload” button. Unfortunately that didn’t work. I received the error message “avrdude: stk500_recv(): programmer is not responding”.
A bit of googling revealed this has happened to a few people on a variety of boards. First advice – turn on verbose build output in the settings screen.
When you press upload again you’ll see some more data.
What appeared to be happening is an attempt at a handshake. I saw a few articles suggesting newer firmware (although 2-3 years old now) for the Ethernet Arduino and suggestions it was due to timing on the FTDI cable. Some suggested using another Arduino to re-program the boot loader on this one – not terribly helpful.
A quick read through how the programming works explained more. On start-up the bootloader looks to the programming cable for firmware. If it finds a connected device in a short period of time then it deploys that firmware. So rather I took a brute force approach and kept hitting uploading trying to time pressing the reset button correctly. Eventually I got this to work – you need to hit the reset button just before the orange text for handshake appears and then the upload works fine. It appears that the auto-reset functionality isn’t working on my cable, my board or the timing is out with my driver but I’m not going to worry too much as I got some uploads working.
Unfortunately not had chance to test the RFID card yet since it needs the connectors soldering on. Now other than joining some cables badly with solder a few years ago I haven’t actually soldered onto a board since I was 12 and own a soldering iron worth £4. Next step will be to get a half decent one.
In the interim I’m going to start doing some work on the non-RFID side of the project – writing the code to create a multi-connection TCP/IP server so that the door reader can be configured. The current plan is to write basic code to do the following:
- On start-up setup serial for debug output and attempt to read a config file from SD card containing all settings
- Setup ethernet based on defaults or SD card settings
- In every loop check for new ethernet connections and if so open them. Since we can have a maximum of four I’ll reserve one for outgoing connections and use the other three for inbound telnet requests and open up a service on port 23.
- When user telnets in they will be prompted with a password prompt followed by menu system to configure the device over the network where any changes are immediate and saved to SD card. I’ll also give the option to reset the device.
Hopefully get cracking on some code this week but in the mean time I want to try some different IDEs, as a professional developer the Arduino default one leaves a little to be desired and I also want to look into the bootloader code to see how easily I can start doing firmware updates over the network interface.