This tutorial will guide you through the process of connecting a device (a Lamp) to SmartWorks and sending data to store it and implement simple business logic.
This tutorial will guide you through the process of connecting your ESP8266 and DHT10 sensor to SmartWorks to control the board LED light and monitor the surrounding humidity.
Stream Processing is a method of tracking and analyzing streams of information of an event, and eventually obtaining useful structured
conclusions out of that raw information.
SmartWorksEdgeOps is a set of tools for building, maintaining and continuously improving code in resource constrained devices at the
edge of smart connected ecosystems.
This tutorial will guide you through the process of connecting your ESP8266 and DHT10 sensor to SmartWorks to control the board LED light and monitor the surrounding humidity.
Data must be sent via HTTP or MQTT to SmartWorks. For this
project we are using MQTT connection.
MQTT Is the standard for IoT messaging. It allows for messaging between device to
cloud and cloud to device. More information on MQTT can be found here.
Client connections are always handled by a MQTT broker, which is responsible for
receiving and filtering the messages, determining who is subscribed to each
message and sending them. To configure the MQTT broker connection, the Host,
Username and Password are the required parameters.
Follow the steps below to connect your device via MQTT.
Substitute the default src folder for the one in the training
guide.
In Visual Studio Code, add the following: Open in VSCode and complete the
information required.
credentials.h: Add your Network ID, Network
password, MQTT username and password.
Note: You can obtain the MQTT username and password from AnythingDB –
Interface tab, by turning on Autogenerate the
username and password and clicking
Save.
Figure 1.
Topics_publish.h: Enter your Space name, Category name, Thing ID and Property ID.
Topics_humidity_publish.h: Enter your Space name,
Category name, Thing ID and Property ID.
Compile the code and upload it to your ESP8266 device.
Check that the data was received in the Raw History tab, as shown below: