Hallo Volkszähler-Experten,

als Anfänger im Thema „VZ“ bin ich an einem Punkt angekommen, an dem ich ein paar Hinweise von Experten brauchen könnte. Danke schon mal vorab!

Ich habe einen Wärmemengenzähler von Danfoss Typ SonoSafe 10. Der WMZ hat an der Front eine optische IR-Schnittstelle beschrieben im Datenblatt mit: „Optisch gemäß EN61107. Datenprotokoll gemäß EN13757-3, unterstützt Baudraten von 2400 und 4800.“

Die EN61107 wurde abgelöst durch die EN62056-21, die auch bei vielen Zählern verwendet wird. Ich meine, die Schnittstelle müsste grundsätzlich passen, da z.B. der im VZ-Wiki beschriebene WMZ Kamstrup 401 auch die IR-Schnittstelle nach EN61107 nutzt.

Frage an die Experten: Seht Ihr das auch so?

 

Das Datenprotokoll nach EN13757-3 ist das M-Bus-Protokoll. Dieses wird nach der Danfoss-Beschreibung für die kabelgebundene M-Bus-Schittstelle und für die IR-Schnitstelle verwendet.

Für die Kommunikation ist angegeben: 11 Bits pro Zeichen, d.h. 1 Start-Bit (‘space’), 8 Daten-Bits, 1 Parity-Bit (even) und 1 Stop-Bit (‚mark‘). Das bedeutet doch für die Parity-Bezeichnung „8E1“, richtig?
In welchem Protokoll im vzlogger ist diese Parität verwendbar? Bei D0 scheint es nicht zu funktionieren.

Für die opt. Schnittstelle ist nach EN13757-2 Protokoll eine „wake up message“ nötig. Die ist beschrieben (Zitat) als „The wake up message consists of zeros and ones alternating at the desired baud rate for a duration of 2,2 s +/- 0,1 s.”

In welchem Protokoll im vzlogger wäre so eine Pullsequenz verwendbar?

 

So, damit - nach den bisherigen Versuchen - zu meinen grundsätzlichen Fragen:

Kann ich den WMZ überhaupt über die IR-Schnittstelle mit dem Volkszähler nutzen?

Welches Protokoll würde da gehen? D0 wohl nicht, oder? Vielleicht OMS?

Wie sollte ich vorgehen?

 

Ich habe mir auf einem Raspi 4 das VZ-Image installiert. Als IR-Kopf habe ich den von Weidmann. Der Kopf funktioniert. Über Hterm am PC und minicom über SSH und Raspi kann ich Signale von einer IR-Fernbedienung empfangen bzw. Tastatureingaben senden und empfangen.

Wenn ich im Vzlogger mit dem Protokoll D0 eine Verbindung zum WMZ versuche, funktioniert das nicht. Leider habe ich keine Erfahrung im Lesen und Interpretieren von Log-Files. Im Anhang die Dateien für vzlogger_conf.txt, vzlogger_log.txt und d0.txt. Würdet Ihr bitte mal drauf schauen und sagen, ob und was man da schon erkennen kann?

Beispiel: Im d0.txt gibt es „<<<<“ und „>>>>“-Signale. Was heisst das genau? Antwortet der WMZ?

Ich lese „<<<<“ und „2f 3f 21 0d 0a“, aber bei „>>>>“ steht dann „2f 3f 21 0a 0a“. Ist das eine Antwort?

Ich wäre ja schon zufrieden, erstmal eine Reaktion vom Zähler zu erhalten. ;-)

 

Wie könnte es weitergehen?

Besteht eine Chance, die IR-Schnittstelle irgendwie zu nutzen?

Oder muss ich doch eine kabelgebundene M-Bus-Verbindung herstellen (Pegelwandler?)?

 

Danke für alle Hinweise!

Gruß Thorsten

pi@raspberrypi:~ $ sudo cat /var/log/d0.txt

##### 64.511385616s (     0 ms) opened
##### 64.515921727s (     4 ms) read
##### 64.515939264s (     0 ms) TCIOFLUSH and cfsetiospeed
<<<<< 64.917704115s (   402 ms)
2f 3f 21 0d 0a                                    /?!

>>>>> 64.972493967s (    55 ms)
2f 3f 21 0a 0a                                    /?!

##### 80.237593791s ( 15265 ms) timeout!
##### 80.237881180s (     0 ms) read
##### 80.237922088s (     0 ms) TCIOFLUSH and cfsetiospeed
<<<<< 80.638575125s (   401 ms)
2f 3f 21 0d 0a                                    /?!

>>>>> 80.689662939s (    51 ms)
2f 3f 21 0a 0a                                    /?!

