Currently I implemented some nodes sending data to a Serial-Gatway connected to a RasPi.
I'm running Node-Red on this RasPi and and the data area stoet into InfluxDB. Everything is working fine.
So now I'm trying to send some data from Node-Red to an example node.
First I verified that the node is working fine, when sending data to the Gateway.
For sending the data I'm using following flow:
It sends the number 275 to my Node_ID 29. The type is V_VAR1.
The Node-Red Debug shows, what is sent:
The loop in the node is a state machine, where I added a wait() just to slow it down while testing.
The cases are empty functions so nothing happens there.
void loop()
{
Serial.println("Runinng Main Loop");
wait(3000);
// Main-Lopp for state-machine
switch (Current_State)
{
case CHECK_LEVEL: Check_Water_Level(); break;
case FILL_WATER: Check_Water_Level(); break; //same function for both cases.
case PUMP_ON: Pumping(); break;
case SUSPEND: Suspend(); break;
case REMOTE_CONTROL: Remote_Control(); break;
case SLEEP_MODE: Start_Sleep_Mode(); break;
}
}
The receive function includes only some print commands to show me when the data was received:
void receive(const MyMessage &message)
{
Serial.println( "Message received: ");
Serial.println( message.type);
Serial.println( message.getUInt());
}
Unfortunately nothing happens, when I'm injecting the data in Node-Red.
I scanned the forum but didn't find the right postings helping me to understand, what my error is.
Thanks in advance for any advice.