Skip to main content
All CollectionsUser Guides
Plugins: Connect SenseCAP+Helium with Ubidots
Plugins: Connect SenseCAP+Helium with Ubidots

Integrate SenseCAP LoRaWAN Sensors with Ubidots using Helium Console.

Sergio M avatar
Written by Sergio M
Updated over 3 months ago

Ubidots and Seeed Studio have partnered to create a pre-built integration for SenseCAP LoRaWAN Sensors allowing users to easily forward data from Helium console to Ubidots using Plugins.

This Plugin is optimized to automatically decode Helium JSON schema, parsing items such as gateways metadata so you don’t have to!

Requirements

1. Creating a SenseCAP+Helium Plugin

The SenseCAP Plugin is a serverless function that exposes a private HTTP Endpoint URL optimized to decode Helium uplink JSON payload. Every time an HTTP POST request is received at such URL, a pre-defined decoding function will be executed.

To create your private HTTP Endpoint URL:

  1. In your Ubidots account, go to the "Devices" tab, click on "Plugins", then click on the "+" icon to create a new Plugin. Search for the SenseCAP + Helium and click on it:

  2. The Plugin instructions will appear. Click on the "Next" icon, then review the input parameters:

    • Ubidots token: Select the Ubidots token you'd like to use for this Plugin. We recommend creating a new token dedicated to this Plugin only, should you need to increase its rate limit in the future.

image.png

3. Finish the process and a new plugin will appear in the Plugins list:

image.png

4. Click on the newly-created SenseCAP+Helium Plugin, click on the "Decoder" tab, and copy the "HTTPs Endpoint URL". The structure of the URL is

https://dataplugin.ubidots.com/api/web-hook/<PLUGIN-ID>

image.png

Also, keep at hand your Ubidots TOKEN, it will be needed in the following steps.

2. Add a SenseCAP sensor node to the Helium console

Before connecting the SenseCAP sensor with the Helium console, please make sure to follow the installation process based on the following documentation:

  1. Step 1: Read the QR of the sensor to get the node's DevEUI and DeviceCode:

image.png

SenseCAP sensor device’s AppEUI and AppKey have been flashed into the device by Seeed Studio. To retrieve them, you just need to make an HTTP API request, to the below URL.

https://sensecap.seeed.cc/makerapi/device/view_device_info?nodeEui=PUT-SENSOREUI-HERE&deviceCode=PUT-SENSOR-KEY-HERE

Make sure to enter the nodeEui and deviceCode of your own sensor, you will get a response, similar to the one below, containing the AppKey which will be necessary to add the sensor to the Helium console.

{
"code": "0",
"data": {
"nodeEui": "2CF7F1212100001B",
"deviceCode": "7D497F49D0D05185",
"lorawanInformation": {
"dev_eui": "2CF7F1212100001B",
"app_eui": "8000000000000008",
"app_key": "3BF3D4C5744A057E0A1A61F4800EB09B"
}
}
}
SenseCapAppKey.gif

Device provision in Helium

Step 1: Go to the Helium console and register your account.
Step 2: Click on Devices and add a new device.
Step 3: Fill out the form as follows:

  • Name: custom setup

  • DevEUI: Sensor Device EUI obtain in step 1

  • AppEUI: 00 00 00 00 00 00 00 00

  • AppKey: Sensor AppKey obtain in step 1

Step 4: Save the device.
Step 5: Add a new label, then add the label to a device.


Step 6: Click on Integrations → Add New Integration → HTTP.
Step 7: Paste the HTTPs UbiFunction URL into the Endpoint URL.
Step 8: Select POST for the HTTP method.
Step 9: On the HTTP Headers section, add one with key X-Auth-Token and set its value to your Ubidots TOKEN.
Step 10: Give the new integration a name and click on the Add Integration button.

Step 11: Click on Flows.
Step 12: Drag and drop the Label block created in step 5.
Step 13: Drag and drop the Integration block created in steps 6 to 10.
Step 14: Connect the two blocks and save.


3. Editing the Plugin's device type

After creating a SenseCAP+Helium Plugin and clicking on it, you will see a "Decoder" tab, which contains a "Decoding Function" that you can edit at will, in order to decode your data frames. By default, you will see a pre-loaded sample decoder that does the following:

  • Create RSSI and SNR variables to track gateways receiving signals from your device.

  • Create a Frame counter, and a Port variable.

  • Decode payload, extract sensor measurements and battery information packets and send extracted values to Ubidots.

Ubidots will automatically create a device every time a payload from a new device is received. This saves you the need to manually create hundreds or thousands of devices, or copy-and-paste DevEUI's from one platform to the other.



An Ubidots device type will be created and linked to this plugin. This allows you to make batch changes to all of the devices that receive data through this plugin. The device type will be created based on the type of sensor you have connected.

4. Troubleshooting

The best way to test the plugin is by making an HTTP request to the Plugin's URL. Just grab the sample JSON payload below, and send it in an HTTP POST request using an HTTP client of your choice (Insomnia or similar). Make sure you add the header "Content-Type:application/JSON":

Sample Helium JSON payload:

{
"app_eui": "8000000000000008",
"dev_eui": "2CF7F1212100001B",
"devaddr": "19000048",
"downlink_url": "https://console.helium.com/api/v1/down/2167447e-5dd5-4f54-82c9-e4e36d107486/cIT7OoCgWHAlaGERnqjDD15dPTfRGPFv/7bcf175f-dfa5-4ec3-816f-bc0d34f14f3d",
"fcnt": 725,
"hotspots": [
{
"channel": -53,
"frequency": 904.5999755859375,
"hold_time": 1124,
"id": "112pHUTmRpaHPrcZb7NV5qgY1F8A912uJxa4kH7T4iPgeD3ZTyZ1",
"lat": 6.2028613336869425,
"long": -75.55880552965397,
"name": "recumbent-aqua-locust",
"reported_at": 1638422627997,
"rssi": -104,
"snr": -8.199999809265137,
"spreading": "SF8BW500",
"status": "success"
}
],
"id": "7bcf175f-dfa5-4ec3-816f-bc0d34f14f3d",
"metadata": {
"adr_allowed": false,
"cf_list_enabled": false,
"labels": [
{
"id": "3c13bf39-9864-4822-9083-c90bf1eb472d",
"name": "ubidots",
"organization_id": "7b79cd5e-d250-4327-9f8c-e454b997f11a"
},
{
"id": "69c9eef6-dc45-40cd-8e10-32dfa28c1474",
"name": "SenseCAP-TH-Node",
"organization_id": "7b79cd5e-d250-4327-9f8c-e454b997f11a"
}
],
"multi_buy": 1,
"organization_id": "7b79cd5e-d250-4327-9f8c-e454b997f11a"
},
"name": "SenseCAP Wireless Light Intensity Sensor",
"payload": "AQMQAAAAAOgn",
"payload_size": 9,
"port": 2,
"reported_at": 1638422627997,
"type": "uplink",
"uuid": "38c5c0b4-5327-4d7c-81cf-18ed6710a8d9"
}

Send the above payload in an HTTP POST request to the Plugin's URL:


Please note the first time the Plugin is executed, it may take a few seconds to respond. To check the Plugin logs, go to the Plugin, click on the "Logs" section and you should see a list of the latest executions.

image.png

5. Feedback and suggestions

Feel free to post questions or suggestions in our community portal, or drop us a line at support@ubidots.com.


Learn more about other plugins:

Did this answer your question?