Communicating Serial across Ethernet

Hi Everyone,

Thank you in advance for any assistance you're able to provide :slight_smile: A project has come up where I have to communicate the serial data across a radio network (ethernet) to a PC. Is anyone able to provide assistance in how I would attempt this?

I have read about creating a webserver on the arduino using an ethernet shield however every example sends html, I want to send (packetised? TCP?) data across the ethernet to be read by a c++ program?

Not a network engineer so please excuse if I have used some incorrect terms.

Thanks, Grant.

across a radio network (ethernet) to a PC

Ethernet does NOT involve radios.

every example sends html, I want to send (packetised? TCP?) data across the ethernet

The client.print() and server.print() methods don't know that they are sending html. All that they know is that they are sending data. Even better would be to use the appropriate write() methods.

to be read by a c++ program?

Is that a question? Is the C++ program acting as a server? As a client?

EthernetClient object wraps a TCP socket. A normal TCP socket is connected to IP address and port. EthernetServer starts a listening socket on a port. If server on listening socket is contacted by a remote client socket, it creates a local socket connected with the remote client socket on a free port and returns a EthernetClient object wrapping the socket. Everything you write or print to a EthernetClient is send to that one remote socket.

Juraj:
EthernetClient object wraps a TCP socket. A normal TCP socket is connected to IP address and port. EthernetServer starts a listening socket on a port. If server on listening socket is contacted by a remote client socket, it creates a local socket connected with the remote client socket on a free port and returns a EthernetClient object wrapping the socket. Everything you write or print to a EthernetClient is send to that one remote socket.

Thanks Juraj for your explanation, that clears a lot up.