Arduino and logging over network with Node.js

Hi guys.

I've made a tutorial on how to use arduino with ethernet shield and Node.js server to make remote logging.

On Arduino I have a sketch which reads from analog port and sends udp packets to desired ip and port.
On the other side I have a computer with Node.js and udp server to listen to udp traffic.

I would really like to hear from you if tutorial is ok to improve on next. :slight_smile:
Tutorial is here: http://frenki.net/2012/10/remote-logging-with-arduino-and-node-js/

Hi
First of all. I think this is really interesting for remote debugging. I havn't tried it out yet but I probably will when I need something like this.

My comments on the text:

I read a bad advice in the first paragraph:

Connect arduino to your computer with usb cable and plug in additional 9V power adapter to make sure that shield will have enough power.
Put the ethernet shield on the arduino and plug in the ethernet cable from your network.

That should be

Put the ethernet shield on the arduino and plug in the ethernet cable from your network.
Connect arduino to your computer with usb cable and plug in additional 9V power adapter to make sure that shield will have enough power.

As far as I understand this runs on "Windows (XP or newer), Mac OS X (10.5 or newer), and Linux systems that use IA-32, x64, or ARM processors."
I think you should state that somewhere.

On the other hand you use a .bat file which is very windowish. Maybe you should say something like in windows you cane use a .bat file. In other os use the equivalent.

Best regards
Jantje

Thank you. I will fix it.

Just one more thing...
More advanced users could leave out byte to int conversion in node.js code:

if you change:
fs.appendFile('mydata.txt', msg.readUInt16LE(0) + crlf, encoding='utf8');//write the value to file and add CRLF for line break

into:

fs.appendFile('mydata.txt', msg, encoding='utf8');

You will be saving bytes in ascii characters and logging file will be much smaller...
One of my next projects will be to use arduino as an oscilloscope to send a lot of data quickly over UDP to browser.
In that case udp packets will be 512 bytes long instead of 2 bytes as in this example.

Great work! thanks for sharing this. I was able to follow your tutorial and get it working.

Thank you,
Chris