Skip to content

ThingSpeak Adaptor

Paolo Grasso edited this page Jul 23, 2020 · 1 revision

General info

The ThingSpeak adaptor relies on two configuration files:

  • cherrypyconf: Configuration file for CherryPy webserver
  • conf.json: Configuration file which contains catalog ip, port, MQTT topic and URL of ThingSpeak website.

Execution

When launched, the adaptor should:

  • Start a thread which collects MQTT messages from sensors.
  • Start a thread which create a timer to prevent the adaptor to publish data on ThingSpeak within 15 seconds.
  • Start a thread which CherryPy RESTful webserver.

MQTT functions

  • Process MQTT messages from sensors containing environmental values. These data are aggregated into a temporary database which will be published on ThingSpeak every 15 seconds.

REST WebServer

  • POST environmental data on ThingSpeak, collected from sensors
  • GET environmental data from ThingSpeak requested by control strategies, Telegram bot and Freeboard
  • GET resource information from the catalog (e.g. the fieldID of a ThingSpeak channel for a specific environmental resource in order to publish related data)
Clone this wiki locally