ESP8266: MCU seems to be busy with the WiFi and stops receiving messages from NRF24
-
Hello everyone,
I am using ESP8266 to forward data to the cloud, as described here:
http://forum.mysensors.org/topic/1973/esp8266-as-wifi-gateway-controller-node/My problem is that if I trigger the HTTP post from function incomingMessage() it seems the MCU is busy with the WiFi and it stops receiving messages from nRF. The first, second msg are handled then the others get a fail status. Any advice on how to handle this ? is there a more proper way than what i am doing?
or is it normal, hence I should manually buffer the messages and do the http post later ?Thanks!
here is my code:
void incomingMessage(const MyMessage & message) { Serial.print("Sensor:"); serial(PSTR("%d;%d;%d;%d;%d;%s\n"), message.sender, message.sensor, mGetCommand(message), mGetAck(message), message.type, message.getString(convBuf)); if (message.type == V_TEMP) { sendStrXY(message.getString(convBuf), 3, 10); // thingspeak("3", message.getString(convBuf)); } else if (message.type == V_HUM) { sendStrXY(message.getString(convBuf), 4, 10); // thingspeak("4" , message.getString(convBuf)); } else if (message.type == V_PRESSURE) { sendStrXY(message.getString(convBuf), 5, 10); // thingspeak("5", message.getString(convBuf)); } else if (message.type == V_WIND) { sendStrXY(message.getString(convBuf), 6, 5); // thingspeak("6", message.getString(convBuf)); } else if (message.type == V_RAINRATE) { sendStrXY(message.getString(convBuf), 6, 12); // thingspeak("7", message.getString(convBuf)); } else if (message.type == V_VAR1) { // sendStrXY(message.getString(convBuf), 7, 0); // thingspeak("8", message.getString(convBuf)); } else if (message.type == V_VAR2) { // sendStrXY(message.getString(convBuf), 7, 5); // thingspeak("8", message.getString(convBuf)); } else if (message.type == V_VAR3) { // sendStrXY(message.getString(convBuf), 7, 10); // thingspeak("8", message.getString(convBuf)); }thingspeak function does a WiFiClient print to url...
-
Hello everyone,
I am using ESP8266 to forward data to the cloud, as described here:
http://forum.mysensors.org/topic/1973/esp8266-as-wifi-gateway-controller-node/My problem is that if I trigger the HTTP post from function incomingMessage() it seems the MCU is busy with the WiFi and it stops receiving messages from nRF. The first, second msg are handled then the others get a fail status. Any advice on how to handle this ? is there a more proper way than what i am doing?
or is it normal, hence I should manually buffer the messages and do the http post later ?Thanks!
here is my code:
void incomingMessage(const MyMessage & message) { Serial.print("Sensor:"); serial(PSTR("%d;%d;%d;%d;%d;%s\n"), message.sender, message.sensor, mGetCommand(message), mGetAck(message), message.type, message.getString(convBuf)); if (message.type == V_TEMP) { sendStrXY(message.getString(convBuf), 3, 10); // thingspeak("3", message.getString(convBuf)); } else if (message.type == V_HUM) { sendStrXY(message.getString(convBuf), 4, 10); // thingspeak("4" , message.getString(convBuf)); } else if (message.type == V_PRESSURE) { sendStrXY(message.getString(convBuf), 5, 10); // thingspeak("5", message.getString(convBuf)); } else if (message.type == V_WIND) { sendStrXY(message.getString(convBuf), 6, 5); // thingspeak("6", message.getString(convBuf)); } else if (message.type == V_RAINRATE) { sendStrXY(message.getString(convBuf), 6, 12); // thingspeak("7", message.getString(convBuf)); } else if (message.type == V_VAR1) { // sendStrXY(message.getString(convBuf), 7, 0); // thingspeak("8", message.getString(convBuf)); } else if (message.type == V_VAR2) { // sendStrXY(message.getString(convBuf), 7, 5); // thingspeak("8", message.getString(convBuf)); } else if (message.type == V_VAR3) { // sendStrXY(message.getString(convBuf), 7, 10); // thingspeak("8", message.getString(convBuf)); }thingspeak function does a WiFiClient print to url...
-
so can the GW nRF receive and aknowledge if the GW MCU is busy doing something else ?
eitherway I will update to latest dev branch, test again with modules on different locations and come back.
-
@nikil511 said:
so can the GW nRF receive and aknowledge if the GW MCU is busy doing something else ?
Yes! You've built yourself a multi-core system!
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login