FreeRTOS MQTT not connecting with Mi-Fi router

0

Hi, I have an IoT device based on the FreeRTOS shadow PIC32 demo. When it's connected to a standard DSL Wi-Fi router it works fine, subscribes to the IoT shadow and everything works OK. However, when I connect to a Mi-Fi 4G router on the sky mobile (O2) network, it fails to connect to MQTT. I have made sure that I can connect on port 8883 to AWS endpoint on the Mi-Fi 4G router using powershell command:

test-netconnection -computer am3w08epmsyee-ats.iot.eu-west-2.amazonaws.com -port 8883

A connection is established OK.

This is the console out when it fails:

33 14822 [IP-task] Socket sending wakeup to MQTT task.
...

44 24823 [MQTT] About to close socket.
45 25823 [MQTT] Socket closed.
46 25823 [MQTT] Notifying task.
47 25823 [MQTT] Received message 0 from queue.
48 25824 [IoTShadowClient-Init] Command sent to MQTT task failed.
49 25824 [IoTShadowClient-Init] [Shadow 0] MQTT: Connect failed.
50 25824 [IoTShadowClient-Init] AWS shadow client connect unsuccessful, returned 2.
51 25824 [IoTShadowClient-Init] Failed to connect shadow client.`

I have debugged the code and found that the ***prvSendCommandToMQTTTask ***function returns 'eMQTTCouldNotBeSent' in the receive message identifier.

I have checked all the router settings, firewall is currently off. I have ensured that port 8883 is open. I am using a TP-Link router MR6400 using Sky Mobile (O2). It's worth noting that I have also tried on a Hauwei router also with the same result.

Any ideas welcome.

Thanks.

gefragt vor 2 Jahren267 Aufrufe
2 Antworten
0

I would test the connection with an MQTT client (AWS IoT SDK example or a regular MQTT client like mosquitto) on a computer connected to the affected router.

Bora
beantwortet vor 2 Jahren
0

Thanks, good call I' will do. But to ask perhaps a dumb question, Is there any reason why it would not work on a mobile network provider?

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen