PDA

View Full Version : Using the Raspi as an Ethernet shield



wraggster
June 24th, 2012, 23:14
http://hackadaycom.files.wordpress.com/2012/06/ardupi.png
[Alexandre] wanted to set up a web-based temperature logger with his Arduino, but found the Arduino Ethernet shield a little finicky. Since his Raspberry pi was just delivered, he figured he could use the Raspi as an Ethernet shield (http://alexandre.alapetite.fr/doc-alex/raspberrypi-nodejs-arduino/) with just a little bit of coding.
After [Alexandre] set up his Arduino to send a thermocouple through the USB, the only thing left to do was to add node.js (http://nodejs.org/) to the Raspi’s Debian installation. Every five minutes, the Arduino wakes up, takes a temperature reading, and sends it over to the Raspberry pi. From there, it’s easy parse the Arduino’s JSON output and serve it up on the web.
In the end, [Alexandre] successfully set up his Raspberry pi as an Ethernet shield to serve a web page displaying the current temperature (http://pc.alapetite.fr:8080/temperature) (don’t F5 that link, btw). One interesting thing we have to point out is the cost of setting up this online temperature logger: the Arduino Ethernet shield sells for $45 USD (http://www.sparkfun.com/products/9026), while the Raspberry pi is available for $35. Yes, it’s actually less expensive to use a Raspberry pi as an Ethernet shield than the current Arduino offerings. There you have it, just in case you were still on the fence about this whole Raspi thing.

http://hackaday.com/2012/06/24/using-the-raspi-as-an-ethernet-shield/