EspEasy not counting

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
maximinus
New user
Posts: 7
Joined: 26 Aug 2020, 14:54

EspEasy not counting

#1 Post by maximinus » 27 Aug 2020, 01:55

Despite a lengthy search, I cannot find a solution to my ESPEasy problem. S0 counter outputs are to be monitored
I flashed a WemosD1 with ESPEasy_mega-20200703 and set up a generic counter on each of the pins D3 D4 D6 D7 D8.
Debounce 1000ms, Type Delta / Total / Time, Mode Change.
Because there was no reliable count in a previous experiment, I have the relevant inputs with 10kOhm
Pull-up resistors placed on the 3.3V pin
In the Devices tab, some values ​​already appear for GPIO-2, -15, -13 even though nothing is connected, GPIO-0 and -12 show 0
In the ioBroker mqqt-objects I can see that the total of GPIO-2 and -15 are continuously increasing by 10 each (although still nothing is connected)
GPIO-0 and -12 remain at 0 and with GPIO-13 there is not even a 0 in the value field but rather "blank"
The automatic counting up ends when I set the mode to "low".
But if I put the inputs on ground as a test, nothing happens, it doesn't count.
It's probably not because of the Wemos, because I've already flashed the third one with the same result.
Does anyone have an idea why this might be?
Regards Gerhard

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

Re: EspEasy not counting

#2 Post by TD-er » 27 Aug 2020, 03:18

Not sure about all pins you're using here, but at least GPIO-15 does have a pull-down resistor.
See: https://espeasy.readthedocs.io/en/lates ... on-esp8266

So by adding a pull-up resistor to it, you may cause it to fail boot or at least undo the existing pull-down and thus make it prone to false readings.

Have you tried running only one pulse counter?

Also the pulse counter can only be at one of the first few task positions (3 or 4).
What task positions are the tasks that have faulty count values?

ToniA
Normal user
Posts: 69
Joined: 26 Aug 2016, 20:37

Re: EspEasy not counting

#3 Post by ToniA » 27 Aug 2020, 08:56

I have Wemos D1 mini with two pulse counters counting S0 pulses, GPIO-14 (D5) and GPIO-12 (D6). I also have external pullup resistors. Works fine, although the build I have is really old (ESP Easy Mega build 20102).

maximinus
New user
Posts: 7
Joined: 26 Aug 2020, 14:54

Re: EspEasy not counting (solved)

#4 Post by maximinus » 27 Aug 2020, 18:03

@TD-er
Thanks. Removed PullUp from GPIO-15 connected again, all devices showed 0 but only GPIO-0 was counting.
Deleted all remaining not working counters.
@TonyA
Created new counters on D5 and D6. Are working now. Created additional counter on D7 also counting.Counters are on Task 1, 2, 3 ,4
Still need one additional, will try to find one
Thanks for help.

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

Re: EspEasy not counting

#5 Post by TD-er » 28 Aug 2020, 00:26

There is still a limitation in the source where only interrupt driven call back calls can be registered on only the first 4 tasks.
So please don't waste too much time to find a work-around, unless you actually try to adapt the code for it.

maximinus
New user
Posts: 7
Joined: 26 Aug 2020, 14:54

Re: EspEasy not counting

#6 Post by maximinus » 28 Aug 2020, 00:46

I realized that no matter what I try 4 counters seem to be the max.
Regards Gerhard

maximinus
New user
Posts: 7
Joined: 26 Aug 2020, 14:54

Re: EspEasy not counting correctly

#7 Post by maximinus » 10 Sep 2020, 13:25

Hi,
I cannot get working my counters.
The Wemos is now connected to the S0 electricity meters in site. Their inputs are normally high 3,3V in case of pulse they become low. As I am still waiting for delivery of a scope I cannot determine the actual value of the low. I see unly a small blip on the voltmeter. In my understanding the trigger might be "falling" but then it is not counting. The only possibility to get the counter counting is when trigger is "change" but in this case count in iobroker objects is not 1 but 3 or 4 as well total is increased as such. Fiddling with debounce time is affecting count. With 500 msc it increases until 10 with 6000msec it reduces to 1-2 but never constantly 1. I can change the script to increase by 1 when total is changing but the calculation of actual power is incorrect. The cable from meter to Wemos is less then half meter. It is not shielded. It seems that I am the only one where these counters dont work.
Has anybody a idea what else I could try?
Regards Gerhard

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

Re: EspEasy not counting

#8 Post by TD-er » 10 Sep 2020, 22:32

Can you draw the schematics of how things are connected?
If you doubt the signal levels, it is best to have a look at the current flowing through the S0 port.
And the simplest way can be to add a resistor and LED parallel to the GPIO pin you're using for visual feedback.

Also check what task nr you're using for the counter.
The counter must be at task 1...4.

olegvstt
Normal user
Posts: 13
Joined: 10 Sep 2020, 11:38

Re: EspEasy not counting

#9 Post by olegvstt » 12 Sep 2020, 08:58

Please tell me how you can integrate the library https://github.com/maxzerker/PZEM-017-v1 into ESP Easy.

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

Re: EspEasy not counting

#10 Post by TD-er » 12 Sep 2020, 13:26

olegvstt wrote: 12 Sep 2020, 08:58 Please tell me how you can integrate the library https://github.com/maxzerker/PZEM-017-v1 into ESP Easy.
That's got nothing to do with this topic, or am I missing something?

olegvstt
Normal user
Posts: 13
Joined: 10 Sep 2020, 11:38

Re: EspEasy not counting

#11 Post by olegvstt » 12 Sep 2020, 16:20

I just asked how to integrate a ready-made library into ESP Easy, or tell me where you can read about it.

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

Re: EspEasy not counting

#12 Post by TD-er » 12 Sep 2020, 20:05

olegvstt wrote: 12 Sep 2020, 16:20 I just asked how to integrate a ready-made library into ESP Easy, or tell me where you can read about it.
Well that means I have to read into that library to see what it offers, to give you a clear answer as the existing source code apparently isn't clear on how to do it.
It looks like that library you linked is only "slightly modified" according to its readme, from the 004 version of that PZEM sensor.
So I think it should be quite easy to modify https://github.com/letscontrolit/ESPEas ... M-004T.ino this one to use that library.

Please do not try to hijack other topics for it, but rather open a new one, or add an issue for a feature request to Github.

maximinus
New user
Posts: 7
Joined: 26 Aug 2020, 14:54

Re: EspEasy not counting

#13 Post by maximinus » 13 Sep 2020, 12:37

@TD-er
Can you draw the schematics of how things are connected?
If you doubt the signal levels, it is best to have a look at the current flowing through the S0 port.
And the simplest way can be to add a resistor and LED parallel to the GPIO pin you're using for visual feedback.

Also check what task nr you're using for the counter.
The counter must be at task 1...4.
Sorry for delayed reply.
This is the devive: https://www.amazon.de/gp/product/B078M1 ... UTF8&psc=1
The S0 outputs are connected to ground and GPIO 14, 13, 12 and 0 which are pulled to 3,3V with 10kOhms
Current measurement is difficult because contacts are NO and pulsewith is rather small.
Connected LEDs are illuminated and show a very small interuption when output LED of S0 is blinking.
At manual short of the contact the LED is off.
Using only task 1..4.
Shall try again with a ESP32 or ESP8266

Post Reply

Who is online

Users browsing this forum: No registered users and 72 guests