Is Thingspeak MQTT reliable?

4 ビュー (過去 30 日間)
Fabio Marzocca
Fabio Marzocca 2020 年 12 月 30 日
コメント済み: Fabio Marzocca 2021 年 1 月 2 日
I have a couple of NodeMCUs that are sending data to TS every 30 minutes since 2018, with no issues, using ThingSpeak API. These days I tried to give MQTT a chance, so I changed my code in order to use ThingSpeak MQTT broker to publish my data. I followed the code example from this page.
The result is really disappointing: while the devices are still sending the data every 30 minute (with no error codes) the data is not published every time, so I have my chart full of "holes". Sometimes they are published once an hour, some other every 2 hours, randomly.
I have checked the code many times, but it is quite straight-forward, so I have the suspect that the QoS=0 is not giving the best results.

回答 (1 件)

Vinod
Vinod 2020 年 12 月 30 日
I just tried this example for a few hours, admittedly it is on a Raspberry Pi, and had reliable results with no "holes" in the data. If your code on the NodeMCU is substantially different, can you share that so we may use that to help you troubleshoot? (Please mask/delete any API keys or credentials in your code you share)
  12 件のコメント
Vinod
Vinod 2020 年 12 月 31 日
編集済み: Vinod 2021 年 1 月 1 日
Thank you for testing it, Fabio.
We'll look into adding some examples in the ThingSpeak library that shows how to use MQTT to ThingSpeak reliably from devices like the ESP32 or NodeMCU. That should provide a good starting point.
Fabio Marzocca
Fabio Marzocca 2021 年 1 月 2 日
Hi Vinod,
I have replaced yesterday the sketch with MQTT code with the one using the web API calls. You can see the results yourself on the channel.
At this point we can exclude any network-related problem, restrisrting the troubleshooting to just 2 items: the PubSub library or Thingspeak's broker.

サインインしてコメントする。

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeWrite Data to Channel についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by