IncomingMessage function not firing



  • I have a Serial Gateway running on a Nano v3 that's using the default MySensors Serial Gateway code along with the 2.1 mySensors library. I’m trying to track/monitor incoming messages from my nodes. The only code that has been added to the serial gateway sketch is

    void incomingMessage(const MyMessage &message)
    {
    Serial.println("Inside Incoming Message");
    }

    But, I’m not seeing my “Inside Incoming Message" message in the serial monitor when my nodes communicate with the gateway.

    The sketch compiles and uploads to the gateway without error messages
    Is there something I need to include in my sketch or config files to make the incomingMessage function work?


  • Admin

    What happens if you use

    receive(const MyMessage &message)

    instead?



  • Placing the receive function in my Gateway sketch worked. Thanks. For some reason I thought that function would only work for sensor nodes to watch for messages sent from the Gateway.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.