Tool/software: Starterware
Hi! So I don't have a ton of experience working with Wi-Fi, but I wanted to use starter code from the CC3100BOOST_MQTT_TwitterLED_MSP432P401R example project.
The issue I am having is: I want to do all the Wi-Fi initialization (configureSimpleLinkToDefaultState, sl_Start, establishConnectionWithAP, etc.) then publish something to a topic. Then, I have some code for updating an LCD screen + waiting for a keypad press. Then, depending on what key was pressed, I want to trigger another publish.
The 1st publish is working, but the 2nd isn't. Right now, for the second publish, I wrote a function called: WiFiFetchStatus(). This is what it does:
wifiFlag = 1; char stat[32] = "SELECT * FROM racks WHERE id = X"; stat[31] = 0x30+r; int rc = 0; MQTTMessage msg; msg.dup = 0; msg.id = 0; msg.payload = stat; msg.payloadlen = 32; msg.qos = QOS0; msg.retained = 0; rc = MQTTPublish(&hMQTTClient, PUBLISH_TOPIC, &msg); if (rc != 0) { LOOP_FOREVER(); }
Is the problem that I am only calling MQTT publish? Do I possibly need to include all the initialization all over again? Because right now, the code will get to MQTTPublish, then go into the infinite loop of SlNonOsMainLoopTask.
Thanks!