2 Replies Latest reply on Jun 5, 2020 9:43 PM by WiWi_4702256

    Heads up - AnyCloud Example: MQTT Client

    WiWi_4702256

      In the modbus example README.md for AnyCloud Example: MQTT Client application for CY8CKIT-062-WIFI-BT,

      There is a link to git under OPERATION:

      ...

      "You can either convert the values to strings manually following the format shown in *mqtt_client_config.h* or you can use the HTML utility available [here](https://github.com/cypresssemiconductorco/amazon-freertos/blob/master/tools/certificate_configuration/PEMfileToCString.html) to convert the certificates and keys from PEM format to C string format. You need to clone the repository from GitHub to use the utility."

      ...

       

      The correct path that worked for me was: https://aws.amazon.com/freertos/GitHub - aws/amazon-freertos: IoT operating system for microcontrollers.

      You have to clone the whole thing, or at least that is what I did, I figure it will come in handy...

       

      William

        • 1. Re: Heads up - AnyCloud Example: MQTT Client
          WiWi_4702256

          First, excellent project! Thanks!

           

          But, If your like me, and followed the OPERATION instructions:

          1. Modify the user configuration files in the configs directory as follows:
            1. Set the Wi-Fi credentials in configs/wifi_config.h: Modify the macros WIFI_SSID, WIFI_PASSWORD, and WIFI_SECURITY to match with that of the Wi-Fi network that you want to connect.
            2. Set up the MQTT client and configure the credentials in configs/mqtt_client_config.h as follows:
              1. Set up the MQTT device (also known as a Thing) in the AWS IoT Core as described in the Getting Started with AWS IoT tutorial. (Do this, very important...)

           

          Then... Most likely you did not connect to "MQTT broker..." Why? Probably because your Thing was not named 'ledstatus'.

           

          However, all I had to do was set MQTT_TOPIC in mqtt_client_config.h to 'MyThing' because I named my Thing 'MyThing' LOL! Thats a lot of thing to thing about...

           

          I suggest that the README.md be modified to:

          1. Modify the user configuration files in the configs directory as follows:
            1. Set the Wi-Fi credentials in configs/wifi_config.h: Modify the macros WIFI_SSID, WIFI_PASSWORD, and WIFI_SECURITY to match with that of the Wi-Fi network that you want to connect.
            2. Set up the MQTT client and configure the credentials in configs/mqtt_client_config.h as follows:
              1. Set up the MQTT device (also known as a Thing and set MQTT_TOPIC to reflect the name of your Thing) in the AWS IoT Core as described in the Getting Started with AWS IoT tutorial.

           

          configUSE_MALLOC_FAILED_HOOK abort...

          #if configUSE_MALLOC_FAILED_HOOK == 1

              __WEAK void vApplicationMallocFailedHook( void )

              {

                  taskDISABLE_INTERRUPTS();

                  CY_ASSERT(0U != 0U);

                  for( ;; )

                  {

                  }

              }

          #endif

           

          Should you receive the above abort  configUSE_MALLOC_FAILED_HOOK, then you need to tune your IoT SDK. IOT_THREAD_DEFAULT_STACK_SIZE located in:/AnyCloud_MQTT_Client/configs/iot_config.h

           

          You need to tune the IOT_THREAD_DEFAULT_STACK_SIZE. to (4192) // 8192 seems excessive for a thread

           

          /**

          * @brief Default thread stack size for the threads created by AWS IoT Device SDK.

          * The stack size may be tuned to suit the desired use case.

          */

          //#define IOT_THREAD_DEFAULT_STACK_SIZE               ( 8192 ) // 8k TODO WHW

          #define IOT_THREAD_DEFAULT_STACK_SIZE               ( 4096 ) // 4k

          • 2. Re: Heads up - AnyCloud Example: MQTT Client
            WiWi_4702256

            Misleading typo...

             

            You need to tune the IOT_THREAD_DEFAULT_STACK_SIZE. to (4096) // 8192 seems excessive for a thread