- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am working on PSoC6 in MTB. My application uses AnyCloud_MqTT_Client and AnyCloud_OTA_HTTPS as reference. I am using MQTT to send data to AWS. Once I receive OTA command from AWS, ota begins. Two tasks are created: mqtt_client_task and ota_task. The design is in such a way that , once ota_task begins it suspends the mqtt_client_task. And after ota_task , I need to resume mqtt_task and publish the ota status.
My question here is, is it mandatory to do the MQTT disconnect by calling cleanup(), for OTA to happen via HTTP?
Thanks,
Binsy M S
Solved! Go to Solution.
- Labels:
-
PSoC 6 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Binsy,
WCM init should be initializing WiFi again. Can you please run the application in debug mode and check if the wcm_init function in the ota_task is getting executed as expected? Also, you could try attaching to running target after a hard fault occurs to see the call stack and check where the code is getting stuck. Can you please share the UART logs here?
If possible, please share the entire project so that we can try and recreate the issue at our end.
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Binsy,
You should be able to run HTTP without disconnecting the MQTT connection. However, if you disconnect MQTT in your code you should be calling the cleanup function. This cleanup function deallocates the network buffer which is important.
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Rakshith,
Thanks for the response.
I tried calling cleanup() function. But when this function is called, and when control reaches OTA task , it is not able to connect to Wi-Fi and it hangs. So I commented out the cy_wcm_deinit() function call in cleanup() function and tried. With this OTA is able to work
Can you please tell me why the Wi-Fi in OTA is not able to connect to accesspoint though cy_wcm_init() is called in the function connect_to_wifi_ap() in ota_task?
Also I more thing noticed is, when i call cleanup() ( commented out the cy_wcm_deinit() ) from mqtt_task the code hangs. Please give some inputs on this
Thanks,
Binsy M S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Binsy,
WCM init should be initializing WiFi again. Can you please run the application in debug mode and check if the wcm_init function in the ota_task is getting executed as expected? Also, you could try attaching to running target after a hard fault occurs to see the call stack and check where the code is getting stuck. Can you please share the UART logs here?
If possible, please share the entire project so that we can try and recreate the issue at our end.
Rakshith M B