Search code examples
cassandrathingsboard

Posting multiple data in IoT gateway Thingsboard


I just now started using Thingsboard and I came across this one,https://thingsboard.io/docs/iot-gateway/getting-started/. I have implemented it but the problems that I'm facing are,

1.I can transmit only one Key-value pair. How can I transmit multiple key-value sensor data?

2.Also if there is any other way to access the Cassandra Database so that I can retrieve all mine data to Thingsboard.

Please help. Thanking you.


Solution

  • For example, humidity, temperature, gas.

    In this case you use one access token/single mqtt session and send data in single json like this

    {"humidity":42.2, "temperature":23.3, "gas":45}
    

    If you have multiple sensors attached to single device, send them like this

    {"sensorA.humidity":42.2, "sensorB.temperature":23.3, "sensorC.gas":45}
    

    Available topics are static and listed here: https://thingsboard.io/docs/reference/mqtt-api/#telemetry-upload-api