##### 95.917762282s ( 15228 ms) timeout!
#####  0.919207298s (  5002 ms) closed
/**
 * vzlogger configuration
 *
 * Use properly encoded JSON with javascript comments
 *
 * Take a look at the wiki for detailed information:
 * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration
 *
 * For an online configuration editor refer to:
 * http://volkszaehler.github.io/vzlogger/
 */

{
    // General settings
    "daemon": false,        // run periodically
    "verbosity": 5,         // log verbosity (0=log_alert, 1=log_error, 
3=log_warning, 5=log_info, 10=log_debug, 15=log_finest)
    "log": "/var/log/vzlogger.log", // log file, optional
    "retry": 30,            // http retry delay in seconds

    // Build-in HTTP server
    "local": {
        "enabled": false,   // enable local HTTPd for serving live readings
        "port": 8080,       // TCP port for local HTTPd
        "index": true,      // provide index listing of available channels if 
no UUID was requested
        "timeout": 30,      // timeout for long polling comet requests in 
seconds (0 disables comet)
        "buffer": -1        // HTTPd buffer configuration for serving readings, 
default -1
                            //   >0: number of seconds of readings to serve
                            //   <0: number of tuples to server per channel 
(e.g. -3 will serve 3 tuples)
    },

    // realtime notification settings
    "push": [
        {
            "url": "http://127.0.0.1:5582";  // notification destination, e.g. 
frontend push-server
        }
    ],

    // mqtt client support (if ENABLE_MQTT set at cmake generation)
    "mqtt": {
        "enabled": false,  // enable mqtt client. needs host and port as well
        "host": "test.mosquitto.org", // mqtt server addr
        "port": 1883, // 1883 for unencrypted, 8883 enc, 8884 enc cert needed,
        "cafile": "", // optional file with server CA
        "capath": "", // optional path for server CAs. see mosquitto.conf. 
Specify only cafile or capath
        "certfile": "", // optional file for your client certificate (e.g. 
client.crt)
        "keyfile": "", // optional path for your client certficate private key 
(e.g. client.key)
        "keypass": "", // optional password for your private key
        "keepalive": 30, // optional keepalive in seconds.
        "topic": "vzlogger/data", // optional topic dont use $ at start and no 
/ at end
        "user": "", // optional user name for the mqtt server
        "pass": "", // optional password for the mqtt server
        "retain": false, // optional use retain message flag
        "rawAndAgg": false, // optional publish raw values even if agg mode is 
