Send/Receive commands from a remote Arduino

Hello,

I want to communicate with an Arduino MEGA 2560, that is connected on a ethernet and measures temperature. How do I do this? I need to receive data and send commands...where should I start from? Is this something that has to do with sockets programming I believe?

Thank you...

If you want to control it from a web browser, and see the data in a web browser, communication over a websocket is one of the ways to do it (GETs and Server Sent Events is another).

I made an example doing this using a websocket, but it uses WiFi and an ARM board (Nano 33 IoT). Maybe the code can help you on your way; it is here:

Maybe there is a ready-made dashboard solution for this somewhere already, but I didn't look for one, as I wanted to roll my own.

Ok, web browser is fine. Can I store the data I will get in the web browser in a text/log file?

Not easily, because it would be a security risk to be able to save files from a browser, but there are ways of doing it, it seems, as discussed here:

It's not pretty, but it works. Still, a browser is an awkward environment for this sort of thing; a dedicated logger along the lines of this one:

https://docs.python.org/2.4/lib/network-logging.html

may serve you better.