ESPEasy pulse counter

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Arturbr
New user
Posts: 5
Joined: 17 May 2023, 16:56

ESPEasy pulse counter

#1 Post by Arturbr » 17 May 2023, 17:19

Hello to all forum users.
I have a problem with the ESPEasy mega-20220427 water meter.
I have devices-pulse counter set as in picture. The problem is that when I select "Enabled" and click "Submit", everything works, the counter only counts, but after a few days "Enabled" turns itself off and the counter stops counting. I have the same effect on ESPEasy mega-20230306, and the same on other ESP8266-07 boards.
On the ESPEasy mega-20220427 version, I have an energy meter made and it works without a problem, I copied all the settings to the ESPEasy mega-20220427 water meter and it doesn't work.
Has anyone had this problem, any ideas?

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

Re: ESPEasy pulse counter

#2 Post by TD-er » 17 May 2023, 18:19

When ESPEasy crashes during boot and thus never is able to complete a boot cycle, a protection mechanism is activated.

After 10 of such crash-boots, ESPeasy starts disabling tasks, one at a time.
Then all tasks, then the same for controllers and disabling rules, etc.

All until it can complete a boot cycle.

What pin is being used for the pulse counter?
Do you immediately act on events sent by the pulse counter task?

N.B. I don't see any picture.

Arturbr
New user
Posts: 5
Joined: 17 May 2023, 16:56

Re: ESPEasy pulse counter

#3 Post by Arturbr » 18 May 2023, 05:48

I missed this photo, already posted. How to fix it?
Attachments
esp.png
esp.png (32.8 KiB) Viewed 1068 times

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

Re: ESPEasy pulse counter

#4 Post by TD-er » 18 May 2023, 10:27

Ah, GPIO-2 is a special pin.
It is a so called "boot strapping pin", meaning the pin needs to be in a specific state during boot or else the ESP will not boot or not boot correctly.

See: https://espeasy.readthedocs.io/en/lates ... on-esp8266

So this is a tricky pin to use when you use it for something you can't control during boot.

Since this pin already had a pull-up resistor, you may also want to test whether you need to add an extra pull-up resistor for your setup when moving it to another pin.

Arturbr
New user
Posts: 5
Joined: 17 May 2023, 16:56

Re: ESPEasy pulse counter

#5 Post by Arturbr » 21 May 2023, 06:44

But I have a meter connected to GIPO-4 as in the picture. I have made two ESPEasy plates with the same firmware for counting cold and hot water, so far the heat works fine only with the cold one there is a problem.

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

Re: ESPEasy pulse counter

#6 Post by TD-er » 21 May 2023, 11:54

Sorry, have been bitten by those absolutely horrible D-naming for the ESP8266....
I didn't look long enough at your screenshot, you're right GPIO-4, D2.... It's not like this happed before to me... :(

OK, so you're using GPIO-4, that's good :)

However, this pin is also by default assigned as pin for I2C.
Make sure it isn't set there on the Hardware tab.

Arturbr
New user
Posts: 5
Joined: 17 May 2023, 16:56

Re: ESPEasy pulse counter

#7 Post by Arturbr » 21 May 2023, 21:05

I checked, I2C is disabled.
I'm out of ideas!

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

Re: ESPEasy pulse counter

#8 Post by TD-er » 21 May 2023, 22:29

How is it wired to the ESP?
Is it possible this pin might receive a lot of noise?
The theory is that it might need to process a lot of interrupts while booting, which may lead to crashes.

A relatively simple work-around might be to set the task disabled and save this setting.
Then in the rules start a timer after boot and then call taskenable,N where N is the task index of your counter.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests