LWIP MQTT not connecting

조회 수: 21 (최근 30일)
Sébastien Trocherie
Sébastien Trocherie 2021년 11월 29일
댓글: Andrew Bierman 2024년 3월 26일 22:52
Hi,
I'm using the STM32F746NG discovery board to connect to the thingspeak MQTT broker.
However I can't connect to the server, i'm using dns to get the server ip adres which I then use in the mqtt_client_connect function.
When I get to the callback function the status is 256 (MQTT_CONNECT_DISCONNECTED).
I've had this problem before with a local MQTT broker (mosquitto 2.0), I was able to solve this problem by installing an older version (mosquitto 1.161a).
I'm using the correct credentials because they work in the mqtt_spy application.
Has anyone had this problem before or a sollution for this problem?
With kind regards
Sébastien

답변 (1개)

Vinod
Vinod 2021년 12월 31일
Could you provide more information - what is the client ID of your device? We may be able to look at the server logs given the client ID to provide you some pointers.
  댓글 수: 2
Andrew Bierman
Andrew Bierman 2024년 3월 26일 18:39
I am having the same problem using lwIP to connect to mqtt3.thingspeak.com. Was there a solution to Sébastien's problem?
I too am using a dns lookup service to get the Thingspeak server ip address (54.81.146.55), and I have tested this and the conection credentials using the MQTTX client app and they work for that app.
The client ID of my device is FDolEB05DQUGNCkiJywCBAA
Andrew Bierman
Andrew Bierman 2024년 3월 26일 22:52
My fault. Apparently, subscribing to a nonexistent channel casues the broker to disconnect. Without doing that it appears to work fine.

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

제품

Community Treasure Hunt

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

Start Hunting!

Translated by