I am using ESP-NOW and two ESP32's to control my grand-sons model train set. And I have had no trouble controlling the stop/start, direction, or speed of the train using the ESP-NOW examples. What I have been unable to do is stop the engine when there is a loss of Tx signal. Right now the train keeps right on going even when the Tx signal is lost.
Thank you very much,
Tron76
ESP-NOW Rx detecting loss of Tx signal.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP-NOW Rx detecting loss of Tx signal.
Well, ESP-Now is sent as packets, meaning on the receiving end there's no difference between 'the transmitter sent something that wasn't received' and 'the transmitter didn't send anything'. What you would want to do is send data periodically (e.g. every 100ms or so), and detect loss of Tx by noticing you haven't received any packets for some multiple of that 100ms.
Re: ESP-NOW Rx detecting loss of Tx signal.
ESP-Sprite.
Yes A loss of packets received is exactly what I need.
But so far I have not been able to figure out how to do it.
Yes A loss of packets received is exactly what I need.
But so far I have not been able to figure out how to do it.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP-NOW Rx detecting loss of Tx signal.
As I said: on the transmitter side, send packets every 100mS or so. On the receiver side, implement a timer that times out after 500mS or so. Reset that timer every time a packet arrives. If the timer times out, you missed 5 packets in a row and probably lost signal.
Who is online
Users browsing this forum: No registered users and 58 guests