void receive not work with RelayActuator.ino ?
-
Hi all,
I don't understand a problem,
My receive function is not working in the sktech relayActuator.ino
If I simply add the following code :.... void receive(const MyMessage &message) { Serial.print("--- Incoming Message ---"); // We only expect one type of message from controller. But we better check anyway. if (message.getType()==V_STATUS) { ....I never have anything.
But in the node logs I do receive the information:
Relay OFF :345110 TSF:MSG:READ,0-180-162,s=180,c=3,t=6,pt=0,l=1,sg=0:0Relay ON:
355655 TSF:MSG:READ,0-180-162,s=180,c=3,t=6,pt=0,l=1,sg=0:1For information I use a gateway+W5100 in MQTT.
An idea why the receive function is not working here ?
Thank you all
-
Hi all,
I don't understand a problem,
My receive function is not working in the sktech relayActuator.ino
If I simply add the following code :.... void receive(const MyMessage &message) { Serial.print("--- Incoming Message ---"); // We only expect one type of message from controller. But we better check anyway. if (message.getType()==V_STATUS) { ....I never have anything.
But in the node logs I do receive the information:
Relay OFF :345110 TSF:MSG:READ,0-180-162,s=180,c=3,t=6,pt=0,l=1,sg=0:0Relay ON:
355655 TSF:MSG:READ,0-180-162,s=180,c=3,t=6,pt=0,l=1,sg=0:1For information I use a gateway+W5100 in MQTT.
An idea why the receive function is not working here ?
Thank you all
-
@yourry Don't use serial print inside the receive function.
instead set a variable in receive and test for that in the main loop and then send serial from the main loop.
This is probably all the problem is........ probably....... ;)
-
@skywatch said in void receive not work with RelayActuator.ino ?:
Don't use serial print inside the receive function
Why not? Receive doesn't run in interrupt context, so it should be safe to serial print from it...
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