Pages

RESTduino for Nanodes

After seeing the work done by Jason Gullicksonism on RESTduino – Arduino for the rest of us and code at https://github.com/jjg/RESTduino I decided to port the sketch to use my ENC28J60 EtherShield library. This is now available at https://github.com/thiseldo/EtherShield_RESTduino and includes an updated demo.

A perfect platform for this code is the Nanode, it provides Arduino functionality combined with an integrated ENC28J60 ethernet all on a single board.

The demo uses a common cathode RGB LED (can be easily modified for common anode) with blue to digital 3, red to digital 5 and green to digital 6. The demo is based on the slider UI demo from the jQuery site. This shows 3 sliders and a square of colour, the sliders change the colour of the square. This also sends an request to the Arduino to update the appriopriate colour value.

To use, just point your web browser at the Nanode, for example http://192.168.1.177/3/HIGH will set pin 3 high. Replacing HIGH with a value in the range 0-255 on a PWM enabled pin will set the PWM value.

http://192.168.1.177/3 will return the status of pin 3 as JSON {“3″:”HIGH”}

Using http://192.168.1.177/a0 will return the analog value of A0 as JSON {“a0″:”123”}

With these calls you should then be able to interface your Nanode or arduino with ENC28J60 based ethernet board with web pages and other apps that can send http requests and receive simple JSON responses.

Full credit to Jason Gullicksonism for the original code, ideas and documentation.

Bookmark this post: bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

1 comment to RESTduino for Nanodes