Project:Nanode/Applications

From London Hackspace Wiki

Upgrade to Pachube Premium Subscription

From Ed Borden, Pachube, New York.

"We are really excited about this project here at Pachube. We want to give our full support to anyone who has the gumption to take this thing and pull it along to the next level. I don't care if you haven't tested the first run yet! :) Full steam ahead!

For any of you guys on this list who bought a nanode from Ken and want to connect it up to Pachube, drop me a line with your username and I'll upgrade your account to Premium. And if you do something awesome that you want the world to know about, tell us about it!"

edborden at pachube dot com



Testing Nanode

The ATmega328 microcontroller supplied with the kit has a specially modified version of the Arduino bootloader pre-programmed into it.

Arduino usually has a LED wired to Digital pin 13, but in Nanode, digital 13 is in almost constant use as the SPI Clock.

So in the Nanode bootloader, the LED flashing function has been altered so that it flashes the red LED which is wired to digital pin 6.

If all is well with your Nanode board, the Red LED should start flashing about 2 seconds after the power (from USB or FTDI cable) has been applied.

If it does not flash, check for faults such as missing soldered joints or the LED incorrectly inserted.

Applications

Quick Tutorial- 4/6/11.

1. Download and Install Arduino Environment http://arduino.cc/en/Main/Software Mac users: mount the dmg and drag arduino into Applications folder. Windows users: open the arduino-0022 folder and run Arduino.exe Ubuntu users (tested on 10.10): sudo apt-get install arduino

2. Download FTDI Cable Drivers

Plug in the FTDI programming cable.

  • Windows users: When prompted to install drivers, point the installer to the arduino-0022/drivers directory
  • Mac users: mount the arduino installation dmg and double click on the FTDI install package at the bottom of the window.
  • Linux users: if you are using a 'modern' ubuntu or debian install (from my experience) the FTDI cable should be plug and play, type dmesg into terminal to check for the device mount point, mine is: /dev/ttyUSB0

3. Download EtherShield Libraries

Download here: https://github.com/Nanode/EtherShield

  • Change the downloaded folder name to "EtherShield" and place in Arduino/libraries/ folder
  • Mac users: make a folder called "libraries" in Documents\Arduino\ then place the EtherShield folder into the newly created libraries folder.
  • Windows users: place the EtherShield folder into arduino-0022\libraries\
  • Linux users: place the EtherShield folder into arduino-0022\libraries\ (or /usr/share/arduino/libraries/ ?)

4. Run the EtherShield_DHCPTest

Arduino: File > Examples > EtherShield_DHCPTest

  • In the source code, change MAC address to something random :) e.g. change the last two digits "??" to the two digit number written in pen on the bottom of your Nanode:
 static uint8_t mymac[6] = {0x54,0x55,0x58,0x5F,0x01,0x??};
  • On line 57, change
 es.ES_enc28j60Init(mymac); to es.ES_enc28j60Init(mymac,8);

EtherShield Library and Examples

First you need to download and install the EtherShield library from GitHub

https://github.com/thiseldo/EtherShield

Make sure you have Arduino 0021 or better still 0022 installed.

(Remove any previous version of Ethershield library - as this causes code compilation problems).

Note:

To get the EtherShield examples to work you will have to edit the enc28j60 init function to read.

ES_enc28j60Init(mymac,8);

In the webserver example this can be found on line 48.