Programming Sensor Nodes To Use The Libelium Cloud Bridge Service
Last updated
Last updated
Sensor nodes have to be programmed to send data to the Libelium Cloud Bridge service. There are two options for that: using the Programming Cloud Service or manually writing code on the Waspmote IDE.
The Programming Cloud Service has the option "Send to Libelium Cloud Bridge" in the "Protocol and destination" section to generate valid programs that will connect directly to the Libelium Cloud Bridge service. All the security and encryption layers available in the Libelium security scheme will be implemented in those programs.
The information needed in the Programming Cloud Service to generate the specific binary program of each sensor node is shared from the Services Cloud Manager and the Libelium Cloud Bridge service. All the services available in the Libelium Cloud have access to the user information (active license type) and to the sensor nodes properties (unique device ID and MAC address).
The Programming Cloud Services has the section "Communication module" to choose what will be the radio used by the sensor node to send data. The available options are:
XBee-PRO 802.15.4
XBee-PRO 900HP
XBee-PRO 868LP
4G
WiFi
Sigfox
LoRaWAN
Depending on the communication module used in the sensor node, there will be different possibilities to send data to the Libelium Cloud Bridge service. In the section "Protocol and destination" the available options will change according to the selection done in the "Communication module" section.
In all cases, the recommended option is "Send to Libelium Cloud Bridge". In some cases data will need to go through the Meshlium gateway and in other cases the data will be sent directly to the Libelium Cloud Bridge service.
Nodes using LPWAN communication modules will always send the data through the LPWAN backend servers, in the section "Receiving Data" of this guide it is explained how to configure the callbacks properly to redirect the data to the Libelium Cloud Bridge service. In the next table we show the possible choices:
If the destination Meshlium gateway has the Libelium Cloud Bridge service connector properly configured, the data will be redirected to the Libelium Cloud Bridge service.
It may be possible to configure the HTTPS parameters with the values of an active and running Meshlium gateway. If the destination Meshlium gateway has the Libelium Cloud Bridge service connector properly configured the data will be redirected to the Libelium Cloud Bridge service, this option is discouraged in favour of using the "Send to Meshlium Gateway". It may be possible to configure HTTPS parameters with the values of the Libelium Cloud Bridge service, this option is discouraged in favour of using the "Send to Libelium Cloud Bridge".
It may be possible to configure the HTTP parameters with the values of an active and running Meshlium gateway having the HTTP protocol manually activated. If the destination Meshlium gateway has the Libelium Cloud Bridge service connector properly configured the data will be redirected to the Libelium Cloud Bridge service, this option is totally discouraged because all the security layers are disabled with this configuration.
In the Waspmote API documentation there is a sketch available (the HTTPS example) that may be used for the user as the basis for coding on the Waspmote IDE, a valid call to the Libelium Cloud Bridge service. Parameters needed for the HTTPS call to the Libelium Cloud Bridge service are:
Host: hw.libelium.com
Action: GET /hw/ps?frame=[FRAME TO SEND] HTTP/1.1
Authorization: Bearer [API KEY FROM BRIDGE]
Example using "curl" tool to simulate the HTTPS call: