Can't get mqttany to read the gpio #157
Replies: 2 comments 7 replies
-
It should be reporting the number of pulses per minute, as you are trying to do. Are you sure that the pin 24 you're connected to is actually the WiringPi pin 24 and not GPIO24 (the default pin mode This configuration will actually report the kWh usage in the last minute: gpio:
pulsecounter:
pin: 24
counter:
interval: 60
interrupt: 'rising'
function: 'count'
divider: 0.06 # 1000 pulses per kWh / 60 minutes = 16.666 pulses per minute -> 1/16.666 = 0.06 In the configuration you posted the |
Beta Was this translation helpful? Give feedback.
-
WiringPi pin 24 should be the correct as using "gpio read 24" I can seen the state change using bash script and according to "man gpio" WiringPi is the default numbering scheme it uses. Also when setting polling interval to 1 I get following results
and MQTT broker shows accordingly
So at least something is happening! To me it seems like there is something wrong with interrupts, as clearly MQTTany can see the state changes but somehow the interrupts are not working. MQTTany version is 0.14.3 |
Beta Was this translation helpful? Give feedback.
-
I have a LDR based impulse counter connected to Raspberry Pi 4 GPIO pin 24, which I intent to find out real-time power consumption of my house. The utility meter has a led which gives 1000 impulses per used kWh, so based on counting those (per minute, 10 minute or so) would give quite good estimate on real-time power consumption.
I have verified that the LDR setup works as I can seed the impulses using simple infinite bash loop, output being:
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
...
However, I haven't been able to figure out how should I configure the MQTTany to get these impulses to it. No problem with MQTT connection, that works fine, but I just can't get the impulses read.
Here's my config:
What I am missing here?
Beta Was this translation helpful? Give feedback.
All reactions