Go Down

Topic: Great method for easy communication to a browser (Read 1 time) previous topic - next topic

SamFentress

Hi all,

I just wrote a blog post about an easy way to communicate from an Arduino directly into an online webpage, without using Flash or Java, just over an ethernet cable. I thought I'd share this here.

http://blog.concord.org/streaming-arduino-data-to-a-browser

Similar things have been done before (the idea started from the simple Arduino Server example), but it seems that most people still think that we need to read from the serial post to get data into the computer.

This technique is great because it allows you to develop rich applications using just JavaScript. All the real code on that page, like the graphs, is just scripting without ever needing to modify the Arduino's sketch.

robtillaart

Well done (although not working now I got the idea)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

SamFentress

Did you try it and it didn't work for you? I've tried it on a couple different browsers and different Arduinos, and the process of sending data to the browser has always been a snap. Really a 2-minute set-up from start to finish. And it works on any computers, such as a school lab computer: no need to install drivers or anything.

You can try out the stand-alone example as well: http://jsfiddle.net/SamFent/vp5Dg/embedded/result/

I think with some further expansion on that demo (reporting info from the digital pins, for instance), it would make a great workbench for experimenting with the Arduino.

robtillaart

Quote
Did you try it and it didn't work for you?


I did try your website and it was not working, (that was where I refered to), FYI I used FireFox 11.0 on Win7/64 SP1
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

redness

Hello!

This sounds great! I know that it works with the arduinos with the ethernet availability, but I have the arduino nano which only have the micro-usb connection. Is there a way that this arduino could do this?  :\

Thank you!

SamFentress

If you wanted to you use this same technique, the easiest thing to do would probably to get an ethernet shield for the Arduino Nano, like this one: http://www.robotshop.com/arduino-nano-ethernet-board-microsd.html

If you just want to use the USB output, that probably requires Java or Flash or something -- that's what we are avoiding by using the ethernet.

SamFentress

I have a created a small library for making this work even easier: https://github.com/sfentress/ArduinoEthernetCom

Now you can create basic examples of getting data from an Arduino with about 10 lines of JavaScript. You can look at the source of the example page at http://sfentress.github.com/ArduinoEthernetCom/example.html

Go Up