MQTT X and thingspeak - lost connection

25 ビュー (過去 30 日間)
Vegar Bartnes
Vegar Bartnes 2022 年 3 月 9 日
編集済み: Stonez Chen 2022 年 3 月 16 日
Hi :-)
I have followed the instructions on mathworks site:
I have downloaded the MQTT X software.
Then I add a new connection as described. The username, password and ID i get from my thingspeak device in my account.
I then at 3) "Click" the connect button, the program replies "connected". But within 3-6 secounds the connection is lost... so I never get to test out the rest of the subscription and publish.
This should not be a difficult task, but I an stuck :-(
Are there anyone experiensing the same?
mvh vegar bartnes
  6 件のコメント
Vegar Bartnes
Vegar Bartnes 2022 年 3 月 14 日
I have resett my device in thingspeak, new ID and password. Still the same read ECONNRESET.
Then I am not able to add new subscription because no connection.
vegar
Vinod
Vinod 2022 年 3 月 14 日
@Vegar Bartnes: Did you see my screenshot below showing the connection settings? If you are still unable to connect, please share your clientID you are using to connect.

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

回答 (2 件)

Stonez Chen
Stonez Chen 2022 年 3 月 13 日
編集済み: Stonez Chen 2022 年 3 月 13 日
Hi Christopher,
I'm making a YouTube video in Traditional Chinese to show people how to use ThingSpeak MQTT.
However, I'm also facing the same problem that both my ESP32 & Node-RED lost mqtt3.thingspeak.com connection right after a successful connection. Both ESP32 & Node-RED are under the same Wi-Fi AP.
I'm sure that MQTT device is created and mapped to a Channel.
Server: mqtt://mqtt3.thingspeak.com
Retain: False
QoS: 0
Clean session: 1
I use client.state() to check on my ESP32 and the result is: -3 (MQTT_CONNECTION_LOST - the network connection was broken)
What could be the problem? Server issue or mine issue?
Thanks,
Stonez
PS: My last video is with home hosted MQTT server: MQTT + ESP32 + Mosquitto on Raspberry Pi
  8 件のコメント
Vinod
Vinod 2022 年 3 月 15 日
@Stonez Chen: Your connection will be disconnected if you try to publish or subscribe to an invalid topic or a topic your client is not authorized to access. So, if you only publish/subscribe to topics with valid payloads, your connection should be stable.
Stonez Chen
Stonez Chen 2022 年 3 月 16 日
編集済み: Stonez Chen 2022 年 3 月 16 日
@Vinod You are right! A soon as I modifyed :
Publish topic: channels/1675230/publish
Message: field1=true
The MQTT worked! The issue got me for few days....Thanks!
Stonez

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


Vinod
Vinod 2022 年 3 月 14 日
編集済み: Vinod 2022 年 3 月 14 日
Here's the settings you need to connect with MQTTX:
  5 件のコメント
Vegar Bartnes
Vegar Bartnes 2022 年 3 月 14 日
Now with a brand new channel it works, almost...
Field1 does not work?
Vegar Bartnes
Vegar Bartnes 2022 年 3 月 14 日
Ups again! just a empty space. Everything works fine now!
vegar

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

コミュニティ

その他の回答  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