- Philipp Auer (01420446)
- Rafael Cristino (12202238)
- Xavier Pisco (12206635)
- esp32 - Folder with the code to execute on the ESP32
- thingy - Folder with the code to execute on the Thingys
- mosquitto.conf - File with the configuration for the Mosquitto broker
- README.md - This file
- Mosquitto
- Arduino IDE with the following libraries:
- ArduinoHTTPClient
- ArduinoJSON
- PubSubClient
- ThingsBoard
On the ThingsBoard you should:
- Create a device which is a gateway
Before uploading the code to the ESP32 you should do these changes in the esp32/esp32.ino file:
- Change the
TOKENvariable to the access token of the device - Change the
SERVERvariable to the IP of the computer running Mosquitto - Change the
WIFI_AP_NAMEandWIFI_PASSWORDto the WIFI credentials to which the ESP32 should connect
On the mosquitto.conf you should:
- Change the
addressto the ThingsBoard address - Change the
remote_usernameto the device access token
- Build and upload the thingy code into the 3 Thingys
- Build and upload the esp32 code into the ESP32
- The 3 different temperatures should appear on the
Latest Telemetrytab in the ThingsBoard device
We created a dashboard which shows a graph with the 3 temperatures over time.
You can request an average of the 3 captured temperatures via RPC. To do so we created a button on the Dashboard. After clicking it the ESP32 will reply with an average, which is also displayed on the dashboard.
In order to connect the mosquitto broker to the ThingsBoard it is very important to configure the respective device as Gateway. Additionally the local broker has to sign into the ThingsBoard using the device access token in its username configuration.
Our configuration file mosquitto.conf is included with the code and this documentation file.
We had a lot of issues concerning the RPC capabilities of ThingsBoard. In order to finally solve it, we needed to
- Connect our own mosquitto broker
- Subscribe the broker to the specific incoming topic that is used for RPC (
v1/devices/me/rpc/request/+).
If the ESP is connected directly to the ThingsBoard or the broker subscribes to a wildcard topic, the service won't work and the ThingsBoard will throw a 504 Gateway Timeout error.

