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!
-