AllThingsTalk Maker (ATT Maker) is free and easy to use platform. It provides almost everything to create real Internet of Things solution:
- Full GUI administration
- Device management
- Charts and other visual controls for visual presentation
- Server-side rules engine for notification and actuation
- MQTT and HTTP Rest protocols
- Account on MAKER
- NodeMCU (or similar ESP8266 device)
- Arduino IDE with PubSubClient and ArduinoJSON libraries installed
Sign in into your ATT Maker and create (Connect a device button) your first device. Name of the device in this tutorial is NodeMCU, but you can define any other you want. Devices are identified with their DeviceID, not with name.
For the created device, add two assets: one sensor and one actuator.
To provide data for Arduino sketch, we need to get some details: DeviceID, Device Token and Asset name. First two values you will find under the device Settings=>Authentication. Asset name is what you input during asset creation into Display name field.
Find following lines in attached Arduino code and update with your data.
const char* ssid = "WiFi SSID ....."; const char* password = "WiFi password ....."; const char* mqtt_server = "api.allthingstalk.io"; char deviceId = "YourDeviceId..."; char token = "YourDeviceToken..."; char outTopicCounter = "device/[YourDeviceId]/asset/[AssetName]/state"; char inTopic = "device/[YourDeviceId]/asset/+/command";
After uploading code to NodeMCU, on the dashboard, counter start with displaying the last received value.
Click on the panel for the LED actuator, and you will get dialog box with option for sending command. At the bottom of the dialog box you will see "Command" panel. Change value to 0 or 1 (without quotes, type of actuator is integer) and send command to NodeMCU with click on green check mark. If everything works fine, you will see in serial console messages arrived from cloud, and built-in LED changes state (ON-OFF).
Message arrived [device/sxBP79eJDwOelE3TFIufXTLY/asset/led/command] 0 Message arrived [device/sxBP79eJDwOelE3TFIufXTLY/asset/led/command] 1