(Python)How to use MQTT protocol to subscribe topics on Thingspeak.com and display it?

Viewed 3096

I have to write a python program using MQTT protocol to subscribe topics on thingspeak.com and display it on the screen of a Raspberry Pi. I found official help/documentation about publishing messages and field feeds to thingspeak.com, but they don't provide any information about how to subscribe a topic, e.g. what is the form of a topic string, what are the inclusions of that topic string etc. Does anyone have any clue about that?

2 Answers

just an update: ThingSpeak does support (at this moment) the possibility to subscribe to channels: https://nl.mathworks.com/help/thingspeak/use-desktop-mqtt-client-to-subscribe-to-channel-updates.html

just be aware that you need to get the topic exactly right to get te subscribe to work correctly

topic is like channels/[channel_id]/subscribe/json/[api readkey]

replace [channel_id] with you channel ID and [api readkey] with the api read key of that channel

you have to login with your username and as a pass an mqtt key that you can set under account>my profile > mqttkey on the ThingSpeak site.

Related