Using GPIO to measure energy
Moderator: leecollings
-
- Posts: 15
- Joined: Saturday 06 December 2014 19:25
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Using GPIO to measure energy
Hi Sincze,
Followed you instruction to the letter but can't seem to get it to work.
Checks:
GPIO pin 12(physical pin on the Board) is working.
Checked it with GPIO Readall when the sensor is activated and not. Readout is ok.
Checked with GPIO Exports to show me the pin states also:
18: in 1 falling and 18: in 0 falling is returned. Depending on the state of the sensor.
I'm Guessing GPIO hardware is in working order.
I placed the mentioned files in the correct folder using WinSCP and i edited the ISRCOUNTER in /etc/init.d to match my setup to DEVIDX="39"
I also set the file permissions for the files to 0775
Somewhere i read i had to add the file to startupscript using sudo update-rc.d isrcounter defaults
Did that, but i don't know if things are working.
my difficulty is: How do i check the separate steps.
I know how to check the pin using GPIO.
But how to check if the ISRCOUNTER1 binary is working en how to check if the ISRCOUNTER script in init.d is right?
Can i force things manually to narrow the search so we can find the missing link?
Again thank you for all your great efforts!!
Followed you instruction to the letter but can't seem to get it to work.
Checks:
GPIO pin 12(physical pin on the Board) is working.
Checked it with GPIO Readall when the sensor is activated and not. Readout is ok.
Checked with GPIO Exports to show me the pin states also:
18: in 1 falling and 18: in 0 falling is returned. Depending on the state of the sensor.
I'm Guessing GPIO hardware is in working order.
I placed the mentioned files in the correct folder using WinSCP and i edited the ISRCOUNTER in /etc/init.d to match my setup to DEVIDX="39"
I also set the file permissions for the files to 0775
Somewhere i read i had to add the file to startupscript using sudo update-rc.d isrcounter defaults
Did that, but i don't know if things are working.
my difficulty is: How do i check the separate steps.
I know how to check the pin using GPIO.
But how to check if the ISRCOUNTER1 binary is working en how to check if the ISRCOUNTER script in init.d is right?
Can i force things manually to narrow the search so we can find the missing link?
Again thank you for all your great efforts!!
Sony Raspberry Pi B V2.0
Homemade P1 cable on Landis/Gyr E350
C&K/Honeywell Security system connected to Domoticz
AEON Labs USB Z-Wave
TCRT5000 sensor watermeter -> revived..... and in progress....
Homemade P1 cable on Landis/Gyr E350
C&K/Honeywell Security system connected to Domoticz
AEON Labs USB Z-Wave
TCRT5000 sensor watermeter -> revived..... and in progress....
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Using GPIO to measure energy
Hey you got some spare time to work on this project again.
Nice.
Avoid this jusr run the executable. You can actually see what happens.
For example what happens if you issue a:
Does it actually run?? If you did everything okay it should say:
Nice.
Yes wiringpi pin 1, so that seems to be working. NiceLieuwke wrote:Hi Sincze,
Followed you instruction to the letter but can't seem to get it to work.
Checks:
GPIO pin 12(physical pin on the Board) is working.
Checked it with GPIO Readall when the sensor is activated and not. Readout is ok.
Checked with GPIO Exports to show me the pin states also:
18: in 1 falling and 18: in 0 falling is returned. Depending on the state of the sensor.
I'm Guessing GPIO hardware is in working order.
That would mean that if you would execute ./isrcounter it will give you some kind of... I am missing some values sir message ???Lieuwke wrote: I placed the mentioned files in the correct folder using WinSCP and i edited the ISRCOUNTER in /etc/init.d to match my setup to DEVIDX="39"
I also set the file permissions for the files to 0775
When you placed all files in the correct folder you should be okay.Lieuwke wrote: Somewhere i read i had to add the file to startupscript using sudo update-rc.d isrcounter defaults
Did that, but i don't know if things are working.
To find out where it goes wrong you could cinsider to build the executing string from scratch.Lieuwke wrote: my difficulty is: How do i check the separate steps.
I know how to check the pin using GPIO.
But how to check if the ISRCOUNTER1 binary is working en how to check if the ISRCOUNTER script in init.d is right?
Can i force things manually to narrow the search so we can find the missing link?
Again thank you for all your great efforts!!
Avoid this jusr run the executable. You can actually see what happens.
For example what happens if you issue a:
Code: Select all
/etc/init.d/isrcounter status
Code: Select all
[ ok ] isrcounter1 is running.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 63
- Joined: Tuesday 01 December 2015 10:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Using GPIO to measure energy
Before i start to do something that dont work.
Is this for a s0 counter or only a photosensor?
I have a s0 counter setup (since today) and before i buy stuff i dont need, or do some wireing. I want to connect it directly to the GPIO pins.
And i think this is the place tobe
Is this for a s0 counter or only a photosensor?
I have a s0 counter setup (since today) and before i buy stuff i dont need, or do some wireing. I want to connect it directly to the GPIO pins.
And i think this is the place tobe
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: RE: Re: Using GPIO to measure energy
It counts pulses (on, /off). If that is what you are askingHNBC84 wrote:Before i start to do something that dont work.
Is this for a s0 counter or only a photosensor?
I have a s0 counter setup (since today) and before i buy stuff i dont need, or do some wireing. I want to connect it directly to the GPIO pins.
And i think this is the place tobe
Sent from my SM-G925F using Tapatalk
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 63
- Joined: Tuesday 01 December 2015 10:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: RE: Re: Using GPIO to measure energy
easy answersincze wrote:It counts pulses (on, /off). If that is what you are askingHNBC84 wrote:Before i start to do something that dont work.
Is this for a s0 counter or only a photosensor?
I have a s0 counter setup (since today) and before i buy stuff i dont need, or do some wireing. I want to connect it directly to the GPIO pins.
And i think this is the place tobe
Sent from my SM-G925F using Tapatalk
I think i will give it a shot
someone allready get it to work with a s0 kwh counter?
-
- Posts: 63
- Joined: Tuesday 01 December 2015 10:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Using GPIO to measure energy
I think i have the software correct.
The theaspoon connection counts whitout the wierd numbers
Tomorrow i wil get a cable connection from the s0 counter en wil have a shot its about 10m away
Why does it need a gpio out and a in?
Why not just 1 in and a ground?
Code: Select all
pi@domoticz ~ $ sudo isrcounter1 status
Waiting ... Waiting ... ^Z
[1]+ Stopped sudo isrcounter1 status
pi@domoticz ~ $ /etc/init.d/isrcounter status
[ ok ] isrcounter1 is running.
pi@domoticz ~ $ sudo isrcounter1 status
Waiting ... Waiting ...
Tomorrow i wil get a cable connection from the s0 counter en wil have a shot its about 10m away
Why does it need a gpio out and a in?
Why not just 1 in and a ground?
-
- Posts: 63
- Joined: Tuesday 01 December 2015 10:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Using GPIO to measure energy
Code: Select all
2017-02-28 22:03:12.651 GPIO: 1 interrupts in queue.
2017-02-28 22:03:12.651 GPIO: Too many interrupts for GPIO 18. Ignoring..
2017-02-28 22:03:12.651 GPIO: Acknowledging interrupt for GPIO 18.
2017-02-28 22:03:12.651 GPIO: Processing interrupt for GPIO 18...
2017-02-28 22:03:12.701 GPIO: Done processing interrupt for GPIO 18 (LOW).
I use it with a s0 kWh counter and like the watercooker it goes to fast.
Still not shore if it counts all the pulses
Code: Select all
Waiting ... Done. counter: 3410: 1
Waiting ... Done. counter: 3418: 2
Waiting ... Done. counter: 3419: 8
Waiting ... Done. counter: 3420: 1
Waiting ... Done. counter: 3421: 1
Waiting ... Done. counter: 3422: 1
Waiting ... Done. counter: 3424: 1
Waiting ... Done. counter: 3425: 2
Waiti
-
- Posts: 3
- Joined: Friday 06 January 2017 21:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using GPIO to measure energy
Big thanks to those that did all the work on this. I have it reading my Gas meter. Wire connecting TCRT5000 to GPIO is hanging out of an upstairs window. Not ideal but I can not get wire to rasberry pi any other way.
I have a Fibaro universal binary sensor. Would it be possible to connect TCRT5000 to one input & get domotics to count pulses from it ?? If so how do I go about doing it ?
Thanks
I have a Fibaro universal binary sensor. Would it be possible to connect TCRT5000 to one input & get domotics to count pulses from it ?? If so how do I go about doing it ?
Thanks
-
- Posts: 1
- Joined: Thursday 07 December 2017 9:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using GPIO to measure energy
Hello,
I'm planning to compile 2 isrcounter instances because I want to use 1 for gas and 1 for water. In your tutorial you are mentioning something of false / positive detection. Will I also have this covered when I compile the isrcounter myself or did you add additional code to the compiled file in your tutorial.
Thanks in advance,
Stijn
I'm planning to compile 2 isrcounter instances because I want to use 1 for gas and 1 for water. In your tutorial you are mentioning something of false / positive detection. Will I also have this covered when I compile the isrcounter myself or did you add additional code to the compiled file in your tutorial.
Thanks in advance,
Stijn
Who is online
Users browsing this forum: No registered users and 1 guest