Project:Nanode/Applications
Upgrade to Pachube Premium Account
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. In Arduino application menu/Tools/Board/ select "Arduino Duemilanove or Nano w/ ATmega328" and menu/Tools/Serial Port "/dev/tty.usbserial-A400f2he"
- 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/thiseldo/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??};
- (for Nanode version 5 users) On line 57, change
es.ES_enc28j60Init(mymac); to es.ES_enc28j60Init(mymac,8);
- (for Nanode version 2- older prototype boards) On line 57, change
es.ES_enc28j60Init(mymac); to es.ES_enc28j60Init(mymac,10);
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.
EtherShield simpleClient examples for Pachube and Emoncms: github
Webserver Application (Dave Ingram)
Dave's code is in his Github repository
https://github.com/dingram/Nanode/
USB Bootstrap loader
The template for the USB boot loader is USBaspLoader. It needs to be built using these config files.
There are some caveats. Read the notes.
MAC address
The code for reading the unique MAC Address has not yet been fully debugged. Dave Ingram (DMI) said that he would have a look at it.
There will be an update as soon as we have this working.
If you did not have your tiny MAC chip soldered to the back of the pcb during the Nanode Weekend - this can be done at a later date at the space.
Ken has put together an early code attempt at running this device - see Github https://gist.github.com/1016689 More work needed!
RFM12 Wireless Module
Wireless connectivity can be added to the Nanode using the Jeelabs RFM12B wireless board: http://jeelabs.com/products/rfm12b-board
RFM12 example with DHCP, DNS and posting data to Pachube and Emoncms by OpenEnergyMonitor.org: github
Bitlash
Bitlash is a interpreted command shell (language) which runs on the Arduino. It takes 14K of program memory, but allows programs to be written from a serial terminal and stored as functions in the EEprom on the ATmega328. It is reminiscent of the early 1980s home computers which executed BASIC directly from power-up.
Bitlash could be used to write simple scripts to automate sensing functions, datalogging or other applications running on Nanode. There is an opportunity to be able to reprogram a Nanode remotely, and have it perfor different tasks.
Bitlash can incorporate any of the Arduino library functions, making it simple to combine Bitlash with existing C-code.
More infomation here Bitlash Wikki