[vz-users] vzlogger mit support fuer s0 and raspberry pi GPIOs

Michael Baer mibaer at web.de
Tue Jan 20 19:18:32 CET 2015


Am Dienstag, 20. Januar 2015 schrieb Thorben Thuermer:
> danke fuer's testen schonmal, solangsam wird's interessanter...

:-)

> > > und hast per udev die permissions deiner devices geregelt?

jetzt ja.


> du kannst nebenbei zum testen einen zweiten vzlogger mir eigener
> config die nur das s0-meter enthaelt starten,
> macht das debuggen einfacher und stoert deinen produktivbetrieb
> weniger.

Danke, das wusste ich noch nicht.


> > vzlogger.conf (Auszug)
> > 
> >  }, {
> >  
> >          "enabled" : true,
> >          "protocol" : "raspis0",
> >          "resolution" : 1,

Da liegt der Fehler:     > >          "gpiopin" : 5,


> anscheinend wird immer nur der erste impuls erfasst,
> und weitere dann nichtmehr.
> ist merkwuerdig, weil's bei mir funktioniert...

Anscheinend wird beim Start ein Impuls generiert, denn....

> habe mal eine debug-ausgabe eingebaut,
> um das zu bestaetigen.
> magst du updaten ("git pull origin raspis0 ; make" denke ich)
> und damit testen?
> 
> https://github.com/r00t-/vzlogger/commit/1719855b04f14939bb7e2a3fab
> e32cafee535347

Hab ich jetzt mal ignoriert, denn.....


> vlt. auch nochmal die konfiguration des pins pruefen (waehrend
> vzlogger laeuft): (bei dir mit deiner nummer natuerlich)


Da war der Fehler:
pi /sys/class/gpio $ for f in /sys/class/gpio/gpio5/* ;do echo $f 
$(cat $f) ;done

===============
cat: /sys/class/gpio/gpio5/*: Datei oder Verzeichnis nicht gefunden
/sys/class/gpio/gpio5/*
===============

Ich hatte den GPIO nach der Nummer aus der s0vz.cfg benannt - in 
meinem Fall "5", (Udo-Erweiterung Rev.1).
Man sollte aber die GPIO-Nr. vom Raspi nehmen wenns denn funktionieren 
soll  - laut Stromlaufplan in dem Fall die "24" und:

Es funktioniert wie gewünscht!

vzlogger.log:
=================
[Jan 20 17:54:02][mtr2] Meter connection established
[Jan 20 17:54:02][mtr2] Meter thread started
[Jan 20 17:54:02][mtr2] Meter is opened. Starting channels.
[Jan 20 17:54:02][mtr2] Number of readers: 2
[Jan 20 17:54:02][mtr2] Config.daemon: 1
[Jan 20 17:54:02][mtr2] Config.local: 0
[Jan 20 17:54:02][mtr2] Got 1 new readings from meter:
[Jan 20 17:54:02][mtr2] Reading: id=Impulse/StringItentifier: 
value=1.00 ts=1421772842.237
[Jan 20 17:54:52][mtr2] Got 2 new readings from meter:
[Jan 20 17:54:52][mtr2] Reading: id=Impulse/StringItentifier: 
value=1.00 ts=1421772892.836
[Jan 20 17:54:52][mtr2] Reading: id=Power/StringItentifier: 
value=71148.72 ts=1421772892.836
[Jan 20 17:55:02][mtr2] Got 2 new readings from meter:
[Jan 20 17:55:02][mtr2] Reading: id=Impulse/StringItentifier: 
value=1.00 ts=1421772902.424
[Jan 20 17:55:02][mtr2] Reading: id=Power/StringItentifier: 
value=375461.55 ts=1421772902.424
[Jan 20 17:55:11][mtr2] Got 2 new readings from meter:
[Jan 20 17:55:11][mtr2] Reading: id=Impulse/StringItentifier: 
value=1.00 ts=1421772911.988
[Jan 20 17:55:11][mtr2] Reading: id=Power/StringItentifier: 
value=376410.17 ts=1421772911.988
[Jan 20 17:55:21][mtr2] Got 2 new readings from meter:
[Jan 20 17:55:21][mtr2] Reading: id=Impulse/StringItentifier: 
value=1.00 ts=1421772921.538
[Jan 20 17:55:21][mtr2] Reading: id=Power/StringItentifier: 
value=376962.04 ts=1421772921.538
====================

und der channel:
====================
[Jan 20 17:54:02][chn3] Logging thread started
[Jan 20 17:54:02][chn3] Start logging thread for volkszaehler-api. 
Running as daemon: yes
[Jan 20 17:54:02][chn3] Using default api:
[Jan 20 17:54:02][chn3] Adding reading to queue (value=1.00 
ts=1421772842.237)
[Jan 20 17:54:02][chn3] ==> number of tuples: 1
[Jan 20 17:54:02][chn3] compare: 0 1421772842237 1421772842237.389160
[Jan 20 17:54:02][chn3] JSON request body: [ [ 1421772842237.389160, 
1.000000 ] ]
[Jan 20 17:54:02][chn3] Buffer dump (size=0 keep=32): {}
[Jan 20 17:54:02][chn3] CURL: About to connect() to localhost port 80 
(#0)
[Jan 20 17:54:02][chn3] CURL:   Trying 127.0.0.1...
[Jan 20 17:54:02][chn3] CURL: connected
[Jan 20 17:54:02][chn3] CURL: Connected to localhost (127.0.0.1) port 
80 (#0)
[Jan 20 17:54:02][chn3] CURL: Sent 38 bytes.. 
[Jan 20 17:54:02][chn3] CURL: Sent '[ [ 1421772842237.389160, 1.000000 
] ]' bytes
[Jan 20 17:54:02][chn3] CURL: upload completely sent off: 38 out of 38 
bytes
[Jan 20 17:54:02][chn3] CURL: additional stuff not fine 
transfer.c:1037: 0 0
[Jan 20 17:54:02][chn3] CURL: HTTP 1.1 or later with persistent 
connection, pipelining supported
[Jan 20 17:54:02][chn3] CURL: Received 26 bytes
[Jan 20 17:54:02][chn3] CURL: Received '{"version":"0.3","rows":1}' 
bytes
[Jan 20 17:54:02][chn3] CURL: Connection #0 to host localhost left 
intact
[Jan 20 17:54:02][chn3] CURL Request succeeded with code: 200
[Jan 20 17:54:52][chn3] Adding reading to queue (value=1.00 
ts=1421772892.836)
[Jan 20 17:54:52][chn3] ==> number of tuples: 1
[Jan 20 17:54:52][chn3] compare: 1421772842237 1421772892836 
1421772892835.632080
[Jan 20 17:54:52][chn3] JSON request body: [ [ 1421772892835.632080, 
1.000000 ] ]
[Jan 20 17:54:52][chn3] CURL: Connection #0 seems to be dead!
[Jan 20 17:54:52][chn3] CURL: Closing connection #0
[Jan 20 17:54:52][chn3] CURL: About to connect() to localhost port 80 
(#0)
[Jan 20 17:54:52][chn3] CURL:   Trying 127.0.0.1...
[Jan 20 17:54:52][chn3] CURL: connected
[Jan 20 17:54:52][chn3] CURL: Connected to localhost (127.0.0.1) port 
80 (#0)
[Jan 20 17:54:52][chn3] Buffer dump (size=0 keep=32): {}
[Jan 20 17:54:52][chn3] CURL: Sent 38 bytes.. 
[Jan 20 17:54:52][chn3] CURL: Sent '[ [ 1421772892835.632080, 1.000000 
] ]' bytes
[Jan 20 17:54:52][chn3] CURL: upload completely sent off: 38 out of 38 
bytes
[Jan 20 17:54:52][chn3] CURL: additional stuff not fine 
transfer.c:1037: 0 0
[Jan 20 17:54:53][chn3] CURL: HTTP 1.1 or later with persistent 
connection, pipelining supported
[Jan 20 17:54:53][chn3] CURL: Received 26 bytes
[Jan 20 17:54:53][chn3] CURL: Received '{"version":"0.3","rows":1}' 
bytes
[Jan 20 17:54:53][chn3] CURL: Connection #0 to host localhost left 
intact
[Jan 20 17:54:53][chn3] CURL Request succeeded with code: 200
[Jan 20 17:55:02][chn3] Adding reading to queue (value=1.00 
ts=1421772902.424)
[Jan 20 17:55:02][chn3] ==> number of tuples: 1
[Jan 20 17:55:02][chn3] compare: 1421772892836 1421772902424 
1421772902423.831055
[Jan 20 17:55:02][chn3] JSON request body: [ [ 1421772902423.831055, 
1.000000 ] ]
[Jan 20 17:55:02][chn3] CURL: Connection #0 seems to be dead!
[Jan 20 17:55:02][chn3] CURL: Closing connection #0
[Jan 20 17:55:02][chn3] CURL: About to connect() to localhost port 80 
(#0)
[Jan 20 17:55:02][chn3] CURL:   Trying 127.0.0.1...
[Jan 20 17:55:02][chn3] CURL: connected
[Jan 20 17:55:02][chn3] CURL: Connected to localhost (127.0.0.1) port 
80 (#0)
[Jan 20 17:55:02][chn3] Buffer dump (size=0 keep=32): {}
[Jan 20 17:55:02][chn3] CURL: Sent 38 bytes.. 
[Jan 20 17:55:02][chn3] CURL: Sent '[ [ 1421772902423.831055, 1.000000 
] ]' bytes
[Jan 20 17:55:02][chn3] CURL: upload completely sent off: 38 out of 38 
bytes
[Jan 20 17:55:02][chn3] CURL: additional stuff not fine 
transfer.c:1037: 0 0
[Jan 20 17:55:02][chn3] CURL: HTTP 1.1 or later with persistent 
connection, pipelining supported
[Jan 20 17:55:02][chn3] CURL: Received 26 bytes
[Jan 20 17:55:02][chn3] CURL: Received '{"version":"0.3","rows":1}' 
bytes
[Jan 20 17:55:02][chn3] CURL: Connection #0 to host localhost left 
intact
[Jan 20 17:55:02][chn3] CURL Request succeeded with code: 200
[Jan 20 17:55:11][chn3] Adding reading to queue (value=1.00 
ts=1421772911.988)
[Jan 20 17:55:11][chn3] ==> number of tuples: 1
[Jan 20 17:55:11][chn3] compare: 1421772902424 1421772911988 
1421772911987.865967
[Jan 20 17:55:11][chn3] JSON request body: [ [ 1421772911987.865967, 
1.000000 ] ]
[Jan 20 17:55:11][chn3] CURL: Connection #0 seems to be dead!
[Jan 20 17:55:11][chn3] CURL: Closing connection #0
[Jan 20 17:55:11][chn3] CURL: About to connect() to localhost port 80 
(#0)
[Jan 20 17:55:11][chn3] CURL:   Trying 127.0.0.1...
[Jan 20 17:55:11][chn3] Buffer dump (size=0 keep=32): {}
[Jan 20 17:55:11][chn3] CURL: connected
[Jan 20 17:55:11][chn3] CURL: Connected to localhost (127.0.0.1) port 
80 (#0)
[Jan 20 17:55:12][chn3] CURL: Sent 38 bytes.. 
[Jan 20 17:55:12][chn3] CURL: Sent '[ [ 1421772911987.865967, 1.000000 
] ]' bytes
[Jan 20 17:55:12][chn3] CURL: upload completely sent off: 38 out of 38 
bytes
[Jan 20 17:55:12][chn3] CURL: additional stuff not fine 
transfer.c:1037: 0 0
[Jan 20 17:55:12][chn3] CURL: HTTP 1.1 or later with persistent 
connection, pipelining supported
[Jan 20 17:55:12][chn3] CURL: Received 26 bytes
[Jan 20 17:55:12][chn3] CURL: Received '{"version":"0.3","rows":1}' 
bytes
[Jan 20 17:55:12][chn3] CURL: Connection #0 to host localhost left 
intact
[Jan 20 17:55:12][chn3] CURL Request succeeded with code: 200
[Jan 20 17:55:21][chn3] Adding reading to queue (value=1.00 
ts=1421772921.538)
[Jan 20 17:55:21][chn3] ==> number of tuples: 1
==========================

Danke!


Bei Gelegenheit werd ich dann noch Aggregation ausprobieren - und dann 
die anderen 3 Kanäle vom "s0vz" zum "vzlogger" schieben. :-)




-- 


Gruss,
	Michael

GnuPG-ID 0x1E4ED700  http://pgp.mit.edu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://demo.volkszaehler.org/pipermail/volkszaehler-users/attachments/20150120/b7a3b72d/attachment-0001.html>


More information about the volkszaehler-users mailing list