[vz-users] Wasserzaehler mit gruener LED und Fototransistor
Marc Haber
mh+volkszaehler-users at zugschlus.de
Wed May 29 13:20:50 CEST 2019
Hallo Daniel,
hallo Liste,
On Sat, May 11, 2019 at 06:52:01AM +0200, Daniel Lauckner wrote:
> am Freitag, 10. Mai 2019 um 20:00 hat Marc Haber geschrieben:
> > Ich wäre mit dem Ausgang von dem Eigenbauzähler an RXD von einem
> > USB-to-Serial-Adapter gegangen. Irgendwo im Wiki hatte ich mal Code
> > gefunden mit dem man die Impulse dann in die Middleware hineinbekommt.
>
> https://wiki.volkszaehler.org/hardware/controllers/s0-an-usb?s[]=s0&s[]=usb
Den Großteil dieser Schaltung habe ich mir gespart, weil der
Impulsgenerator von stall.biz
(https://www.stall.biz/project/intelligenter-impulsgeber-w-mit-s0-schnittstelle-zum-nachruesten-fuer-konventionelle-wasserzaehler)
an seiner Ausgangsseite eine ganz ähnliche Schaltung und insbesondere
ebenfalls einen Optokoppler hat.
https://www.stall.biz/wp/wp-content/uploads/2019/03/Folie1.jpg
Der von mir verwendete USB-to-Serial-Adapter hat praktischerweise direkt
einen +5V-Stift, mit dem ich den kompletten Impulsgenerator versorge.
Mit einem 10M-Widerstand (war grad griffbereit) ziehe ich die
RXD-Leitung auf +5V hoch; der S0-Ausgang des Impulsgenerators liegt
zwischen RXD und Masse. Sobald der Optokopper im Impulsgenerator
durchschaltet, geht RXD also auf low.
Mit der auf der Webseite erwähnten vzlogger-Konfiguration scheint auch
irgendwas zu funktioneren, jedenfalls bekomme ich für jedes Abdecken des
Fototransistors eine Reaktion im Log.
Mehr noch nicht, da aktuell keine Middleware da ist.
[May 29 13:16:25][main] vzlogger v0.7.0 based on heads/master-0-gc567220a06-dirty from Sun, 14 Apr 2019 10:25:20 +0200 started.
[May 29 13:16:25][mtr0] Creating new meter with protocol s0.
[May 29 13:16:25][mtr0] Meter configured, enabled.
[May 29 13:16:25] New meter initialized (protocol=s0)
[May 29 13:16:25] Configure channel.
[May 29 13:16:25][chn0] New channel initialized (uuid=...3ea8df api=volkszaehler id=Impulse)
[May 29 13:16:25] Have 1 meters.
[May 29 13:16:25][main] log level is 15
[May 29 13:16:25][main] daemon=1, local=0
[May 29 13:16:25] Daemonize process...
[May 29 13:16:25] Opened logfile /home/mh/vzlogger.log
[May 29 13:16:25][push] No pushDataServer defined.
[May 29 13:16:25][] ===> Start meters
[May 29 13:16:25][s0] counter_thread created
[May 29 13:16:25][mtr0] Meter connection established
[May 29 13:16:25][s0] Counter thread started with blocking hwif
[May 29 13:16:25][mtr0] Meter thread started
[May 29 13:16:25][s0] failed to set policy to SCHED_FIFO for counter_thread
[May 29 13:16:25][mtr0] Meter is opened. Starting channels.
[May 29 13:16:25][chn0] Logging thread started
[May 29 13:16:25][mtr0] Number of readers: 4
[May 29 13:16:25][chn0] Start logging thread for volkszaehler-api. Running as daemon: yes
[May 29 13:16:25][chn0] Using default volkszaehler api.
[May 29 13:16:25][] Startup done.
[May 29 13:16:25][mtr0] Config.daemon: 1
[May 29 13:16:25][mtr0] Config.local: 0
[May 29 13:17:21][s0] Reading S0 - returning 1 readings (n=1 n_neg = 0)
[May 29 13:17:21][mtr0] Got 1 new readings from meter:
[May 29 13:17:21][mtr0] Reading: id=Impulse/StringIdentifier: value=1.00 ts=1559128640581
[May 29 13:17:21][chn0] Adding reading to queue (value=1.00 ts=1559128640581)
[May 29 13:17:21][chn0] ==> number of tuples: 1
[May 29 13:17:21][chn0] compare: 0 1559128640581
[May 29 13:17:21][chn0] copied 1/1 values for middleware transmission
[May 29 13:17:21][chn0] JSON request body: [ [ 1559128640581, 1 ] ]
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 6 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 30000 ms for 8 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 1 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 2 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 2 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 2 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 2 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 0 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 2 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 1 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 1 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 2 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 1 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 1 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 2 ms for 1 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Trying ::1...
[May 29 13:17:21][chn0] CURL: TCP_NODELAY set
[May 29 13:17:21][chn0] CURL: Expire in 14996 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: Expire in 200 ms for 4 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: connect to ::1 port 80 failed: Connection refused
[May 29 13:17:21][chn0] CURL: Trying 127.0.0.1...
[May 29 13:17:21][chn0] CURL: TCP_NODELAY set
[May 29 13:17:21][chn0] CURL: Expire in 14996 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:21][chn0] CURL: connect to 127.0.0.1 port 80 failed: Connection refused
[May 29 13:17:21][chn0] CURL: Failed to connect to localhost port 80: Connection refused
[May 29 13:17:21][chn0] CURL: Closing connection 0
[May 29 13:17:21][chn0] CURL: Couldn't connect to server
[May 29 13:17:21][chn0] Waiting 0 secs for next request due to previous failure
[May 29 13:17:28][s0] Reading S0 - returning 2 readings (n=1 n_neg = 0)
[May 29 13:17:28][mtr0] Got 2 new readings from meter:
[May 29 13:17:28][mtr0] Reading: id=Power/StringIdentifier: value=478.47 ts=1559128648105
[May 29 13:17:28][mtr0] Reading: id=Impulse/StringIdentifier: value=1.00 ts=1559128648105
[May 29 13:17:28][chn0] Adding reading to queue (value=1.00 ts=1559128648105)
[May 29 13:17:28][chn0] ==> number of tuples: 1
[May 29 13:17:28][chn0] compare: 1559128640581 1559128648105
[May 29 13:17:28][chn0] copied 2/2 values for middleware transmission
[May 29 13:17:28][chn0] JSON request body: [ [ 1559128640581, 1 ], [ 1559128648105, 1 ] ]
[May 29 13:17:28][chn0] CURL: Expire in 0 ms for 6 (transfer 0xb4f00c28)
[May 29 13:17:28][chn0] CURL: Expire in 30000 ms for 8 (transfer 0xb4f00c28)
[May 29 13:17:28][chn0] CURL: Hostname localhost was found in DNS cache
[May 29 13:17:28][chn0] CURL: Trying ::1...
[May 29 13:17:28][chn0] CURL: TCP_NODELAY set
[May 29 13:17:28][chn0] CURL: Expire in 15000 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:28][chn0] CURL: Expire in 200 ms for 4 (transfer 0xb4f00c28)
[May 29 13:17:28][chn0] CURL: connect to ::1 port 80 failed: Connection refused
[May 29 13:17:28][chn0] CURL: Trying 127.0.0.1...
[May 29 13:17:28][chn0] CURL: TCP_NODELAY set
[May 29 13:17:28][chn0] CURL: Expire in 14999 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:28][chn0] CURL: connect to 127.0.0.1 port 80 failed: Connection refused
[May 29 13:17:28][chn0] CURL: Failed to connect to localhost port 80: Connection refused
[May 29 13:17:28][chn0] CURL: Closing connection 1
[May 29 13:17:28][chn0] CURL: Couldn't connect to server
[May 29 13:17:28][chn0] Waiting 0 secs for next request due to previous failure
[May 29 13:17:31][s0] Reading S0 - returning 2 readings (n=1 n_neg = 0)
[May 29 13:17:31][mtr0] Got 2 new readings from meter:
[May 29 13:17:31][mtr0] Reading: id=Power/StringIdentifier: value=1244.81 ts=1559128650997
[May 29 13:17:31][mtr0] Reading: id=Impulse/StringIdentifier: value=1.00 ts=1559128650997
[May 29 13:17:31][chn0] Adding reading to queue (value=1.00 ts=1559128650997)
[May 29 13:17:31][chn0] ==> number of tuples: 1
[May 29 13:17:31][chn0] compare: 1559128648105 1559128650997
[May 29 13:17:31][chn0] copied 3/3 values for middleware transmission
[May 29 13:17:31][chn0] JSON request body: [ [ 1559128640581, 1 ], [ 1559128648105, 1 ], [ 1559128650997, 1 ] ]
[May 29 13:17:31][chn0] CURL: Expire in 0 ms for 6 (transfer 0xb4f00c28)
[May 29 13:17:31][chn0] CURL: Expire in 30000 ms for 8 (transfer 0xb4f00c28)
[May 29 13:17:31][chn0] CURL: Hostname localhost was found in DNS cache
[May 29 13:17:31][chn0] CURL: Trying ::1...
[May 29 13:17:31][chn0] CURL: TCP_NODELAY set
[May 29 13:17:31][chn0] CURL: Expire in 15000 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:31][chn0] CURL: Expire in 200 ms for 4 (transfer 0xb4f00c28)
[May 29 13:17:31][chn0] CURL: connect to ::1 port 80 failed: Connection refused
[May 29 13:17:31][chn0] CURL: Trying 127.0.0.1...
[May 29 13:17:31][chn0] CURL: TCP_NODELAY set
[May 29 13:17:31][chn0] CURL: Expire in 14999 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:31][chn0] CURL: connect to 127.0.0.1 port 80 failed: Connection refused
[May 29 13:17:31][chn0] CURL: Failed to connect to localhost port 80: Connection refused
[May 29 13:17:31][chn0] CURL: Closing connection 2
[May 29 13:17:31][chn0] CURL: Couldn't connect to server
[May 29 13:17:31][chn0] Waiting 0 secs for next request due to previous failure
[May 29 13:17:39][s0] Reading S0 - returning 2 readings (n=1 n_neg = 0)
[May 29 13:17:39][mtr0] Got 2 new readings from meter:
[May 29 13:17:39][mtr0] Reading: id=Power/StringIdentifier: value=454.26 ts=1559128658922
[May 29 13:17:39][mtr0] Reading: id=Impulse/StringIdentifier: value=1.00 ts=1559128658922
[May 29 13:17:39][chn0] Adding reading to queue (value=1.00 ts=1559128658922)
[May 29 13:17:39][chn0] ==> number of tuples: 1
[May 29 13:17:39][chn0] compare: 1559128650997 1559128658922
[May 29 13:17:39][chn0] copied 4/4 values for middleware transmission
[May 29 13:17:39][chn0] JSON request body: [ [ 1559128640581, 1 ], [ 1559128648105, 1 ], [ 1559128650997, 1 ], [ 1559128658922, 1 ] ]
[May 29 13:17:39][chn0] CURL: Expire in 0 ms for 6 (transfer 0xb4f00c28)
[May 29 13:17:39][chn0] CURL: Expire in 30000 ms for 8 (transfer 0xb4f00c28)
[May 29 13:17:39][chn0] CURL: Hostname localhost was found in DNS cache
[May 29 13:17:39][chn0] CURL: Trying ::1...
[May 29 13:17:39][chn0] CURL: TCP_NODELAY set
[May 29 13:17:39][chn0] CURL: Expire in 15000 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:39][chn0] CURL: Expire in 200 ms for 4 (transfer 0xb4f00c28)
[May 29 13:17:39][chn0] CURL: connect to ::1 port 80 failed: Connection refused
[May 29 13:17:39][chn0] CURL: Trying 127.0.0.1...
[May 29 13:17:39][chn0] CURL: TCP_NODELAY set
[May 29 13:17:39][chn0] CURL: Expire in 14999 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:39][chn0] CURL: connect to 127.0.0.1 port 80 failed: Connection refused
[May 29 13:17:39][chn0] CURL: Failed to connect to localhost port 80: Connection refused
[May 29 13:17:39][chn0] CURL: Closing connection 3
[May 29 13:17:39][chn0] CURL: Couldn't connect to server
[May 29 13:17:39][chn0] Waiting 0 secs for next request due to previous failure
[May 29 13:17:40][s0] Reading S0 - returning 2 readings (n=1 n_neg = 0)
[May 29 13:17:40][mtr0] Got 2 new readings from meter:
[May 29 13:17:40][mtr0] Reading: id=Power/StringIdentifier: value=2670.62 ts=1559128660270
[May 29 13:17:40][mtr0] Reading: id=Impulse/StringIdentifier: value=1.00 ts=1559128660270
[May 29 13:17:40][chn0] Adding reading to queue (value=1.00 ts=1559128660270)
[May 29 13:17:40][chn0] ==> number of tuples: 1
[May 29 13:17:40][chn0] compare: 1559128658922 1559128660270
[May 29 13:17:40][chn0] copied 5/5 values for middleware transmission
[May 29 13:17:40][chn0] JSON request body: [ [ 1559128640581, 1 ], [ 1559128648105, 1 ], [ 1559128650997, 1 ], [ 1559128658922, 1 ], [ 1559128660270, 1 ] ]
[May 29 13:17:40][chn0] CURL: Expire in 0 ms for 6 (transfer 0xb4f00c28)
[May 29 13:17:40][chn0] CURL: Expire in 30000 ms for 8 (transfer 0xb4f00c28)
[May 29 13:17:40][chn0] CURL: Hostname localhost was found in DNS cache
[May 29 13:17:40][chn0] CURL: Trying ::1...
[May 29 13:17:40][chn0] CURL: TCP_NODELAY set
[May 29 13:17:40][chn0] CURL: Expire in 15000 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:40][chn0] CURL: Expire in 200 ms for 4 (transfer 0xb4f00c28)
[May 29 13:17:40][chn0] CURL: connect to ::1 port 80 failed: Connection refused
[May 29 13:17:40][chn0] CURL: Trying 127.0.0.1...
[May 29 13:17:40][chn0] CURL: TCP_NODELAY set
[May 29 13:17:40][chn0] CURL: Expire in 14999 ms for 3 (transfer 0xb4f00c28)
[May 29 13:17:40][chn0] CURL: connect to 127.0.0.1 port 80 failed: Connection refused
[May 29 13:17:40][chn0] CURL: Failed to connect to localhost port 80: Connection refused
[May 29 13:17:40][chn0] CURL: Closing connection 4
[May 29 13:17:40][chn0] CURL: Couldn't connect to server
[May 29 13:17:40][chn0] Waiting 0 secs for next request due to previous failurei
Das sieht ja schonmal gut aus. Nun also eine Middleware hinstellen.
Grüße
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
More information about the volkszaehler-users
mailing list