Page 5 of 5
Re: Using GPIO to measure energy
Posted: Monday 23 January 2017 19:51
by Lieuwke
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!!
Re: Using GPIO to measure energy
Posted: Tuesday 24 January 2017 20:01
by sincze
Hey you got some spare time to work on this project again.
Nice.
Lieuwke 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.
Yes wiringpi pin 1, so that seems to be working. Nice
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
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:
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.
When you placed all files in the correct folder you should be okay.
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!!
To find out where it goes wrong you could cinsider to build the executing string from scratch.
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:
Re: Using GPIO to measure energy
Posted: Friday 24 February 2017 18:56
by HNBC84
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
Re: RE: Re: Using GPIO to measure energy
Posted: Saturday 25 February 2017 1:11
by sincze
HNBC84 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
It counts pulses (on, /off). If that is what you are asking
Sent from my SM-G925F using Tapatalk
Re: RE: Re: Using GPIO to measure energy
Posted: Saturday 25 February 2017 11:56
by HNBC84
sincze wrote:HNBC84 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
It counts pulses (on, /off). If that is what you are asking
Sent from my SM-G925F using Tapatalk
easy answer
I think i will give it a shot
someone allready get it to work with a s0 kwh counter?
Re: Using GPIO to measure energy
Posted: Monday 27 February 2017 19:15
by HNBC84
I think i have the software correct.
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 ...
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?
Re: Using GPIO to measure energy
Posted: Tuesday 28 February 2017 22:09
by HNBC84
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).
Could someone explain? Or how to get it of?
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
Re: Using GPIO to measure energy
Posted: Saturday 30 September 2017 17:04
by Icarus
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
Re: Using GPIO to measure energy
Posted: Thursday 07 December 2017 9:42
by stinuz
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