We have provided two sample programs that integrate with ThinkSpeak. They are as follows:
-
chapter13/thingspeak_dht_mqtt.py: An example that uses MQTT to send data into a ThinkSpeak channel.
-
chapter13/thingspeak_dht_http.py: An example that uses the Python requests library to make RESTful API calls that send data to a ThinkSpeak channel.
The core concepts of these two programs were discussed in earlier chapters. For your reference, they are as follows:
- MQTT: We discussed the Paho-MQTT library in Chapter 4, Networking with MQTT, Python, and the Mosquitto MQTT Broker. A key difference for this chapter is that we are using the Paho-MQTT simplifying client wrapper to publish MQTT messages instead of a full life cycle example.
- We covered RESTful APIs and the requests library in Chapter 2, Getting Started with Python and IoT.
- The code related to the DHT 11/DHT 22 temperature and humidity sensor was covered in Chapter...