Closed Raunak-Singh-Inventor closed 2 years ago
I looked in esp-aws-iot/examples/subscribe_publish/main/subscribe_publish_sample.c
and found out that I have to create the event group before running the xEventGroupWaitBits
. Here is my updated code:
/* Wait for WiFI to show as connected */
EventGroupHandle_t wifi_event_group = xEventGroupCreate();
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, portMAX_DELAY);
This code fixes the error, but now the EduKit isn't able to connect to wifi and instead is stuck in the portMAX_DELAY
.
Any idea on why this is happening?
Updated main.c: https://github.com/Raunak-Singh-Inventor/Stockly/blob/master/edukit_deployment/main/main.c
Just figured it out. Had to call initialise_wifi()
from wifi.c before connecting to wifi. Updated code snippet.
/* Wait for WiFI to show as connected */
initialise_wifi();
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 300);
I am trying to subscribe to a MQTT topic using the code from the Blinky-Hello-World example. When I run this line:
I get the error:
(xEventGroupWaitBits)- assert failed!
.Please help
main.c: https://github.com/Raunak-Singh-Inventor/Stockly/blob/master/edukit_deployment/main/main.c
logs: