<< thingsboard_getToken bytecode_iot_module thingsboard_refreshToken >>

bytecode_iot_module >> bytecode_iot_module > thingsboard_postData

thingsboard_postData

Push data to ThingsBoard

Syntax

n = thingsboard_postData(url,posttoken,jsonbody)

Parameters

url :

The ThingsBoard platform url

posttoken :

Device post token

jsonbody :

A data string in JSON Format

n :

Status code

Description

Push data to a device in ThingsBoard. The device post token is different from the token used in retrieving data. The data needs to be in the form of JSON format which can be created using create_JSON.

Examples

// If you want to push data to a device with id ABC123
data = create_JSON("temp",24,"humidity",55)
token = thingsboard_getToken(url,user,pw)
[devicetoken,code] = thingsboard_getDeviceToken(url,token,"ABC123")
n = thingsboard_postData(url,devicetoken,data)

See also

Authors


Report an issue
<< thingsboard_getToken bytecode_iot_module thingsboard_refreshToken >>