3

I'm using ThingsBoard demo, with a throw-away test device:

  • Name: Test
  • Device ID: 779e65d0-366f-11e9-b411-fdd6fdf5c064
  • Access Token: DdqzgX0Q4QLBbveiuY8e

I set up a subscriber:

mosquitto_sub -h demo.thingsboard.io -u DdqzgX0Q4QLBbveiuY8e -t hello

Then I publish:

mosquitto_pub -h demo.thingsboard.io -u DdqzgX0Q4QLBbveiuY8e -t hello -m hi

mosquitto_pub returns 0 (success), but I see nothing shown by either mosquitto_sub or in the Test device's "Latest Telemetry".

How do I get both ThingsBoard and the subscriber to see my hi message?

Tom Hale
  • 211
  • 2
  • 7
  • Every platform has it's own rules as to what it handles. We followed their https://thingsboard.io/docs/getting-started-guides/helloworld/ and got it to work. – Gambit Support Feb 26 '19 at 15:38
  • I have the same beahavior by using the correct form: mosquitto_pub -h thinksboard_host -t v1/devices/me/telemetry -m '{"answer": 42}' -u device_access_token what could it be? – Gianluca Petralia Nov 12 '19 at 15:51

1 Answers1

1

TL;DR:

ThingsBoard expects a fixed topic of v1/devices/me/telemetry and a JSON message, eg:

mosquitto_pub -h demo.thingsboard.io -t v1/devices/me/telemetry -m '{"answer": 42}' -u DdqzgX0Q4QLBbveiuY8e

The ThingsBoard MQTT Device API Reference says:

In order to publish telemetry data to ThingsBoard server node, send PUBLISH message to the following topic:

v1/devices/me/telemetry

The simplest supported data formats are:

{"key1":"value1", "key2":"value2"}
Tom Hale
  • 211
  • 2
  • 7