Has anyone been successful in getting MQTT to work with Thingspeak? I have filled out the route as best as I could with Thingspeak MQTT info:
MQTT broker at the URL mqtt.thingspeak.com and port 1883 with the MQTT Topic set as:
channels/channelD/publish/fields/field1/writeAPIKey
It will not even give a error in the Details field on the Event page.
Hi @jm14830 thanks for the question, and welcome to the community!
We have a ThingSpeak tutorial in the docs, but it uses HTTTP, not MQTT, and Iāve not personally tried MQTT with thingspeak. Would the HTTP approach work for your application?
No, I specifically need MQTT. Iām not sure how to interpret all of the MQTT fields on the Routes page. Most are self explanatory, but the way it talks about Topics is weird or I just donāt understand what it is trying to say. Thingspeak tutorials also mention MQTT parameters that Blues does not mention. I am pretty new to MQTT myself.
gwolff. I tried your example almost to the letter. Although I have a different file and I only have a field1, not field2. I still do not get anything in my Route Log tab. Is there a way to see what Notehub is actually sending? I would expect at least to see an error message where Thingspeak kicked it back, but nothing. If you get to test it please let me know if it works for you. I appreciate the help.
I did some testing. I think I may have found the issue.
The JSONata expression produces a string which is encapsulated by āā characters, which seems to cause some issue with the Thingspeak data ingress.
Iāll see what else we can try to work around that.
@jm14830
Iāve been looking into this. Iām not sure MQTT is required. The MQTT option for ThingSpeak is just an API to read and write data from the ThingSpeak channel.
When writing data to the channel, the HTTP API produces the same result as using the MQTT option.
You can use either API on the same channel. And if you write to the ThingSpeak channel via the HTTP API, you can still subscribe to the channel updates via MQTT.