used
    },


    // Meter configuration
    "meters":
    [
/**    {
            // Example SML meter

            "enabled": false,               // disabled meters will be ignored 
(default)
            "skip": false,                  // errors when opening meter may be 
ignored if enabled
            "protocol": "sml",              // meter protocol, see 'vzlogger 
-h' for full list
            "device": "/dev/ttyUSB1",       // meter device
//          "host": "http://my.ddns.net::7331";,   // uri if meter not locally 
connected using <device>

            "aggtime": 10,                  // aggregate meter readings and 
send middleware update after <aggtime> seconds

            "channels": [{
                "api": "volkszaehler",      // middleware api, default 
volkszaehler
                "uuid": "fde8f1d0-c5d0-11e0-856e-f9e4360ced10",
                "middleware": "http://localhost/middleware.php";,
                "identifier": "power"       // OBIS identifier (alias for 
'1-0:1.7.ff')
                                            //   see 'vzlogger -h' for 
available aliases
                                            //   see 'vzlogger -v20' for 
available identifiers for attached meters
            }, {
                "uuid": "a8da012a-9eb4-49ed-b7f3-38c95142a90c",
                "middleware": "http://localhost/middleware.php";,
                "identifier": "counter",    // OBIS identifier
                "duplicates": 10            // duplicate handling, default 0 
(send duplicate values)
                                            //   >0: send duplicate values only 
each <duplicates> seconds
                                            // Activate only for abs. counter 
values (Zaehlerstaende) and not for impulses
            }, {
                "uuid": "d5c6db0f-533e-498d-a85a-be972c104b48",
                "middleware": "http://localhost/middleware.php";,
                "identifier": "1-0:1.8.0"   // OBIS identifier
            }]
        },
        {
            // Example S0 meter

            "enabled": false,               // disabled meters will be ignored 
(default)
            "skip": false,                  // errors when opening meter may be 
ignored if enabled
            "protocol": "s0",               // meter protocol, see 'vzlogger 
-h' for full list
            "device": "/dev/ttyUSB0",       // meter device

            "aggtime": 300,                 // aggregate meter readings and 
send middleware update after <aggtime> seconds
            "aggfixedinterval": true,       // round timestamps to nearest 
<aggtime> before sending to middleware

            "channel": {
                "identifier": "Impulse",    // s0 meter knows "Impulse" and 
"Power"
                "uuid": "d495a390-f747-11e0-b3ca-f7890e45c7b2",
                "middleware": "http://localhost/middleware.php";,
                "aggmode": "SUM"            // aggregation mode: aggregate 
meter readings during <aggtime> interval
                                            //   "SUM": add readings (use for 
s0 impulses)
                                            //   "MAX": maximum value (use for 
meters sending absolute readings)
                                            //   "AVG": average value (use for 
meters sending current usage)
            }
        },
*/

     {
            // Example D0 meter / enable = true und Test 2 VL-Temp: UUID = 
b6992b60-a00d-11ea-a2c1-435966815451   eingefügt / Baudrate geändert von 9600 
auf 300 / ackseq = 063030300d0a / baudrate read = 2400 / parity = 7E1
            //  / read_timeout von 10 sek / interval von 0 auf 5 /

            "enabled": true,               // disabled meters will be ignored 
(default)
            "skip": false,                  // errors when opening meter may be 
ignored if enabled
            "protocol": "d0",               // meter protocol, see 'vzlogger 
-h' for full list
            "device": "/dev/ttyUSB0",       // meter device
            "dump_file": "/var/log/d0.txt", // detailed log file for all 
received/transmitted data (optional)
            "parity": "7E1",                // Serial parity, 7E1 or 8N1
            "baudrate": 300,               // Serial baud rate, typically 9600 
or 300

            // optional D0 interface settings
            "pullseq": "2F3F210D0A",        // Pull sequence in 'hex'
            "ackseq": "063030300d0a",       // optional (default: keine 
Antwortsequenz auf Zaehlerantwort) kann entweder feste hex-Sequenz sein (z.B. 
063035300d0a für mode C mit 9600bd oder 063030300d0a = 300bd) oder kann auf 
"auto" ges$
            "read_timeout": 10,             // optional read timeout, default 
10s. Data reading is considered finished if no state change after that timeout
            "baudrate_change_delay": 400,   // optional, default none. Delay 
value in ms after ACKSEQ send before baudrate change
            "baudrate_read": 2400,           // Baudratenumschaltung auf 
gewünschte Baudrate, abhängig von Zählerantwort

            "aggtime": 20,                  // aggregate meter readings and 
send middleware update after <aggtime> seconds
            "interval": 5,                  // Wartezeit in Sekunden bis neue 
Werte in die middleware übertragen werden

            "channel": {
                "uuid": "b6992b60-a00d-11ea-a2c1-435966815451",
                "middleware": "http://localhost/middleware.php";,
                "identifier": "1-0:1.8.1",  // OBIS identifier
                "aggmode": "MAX",            // aggregation mode: aggregate 
meter readings during <aggtime> interval
            }
        },

/**     // examples for non-device protocols
        {
            "enabled": false,               // disabled meters will be ignored
            "skip": false,                  // errors when opening meter may be 
ignored if enabled

            "protocol": "random",
            "interval": 2,
            "max": 40.0,                    // has to be double!
            "min": -5.0,                    // has to be double!
            "channel": {
                "uuid": "bac2e840-f72c-11e0-bedf-3f850c1e5a66",
                "middleware": "http://localhost/middleware.php";
            }
        },
        {
            "enabled": false,               // disabled meters will be ignored
            "skip": false,                  // errors when opening meter may be 
ignored if enabled

            "protocol": "file",
            "path": "/proc/loadavg",
//          "format": "$i $v $t",           // a format string for parsing 
complex logfiles
                                            // arbitrary text and whitespaces 
are allowed, see 'scanf()'
                                            // at least $v has to be used
                                            // $i => identifier, $v => value, 
$t => timestamp
            "rewind": true,                 // reset file pointer each interval 
to the beginning of the file
            "interval": 2                   // if ommitted, we will try to 
listen on changes with inotify
        },
        {
            "enabled": false,               // disabled meters will be ignored
            "skip": false,                  // if enabled, errors when opening 
meter will lead to meter being ignored
            "protocol": "exec",
            "command": "python /path/to/yourscript.py", // is the command line 
as you'll type it in the shell - remember to test your command from the root 
directory
            //          "format": "$i $v $t",           // a format string for 
parsing complex logfiles
                                                        // arbitrary text and 
whitespaces are allowed, see 'scanf()'
                                                        // at least $v has to 
be used
                                                        // $i => identifier, $v 
=> value, $t => timestamp
            "interval": 2
        },

        // examples for Flukso-based sensors
        {
            "enabled": false,               // disabled meters will be ignored
            "skip": false,                  // errors when opening meter may be 
ignored if enabled

            "protocol": "fluksov2",
            "fifo": "/var/spid/delta/out",
            "channel": {
                "uuid": "3b4da450-42a8-11e1-8b8d-c526d853edec",
                "middleware": "http://localhost/middleware.php";,
                "identifier": "sensor0/power" // or "sensor2/consumption"
            }
        },

        // example for 1wire temp sensors
        {
            "enabled": false,
            "skip": true,
            "protocol": "w1therm"
        },
*/

