Arduino ethernet communication

2019-09-04 03:43发布

问题:

Is it possible to get sensor output from Arduino via Ethernet connection and to send data to Arduino via Ethernet?

So basically can "replace" serial port with Ethernet port?

回答1:

The typical way to do this is with an Arduino Ethernet shield, a small hardware module that plugs into your Arduino board:

  • http://arduino.cc/en/Main/ArduinoEthernetShield

Updated:

One very common approach for client to server communication would be to use HTTP over TCP/IP. See this example on the Ardunio site of a simple client on an Ardunio connecting with a server (in this case google):

  • http://arduino.cc/en/Tutorial/WebClient

For your use case you can simply create your own server and modify the example to send data to it.

Alternatively you can skip the HTTP part and just use sockets - there is an open source example here:

  • https://github.com/billroy/socket.io-arduino-client