[SOLVED] Communicating with Arduino over ethernet using Node.js

I’m extremely stumped. I’ve spent 3 hours googling an answer to my problem. What I have is a arduino that controls some relays. It’s controlled by node.js. Everything works great using usb and SerialPort package. What I need to do is drop the USB connection and make this work over Ethernet.

I set up as much as I could and I can ping the arduino through terminal. But where I’m stumped is how to send data (serial data?) to the arduino over the network/ethernet. Before I’d configure my port like… tty/usbmodem141… how do I now send the data to the device on the network? Can I send serial data? Do I need a different package? Thanks guys!

Can I send serial data?

Not unless The Arduino is connected to the serial port of the PC that wants to send it data. If that was the case, wearing the Ethernet shield would be unnecessary.

Do I need a different package?

Probably. Different, though, requires some baseline. You haven't defined what you want to be different from.

thegregthomp:
I'm extremely stumped. I've spent 3 hours googling an answer to my problem. What I have is a arduino that controls some relays. It's controlled by node.js. Everything works great using usb and SerialPort package. What I need to do is drop the USB connection and make this work over Ethernet.

I set up as much as I could and I can ping the arduino through terminal. But where I'm stumped is how to send data (serial data?) to the arduino over the network/ethernet. Before I'd configure my port like... tty/usbmodem141... how do I now send the data to the device on the network? Can I send serial data? Do I need a different package? Thanks guys!

OK you will need to setup basic ethernet on the Arduino with IP addresses, subnet masks etc etc - it feels if you are asking questions at this level that you do not have much Network/Internet experience ?

If so then i would suggest you have a look at a couple of the ethernet examples in the IDE and get a feel for how this stuff is configured.

From your client (PC etc) you will then need to tell it to pump data/commands out through its network to the IP address of the Arduino

Craig

how do I now send the data to the device on the network?

You need a network interface on the arduino like an Ethernet shield.

Hey, basically what I did was use the ethernet shield and webduino to create a REST API like interface and it works pretty well.

thegregthomp:
Hey, basically what I did was use the ethernet shield and webduino to create a REST API like interface and it works pretty well.

You should post up your project description and code in the Exhibition area for others to learn from also

Craig