The Ethernet is included via PIC32_USE_ETHERNET in the Project Properties Preprocessor macros, and seems to work. I’ve check via a breakpoint in defined Ethernet area. As seen it has been given a client IP address by the router. The router is connected to the internet.
In debug mode, I can see that the AWS’s CONNACK is missing from the PIC’s CONNECT try.
The timeout occurs in IotMqtt_Wait().
As I see it, there can be two alternative faults here:
Either in the PIC, ie incorrect setting or so, or
AWS is blocking
The only changes in code are, but I’m not sure if they are correct:
#define clientcredentialIOT_THING_NAME “MyDevice”
Note: Same endpoint as defined in AWS IoT Setting, my AWS region is eu-west-1 and the thing MyDevice is created in the AWS IoT.
From the log, it seems the project is using ethernet. Network type for the demo: 4 And it seems you were not able to connect to IoT core. The expectation for our MQTT demo is it should work out of box, and I’m going to set it up locally to verify the head of aws/amazon-freertos master branch.
Meanwhile,
- You’ve mentioned the demo worked for you. Could you confirm whether it was on WiFi or Ethernet?
- There may exist some difference between IDE and CMake project. If you are using CMake to see this error, could try IDE.
- Since ethernet, may want to check cable… (I know…)
-------- Updated --------
I’ve verified aws/amazon-freertos the HEAD of master branch Microchip PIC32 IDE project on Windows, and MQTT demo was working for me over ethernet. (Log attached, with IoT endpoint commented out.) May try the same code to confirm whether there was a setup issue.
My misstake, I’ve jumped around in different AWS Regions and then forget to perform a Clean before going into the Debug session. Therefore the endpoint was incorrect, and unfortunately it wasn’t seen in the debug UART. I found out via removing the internet connection and got the debug info in clear text about the incorrect endpoint.
After a Clean , my target has the correct endpoint and work as expected!
Lesson learned: Always perform a Clean before a build!