Problem: Two task, listen to same GPIO

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
fgo_swe
New user
Posts: 2
Joined: 24 Sep 2018, 20:59

Problem: Two task, listen to same GPIO

#1 Post by fgo_swe » 24 Sep 2018, 21:17

What a nice firmware for NodeMCU, great work guys!

Yesterday I tried to make a pulse counter for my electric meter.
I use a LDR to count the pulses.
It works great but I can't see the real time use.

I made two tasks that listen to GPIO 0.
If I have one of the two tasks active it work, but when activating both of them at the same time only the last saved work.
The other one won't count any pulses.

Is it any way to make it work?

ESPeasy version: mega-20180914
Controller: Domoticz
What I hope to do:
One IDX with total use in kWh and another IDX with real time use in W.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Problem: Two task, listen to same GPIO

#2 Post by grovkillen » 25 Sep 2018, 05:50

You should use a dummy device to populate the Wh. Use rules for that. Study the wiki and come back here if you need more help.

For inspiration: https://testoftimes.com/2017/11/25/moni ... g-esp8266/
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

fgo_swe
New user
Posts: 2
Joined: 24 Sep 2018, 20:59

Re: Problem: Two task, listen to same GPIO

#3 Post by fgo_swe » 25 Sep 2018, 22:25

Thanks for the answer!

I had done it right all the way to domoticz.
But I've chosen the wrong type of "energy read' in the device of power meter.
When I selected Computed it works instantly. :D

Post Reply

Who is online

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