ThingSpeak is an IoT platform with built-in MATLAB® analytics, which allows preprocessing, analyzing and visualizing data sent by IoT devices, as well as creating actions such as alerts based on you channel data. Milesight LoRaWAN® devices can connect to ThingSpeak via TTNv3.
- TTNv3 Account
- ThingSpeak Account
- Milesight LoRaWAN® Devices (Sensors, Controllers, in this example AM107 is used)
Step1.Connect Device to TTNv3
Connect device to TTNv3 followed article How to Connect Milesight End Devices to The Things Stack v3 and ensure the TTN receives data normally.
Step2. Setup ThingSpeak
Log in ThingSpeak account, click New Channel to add new data channels. In this channel, we define 7 fields. Click Save Channel to save all settings.
After save, you can find channel ID and API keys which will be used for TTN integration.
Click Applications-> Integration -> Webhooks to add a ThingSpeak webhook.
Webhook ID: user-defined
Channel ID: ThingSpeak Channel ID
API Key: ThingSpeak Write API Key
Click create thingspeak webhook save the configuration.
Step4.Add Device Decoder and Check Data
Paste the device decoder in Payload formatters tab. Milesight device decoders can be found here.
Change the decoder variable names to corresponding fields in ThingSpeak channel field order.
In this example, we need to change the temperature to field1, humidity to field2, activity to field3...
After change, click Save changes.
Then TTN will process the data as fields.
You will see data sent as field order in ThingSpeak and process it.