Skip to Content
Internet of Things with ESP8266
book

Internet of Things with ESP8266

by Marco Schwartz
July 2016
Intermediate to advanced
226 pages
4h 6m
English
Packt Publishing
Content preview from Internet of Things with ESP8266

Logging data to Dweet.io

We are now going to see how to log the temperature and humidity measurements in the cloud. We will use the Dweet.io cloud service here, which is very convenient for logging data online:

http://dweet.io/

Note

As the code for this part is very long, we will only see the important parts here. You can of course get all the code from the GitHub repository for this project at https://github.com/openhomeautomation/iot-esp8266.

Again all the measurements are done inside the loop() function of the sketch, which makes the code repeat every 10 seconds, using a delay() function.

Inside this loop, we connect to the Dweet.io server with:

WiFiClient client; const int httpPort = 80; if (!client.connect(host, httpPort)) { Serial.println("connection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ESP8266 Internet of Things Cookbook

ESP8266 Internet of Things Cookbook

Marco Schwartz
ESP8266 Robotics Projects

ESP8266 Robotics Projects

Pradeeka Seneviratne

Publisher Resources

ISBN: 9781786468024Supplemental Content