Questions tagged with Amazon FreeRTOS

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

  • 1
  • 12 / page

FreeRtos sample for STM32_L475E_IOT01A cannot establish connection

I'm using STM32 L475E_IOT01A2 and I tried to run the sample "Connect to AWS IoT - STM32-B-L475E-IOT01A", however, it always failed to establish the connection. Actually, it always returned secureSocketStatus=-1. Actual message observed on the screen is attached below. 1 535 [Tmr Svc] Waiting for 180 seconds before generating key-pair 2 180541 [Tmr Svc] WiFi firmware version is: C3.5.2.7.STM 3 180546 [Tmr Svc] WiFi firmware is up-to-date. 4 180552 [iot_thread] [INFO ][DEMO][180552] ---------STARTING DEMO--------- 5 180560 [iot_thread] [INFO ][INIT][180559] SDK successfully initialized. 6 185637 [iot_thread] [INFO ][DEMO][185637] Successfully initialized the demo. Network type for the demo: 1 7 185647 [iot_thread] [INFO] Creating a TLS connection to a26800ryr2bs98-ats.iot.ap-northeast-1.amazonaws.com:8883. 8 185739 [iot_thread] [ERROR] Failed to establish new connection. secureSocketStatus=-1. 9 185753 [iot_thread] [WARN] Connection to the broker failed. Attempting connection retry after backoff delay. 10 186056 [iot_thread] [INFO] Retry attempt 2 out of maximum retry attempts 5. (I omit following message just indicating repetitions.) I think configuration for aws_clienetcredential_keys.h and aws_clientcredential.h is ok. In aws_clienetcredential_keys.h, keyCLIENT_CERTIFICATE_PEM and keyCLIENT_PRIVATE_KEY_PEM are provided as created by CertificateConfigurator. In aws_clientcredential.h, BROKER_ENDPOINT, IOT_THING_NAME, wifi address and password are set properly. In aws_demo_config, CONFIG_CORE_MQTT_MUTUAL_AUTH_DEMO_ENABLED is defined. Further, I checked and found the problem may exist the handshake of ES_WIFI_StartClientConnection. (Observed handshake sequence is below.) Cmd:P0=0 -> ret=0, Cmd:P1=3 -> ret=0, Cmd:P2=0 -> ret=0, Cmd:P3=(remote IP address) -> ret=0, Now, ES_WIFI_STATUS & TCP_SSL_CONNECTION are ok. Cmd:P9=2 -> ret=0, Cmd:P6=1 -> ret=5, which I think means UNEXPECTED_CLOSED_SOCKET I think it leads to ecureSocketStatus=-1. I repeated many times, however, the result was always the same. Please let me know how to solve this. As I'm really a beginner, your instruction would be highly appreciated. regards, CK Additonal Information: I downloaded latest sample module from AWS site. Also, I updated wifi firmware module(SPI_C3.5.2.7) through Inventek website.
1
answers
0
votes
80
views
asked 4 months ago

FreeRTOS MQTT not connecting with Mi-Fi router

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.
2
answers
0
votes
32
views
asked 10 months ago
  • 1
  • 12 / page