Page 1 of 1

Best way to send a measurement from ESP8266 to a computer?

Posted: Thu Mar 30, 2017 5:54 pm
by distro inferno
I am trying to send several measurements (ints, floats) over wifi to another computer on the network, using the ESP8266 Thing Dev board. I can use a simple website hosted by the ESP to display the values as text, then pull that and parse it on a server, however I need to keep the ESP in deep sleep most of the time, only waking for a moment to measure and toss out some values.

At first I thought I could have the server poll the IP address of the ESP many times a second, catching and parsing the website when the ESP throws it up, but that is impractical. Does anyone know a better way that the ESP can quickly throw some data to a ready-and-waiting server?

Maybe send some packets to a port on the server? Is there a library out there anyone recommends for this? I don't want to have to bit-bang the network stack :?

Re: Best way to send a measurement from ESP8266 to a compute

Posted: Thu Jul 13, 2017 6:15 pm
by neverdie
Use MQTT.

Re: Best way to send a measurement from ESP8266 to a compute

Posted: Tue Jul 25, 2017 2:23 pm
by lyndon
If it has a webserver, it has to have a network stack! I'd send the data as UDP multicast packets if you don't care about a specific listener.

Re: Best way to send a measurement from ESP8266 to a compute

Posted: Tue Aug 01, 2017 8:09 am
by uomo_di_hart
If you have any experience with MySQL or a related SQL database you can use that with little problem. The esp has a MySQL library that is decent. The only problem that I've ran into using this is that the esp will sometimes take a long time (30-40 minutes) to connect to the Wifi after waking up and it will time out if you don't place the connection function within a while loop that checks its connection. But if it connects to the wifi it can upload to MySQL very fast.