Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

subtopic help
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

subtopic help

by epress on Wed Mar 11, 2020 1:56 pm

Hi,
Trying to post in via MQTT and having an issue - If I have subtopics, it does not seem to work!

Posting to Mosquitto (using the -v option) I'm subscribed to:
Code: Select all | TOGGLE FULL SIZE
mosquitto_sub -h ipAddress -v -t userId/f/sensors/#


(User ID = Adafruit UserId)

And I see data
Code: Select all | TOGGLE FULL SIZE
userId/f/sensors/RTD/add102 {"ModuleType":"RTD","Reading":23.199,"Address":102,"Name":""}


Then I try to switch over to adafruit, and I see NO data

Interesting, when the sender is just using the topic:
Code: Select all | TOGGLE FULL SIZE
userId/f/sensors


I get the data, with no issue.

What am I doing wrong? Is there a different format for subtopics?

epress
 
Posts: 1
Joined: Tue Jun 18, 2019 5:10 pm

Re: subtopic help

by brubell on Thu Mar 12, 2020 11:28 am

There aren't subtopics in IO like you'd have in a typical MQTT broker. We use grouped feeds which you can pub/sub to through a single MQTT topic.

The topics formats for publishing or subscribing are:

Code: Select all | TOGGLE FULL SIZE
(username)/groups/(group name or key)
(username)/groups/(group name or key)/json
(username)/groups/(group name or key)/csv


For more information, check out the MQTT API page for this topic: https://io.adafruit.com/api/docs/mqtt.html#group-topics

- Brent R.

brubell
 
Posts: 792
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.


cron