/**     // example OMS or M-Bus meter / mbus_debug = true
        {
           "enabled": true,
           "allowskip": false,
           "interval": 0,
           "aggtime": 20,
           "aggfixedinterval": false,
           "channels": [
           {
           "api": "volkszaehler",
               "uuid": "b6992b60-a00d-11ea-a2c1-435966815451",
                "identifier": "1-0:1.8.1",
                "middleware": "http://localhost/middleware.php";,
                "aggmode": "max",
                "duplicates": 0
        }
           ],
           "protocol": "oms",
           "device": "/dev/ttyUSB0",
           "baudrate": 2400,
           "key": "0102030405060708090a0b0c0d0e0f10",
           "mbus_debug": true,
           "use_local_time": false,
           "dump_file": "/var/log/OMS.txt",
           "pullseq": "2F3F210D0A",
           "ackseq": "auto",
           "baudrate_read": 2400,
           "parity": "8e1",
           "wait_sync": "off",
           "read_timeout": 10,
           "baudrate_change_delay": 400
        }
*/
    ]
}




pi@raspberrypi:~ $ sudo vzlogger -v 15
[May 31 11:39:16][main] vzlogger v0.7.0 based on heads/master-0-g12e74ddd43 
from                                                                            
                                                                                
  Sun, 2 Jun 2019 20:48:14 +0200 started.
[May 31 11:39:16]       Start parsing configuration from /etc/vzlogger.conf
[May 31 11:39:16]       New meter initialized (protocol=d0)
[May 31 11:39:16][chn0] New channel initialized (uuid=...815451 
api=volkszaehler                                                                
                                                                                
              id=1-0:1.8.1)
[May 31 11:39:16][main] log level is 15
[May 31 11:39:16][main] daemon=0, local=0
[May 31 11:39:16]       Process not  daemonized...
[May 31 11:39:16]       Opened logfile /var/log/vzlogger.log
[May 31 11:39:16][push] pushdata_thread created.
[May 31 11:39:16][push] Start push_data_thread
[May 31 11:39:16][]     ===> Start meters
[May 31 11:39:16][mtr0] Meter connection established
[May 31 11:39:16][mtr0] Meter thread started
[May 31 11:39:16][mtr0] Number of readers: 400
[May 31 11:39:16][mtr0] Config.daemon: 0
[May 31 11:39:16][mtr0] Config.local: 0
[May 31 11:39:16][mtr0] Meter is opened. Starting channels.
[May 31 11:39:16][chn0] Logging thread started
[May 31 11:39:16][chn0] Start logging thread for volkszaehler-api. Running as 
da                                                                              
                                                                               
emon: no
[May 31 11:39:16][]     Startup done.
[May 31 11:39:16][chn0] Using default volkszaehler api.
[May 31 11:39:16][d0]   sending pullsequenz send (len:5 is:5).
[May 31 11:39:21][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:26][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:31][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:31][d0]   nothing received for more than 10 seconds
[May 31 11:39:31][d0]   read timed out!, context: 1, bytes read: 0, last byte 
0xa
[May 31 11:39:31][mtr0] Got 0 new readings from meter:
[May 31 11:39:32][d0]   sending pullsequenz send (len:5 is:5).
[May 31 11:39:36][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:41][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:46][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:47][d0]   nothing received for more than 10 seconds
[May 31 11:39:47][d0]   read timed out!, context: 1, bytes read: 0, last byte 
0xa
[May 31 11:39:47][mtr0] Got 0 new readings from meter:
[May 31 11:39:47][mtr0] Next reading in 5 seconds
[May 31 11:39:47][chn0] ==> number of tuples: 0
[May 31 11:39:47][chn0] JSON request body is null. Nothing to send now.
[May 31 11:39:51][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:52][mtr0] Stopped reading.
[May 31 11:39:52][]     Server stopped.
[May 31 11:39:52][]     Waiting for pushdata_thread to stop...
[May 31 11:39:56][push] waitAndSendOnceToAll empty dataMap (timeout?)
[May 31 11:39:56][push] Stopped push_data_thread
[May 31 11:39:56][]     pushdata_thread stopped
[May 31 11:39:56][]     deleted pushdataList
[May 31 11:39:56][]     Trying to delete curlSessionProvider...
[May 31 11:39:56][]     deleted curlSessionProvider

Antwort per Email an