Serial event processing only ONE time on data reception?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

Serial event processing only ONE time on data reception?

#1 Post by Regolsis » 10 Oct 2022, 16:33

Hi,

I want to use an ESP8266-12F to send the data from a smart power meter (by IR-sensor on serial-RX) to openHAB. The power meter sends its data by IR once per second. I want to use the LED on D4 to flash once on data reception, but only once every second.

When enabling Event processing to Generic in the serial task I get the !Serial* events. On every event call I set a Let-variable to 1 and reset it by a timer once every second and let D4 flash.

But !Serial* is called on every received bit and I think the cpu could be too slow with that. Is it possible to stop event processing after the first call and reactivate it again, when the next data package is received by IR one second later?

Thanks.

User avatar
Ath
Normal user
Posts: 3515
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Serial event processing only ONE time on data reception?

#2 Post by Ath » 10 Oct 2022, 16:38

Q: Does the IR led provide usable data on the RX pin?

Edit: https://github.com/letscontrolit/ESPEasy/pull/4283 (NB: I created that PR ;))
/Ton (PayPal.me)

User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

Re: Serial event processing only ONE time on data reception?

#3 Post by Regolsis » 10 Oct 2022, 17:13

Ath wrote: 10 Oct 2022, 16:38 Q: Does the IR led provide usable data on the RX pin?
In my testing with a flashlight it does. I used this manual:
https://www.mwinklerblog.de/smarthome/a ... r-digital/

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 135 guests