All Collections
Connect your Devices
Connect Seeed Studio’s SenseCap S2100 LoRaWAN Data-logger to Ubidots[Helium LNS]
Connect Seeed Studio’s SenseCap S2100 LoRaWAN Data-logger to Ubidots[Helium LNS]

This article explores how to send data from Seeed Studio's SenseCap S2100 to Ubidots.

S
Written by Sergio M
Updated over a week ago

SenseCAP S2100 Data Logger is a powerful edge device featuring a LoRa transceiver which allows sending data to your prefered network server supporting frequency plans such as 863MHz ~928MHz. The S2100 is able to communicate to any sensor via MODBUS-RTU RS485 as well as Analog 4~20mA/0~10V and also GPIO level/pulse sensors.

One of its most remarkable features is its capabitily to work in harsh environments, since it implements the IP66 rated enclosure, suitable for outdoor use, high UV exposure, heavy rain, dusty conditions, etc.

Requirements

1. Configure the SenseCap S2100

2. Register the SenseCap S2100 on Helium LNS

3. Create the Integration to Ubidots

4. Configure the decoder function

  • Go to "Functions" section on your Helium Console.

  • Click on "Create new function" button.

  • Click "Custom".

  • Set a name for your decoder function.

  • Delete all the code in the text box.

  • Paste the official decoder function for this device provided by Seeed Studio on their official GitHub repository.

  • Click on "Save Function" button.

5. Connect the Integration to Ubidots

6. Configure the Ubidots decoder

  • Go to your Ubidots account.

  • Go to "Devices" --> "Plugins".

  • Search for a newly created plugin. Its name is most likely to be "Helium integration".

  • Click on the pencil icon.

  • Head to the "Decoder" section at the left side of the screen.

  • Scroll down to the "Decoding Function" section and delete all the code present in the textbox.

  • Paste the following code.

  • Click on "SAVE & MAKE LIVE" button to save the changes.

Decoder function code:

function format_payload (args) {
var messages = args['uplink_message']['decoded_payload']['messages']
var ubidotsPayload = {}
var varLabelMap = {
1: 'measurement1',
2: 'measurement2',
3: 'measurement3',
4: 'measurement4',
5: 'measurement5',
6: 'measurement6',
7: 'measurement7',
8: 'measurement8',
9: 'measurement9',
10: 'measurement10'
}

messages.forEach(msg => {
msg.forEach(innerList => {
if (innerList.hasOwnProperty('measurementId')) {
ubidotsPayload[varLabelMap[innerList.measurementId]] =
innerList['measurementValue']
}
})
})

return ubidotsPayload
}

module.exports = { format_payload };

7. Visualize the Data on Ubidots

  • Head to the “Devices” section on your Ubidots account and you’ll be able to see a newly create device with the same name as you used for “Device name” at step 2. Here you can check an example.

Did this answer your question?