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

All things pertaining to wireless and RF links

Moderator: phalanx

Post Reply
distro inferno
Posts: 17
Joined: Sat Apr 04, 2015 11:55 am

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

Post by distro inferno » Thu Mar 30, 2017 5:54 pm

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 :?

neverdie
Posts: 4
Joined: Thu Jul 13, 2017 10:52 am

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

Post by neverdie » Thu Jul 13, 2017 6:15 pm

Use MQTT.

lyndon
Support Volunteer
Posts: 1588
Joined: Thu Jul 17, 2008 6:37 pm
Location: Minnesota, USA

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

Post by lyndon » Tue Jul 25, 2017 2:23 pm

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.

uomo_di_hart
Posts: 3
Joined: Mon Jul 24, 2017 7:50 am

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

Post by uomo_di_hart » Tue Aug 01, 2017 8:09 am

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.

Post Reply