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


  • Mod

    @nikil511 I think fail is reported when hardware ack is not received. @hek is this correct?
    If this is the case, ESP is not involved at all...
    Maybe interference between ESP & nRF?


  • Admin

    @Yveaux said:

    I think fail is reported when hardware ack is not received.

    Yes, correct.



  • 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.


  • Mod

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



  • @Yveaux said:

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

    Correct me if i'm wrong but isn't the ack handled in the nrf24l01+ hardware and therefore a busy mcu shouldn't be a problem?


  • Mod

    @Oitzu isn't that the same as I'm saying?



  • @Yveaux said:

    @Oitzu isn't that the same as I'm saying?

    Yes... i misread your post in a way that you suggest he needs to built a multicore system to achive that... i'm sorry. ๐Ÿ˜•


Log in to reply
 

Suggested Topics

  • 33
  • 11
  • 17
  • 3
  • 8
  • 9

58
Online

11.4k
Users

11.1k
Topics

112.6k
Posts