I've tried to follow specification of the MQTT subscribe API to grab the feed from some public channel, but it doesn't seems to work (at least now): https://www.mathworks.com/help/thingspeak/subscribetoachannelfeed.html
Tried with the described MQTT.fx client and also with mosquitto_sub.
Here is the command line I tried for the public weather feed from the API docs:
mosquitto_sub -h mqtt.thingspeak.com -t channels/12397/subscribe/json -d -v -V mqttv311
Debug output is just:
Client mosqsub|20264-zld52_lin sending CONNECT Client mosqsub|20264-zld52_lin received CONNACK Client mosqsub|20264-zld52_lin sending SUBSCRIBE (Mid: 1, Topic: channels/12397/subscribe/json, QoS: 0) Client mosqsub|20264-zld52_lin received SUBACK Subscribed (mid: 1): 128 Client mosqsub|20264-zld52_lin sending PINGREQ Client mosqsub|20264-zld52_lin received PINGRESP ...
It communicate as it should, but doesn't sending data.
Is the provided API actually working or am I doing something wrong?
I just tried to subscribe to the weather channel with MQTT.fx and it is working. Your syntax for the topic looks correct. "channels/12397/subscribe/json" Can you describe what happened with the fx client? Did you set your MQTT API key as the password? There is a troubleshooting page that might help. Ill try mosquitto_sub and see if I can get that to work.
Thanks for the reply, the problem was the password as I thought that for public feed I don't need to use the MQTT API key as is mentioned in the documentation. But it is valid only for the topic itself not the user credentials.
When I tried:
mosquitto_sub -u username -P MQTT_API_key -h mqtt.thingspeak.com -t channels/12397/subscribe/json -d -v -V mqttv311
It started to work.
It also works with the MQTT.fx with correct user credentials.
Most Users Ever Online: 114
Currently Browsing this Page:
Guest Posters: 1
Administrators: Hans, lee