2 pulse conuter simultaneously

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
calida82
New user
Posts: 3
Joined: 20 Feb 2022, 11:53

2 pulse conuter simultaneously

#1 Post by calida82 » 21 Feb 2022, 16:48

Hi, I loaded the espeasy mega firmware on a wemos d1 clone (azdelivery) to read 2 S0 pulse meters (production and energy consumption).
I created the first task in position 1 it works regularly connected to pin d3. when i set the second counter in the second position connected to pin d8 the second one works but the first one freezes and stops working.
Then I created a controller to send data to a raspberry which runs emoncms but the data is sent alternately(one controller for 2 task). one send sends the data of task 1 (even if blocked) the second send sends the data of task 2 and so on, but this does not seem to me the correct way to continue.
anyone have any suggestions? it is not possible to read 2 meters simultaneously?

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

Re: 2 pulse conuter simultaneously

#2 Post by Ath » 21 Feb 2022, 16:54

What version of ESPEasy did you install? (Name of the .bin file, please)
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8846
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: 2 pulse conuter simultaneously

#3 Post by TD-er » 21 Feb 2022, 19:14

Using the pulse counter plugin is a bit tricky on an ESP8266, as it is entirely done in software.
So it is easy to miss a pulse, especially when running with 2 of them.
ESP32 does have hardware handling of the pulse count. (at least, when using a recent build)

I also advice to have a look at the documentation on what pins to use: https://espeasy.readthedocs.io/en/lates ... on-esp8266
The 2 pins you chose are probably the worst ones for this as both need to be in a specific state or else the ESP may not boot.
So it is very well possible the ESP may at some moment no longer boot if either one of those inputs is in the "wrong" state.

calida82
New user
Posts: 3
Joined: 20 Feb 2022, 11:53

Re: 2 pulse conuter simultaneously

#4 Post by calida82 » 21 Feb 2022, 20:52

my version is ESP_Esay_Mega_20211224_normal_ESP8266_4M1M.bin


I chose those 2 pins because d3 has a pull up resistance and d8 pulldown resistance which I need to keep the state in its place when there is no impulse without the need for external resistors

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests