[vz-dev] [vz-users] Funktionsweise vzlogger

Udo1 udo1 at gmx.net
Wed Aug 27 00:26:11 CEST 2014


Hallo Andreas,

Am 26.08.2014 13:20, schrieb Udo1:
> Am 26.08.2014 13:15, schrieb Andreas Götz:
>> Und läuft auch?
> Muss ich erst testen. 
Soweit ja. Ich konnte aber nur s0 und d0 testen. Habe leider keinen 
sml-Zähler.
Ich musste die vzlogger.conf noch etwas ändern. Neue Datei anbei.

Was mir aufgefallen ist:
Wenn "daemon" = false, dann kommt bei d0 die Meldung:
"Something unexpected happened: read:501"
Dabei werden auch keine Daten an die middleware gesendet und 
entsprechend auch keine Anzeige im Frontend.
Bei s0 tritt das nicht auf.

Gruß
Udo
-------------- next part --------------
/**
 * vzlogger configuration
 *
 * use proper encoded JSON with javascript comments
 *
 * take a look at the wiki for detailed information:
 * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration
 */

{
    "retry": 30,            /* how long to sleep between failed requests, in seconds */
    "daemon": true,        /* run periodically ; if "false" then foreground, if "true" then daemon */
    "verbosity": 5,         /* between 0 and 15 */
    "log": "/var/log/vzlogger.log",     /* path to logfile, optional */

    "local": {
        "enabled": false,   /* should we start the local HTTPd for serving live readings? Must be "false" for sending data to middleware */
        "port": 8080,       /* the TCP port for the local HTTPd */
        "index": true,      /* should we provide a index listing of available channels if no UUID was requested? */
        "timeout": 30,      /* timeout for long polling comet requests, 0 disables comet, in seconds */
        "buffer": 600       /* how long to buffer readings for the local interface, in seconds */
    },

    "meters": [
//---------------------------------------------------------------------------------------------------------------------------------
//				Example for sml-Meters
//---------------------------------------------------------------------------------------------------------------------------------
        {
            "enabled": false,               /* disabled meters will be ignored (default) */
            "protocol": "sml",              /* see 'vzlogger -h' for list of available protocols */
//          "host": "http://IP:Port",       /* if you send the device-data via YPORT etc. */
            "device": "/dev/ttyUSB0",       /* if you get the device-data directly from USB-Port */
            "channels": [{
                "uuid": "11111111-1111-1111-1111-111111111111",
                "middleware": "http://127.0.1.1/middleware.php",
                "identifier": "power"       /* alias for '1-0:1.7.ff', see 'vzlogger -h' for list of available aliases */
            }, {
                "uuid": "11111111-1111-1111-1111-111111111111",
                "middleware": "http://127.0.1.1/middleware.php",
                "identifier": "counter"
            }, {
                "uuid": "11111111-1111-1111-1111-111111111111",
                "middleware": "http://127.0.1.1/middleware.php",
                "identifier": "1-0:1.8.0"   /* see 'vzlogger -v20' for an output with all available identifiers/OBIS ids */
            }]
        },
//---------------------------------------------------------------------------------------------------------------------------------
//				Example for S0-Impulse-Meters		
//---------------------------------------------------------------------------------------------------------------------------------
        {
            "enabled": false,               /* disabled meters will be ignored */
            "protocol": "s0",
            "device": "/dev/ttyUSB0",       /* if you get the device-data directly from USB-Port; dont use vzlogger for Udo's extension, use s0vz */
            "aggtime": 300,                 /* aggregate all signals and give one update to middleware every 300 seconds */
            "aggfixedinterval": true,       /* round all timestamps to middleware to nearest aggtime */
            "channel": {
                "identifier": "Impulse",    /* s0 meter knows "Impulse" and "Power" */
                "uuid": "11111111-1111-1111-1111-111111111111",
                "middleware": "http://127.0.1.1/middleware.php",
                "aggmode": "SUM"            /* add all s0 intervals in the aggregation */
            }
        },
//---------------------------------------------------------------------------------------------------------------------------------
//				Example for d0-Meters
//---------------------------------------------------------------------------------------------------------------------------------
        {
            "enabled": false,               /* disabled meters will be ignored (default) */
            "protocol": "d0",               /* see 'vzlogger -h' for list of available protocols */
//          "host": "http://IP:Port",       /* if you send the device-data via YPORT etc. */
            "device": "/dev/ttyUSB0",       /* if you get the device-data directly from USB-Port */
            "parity": "7E1",                /* oder 8N1  */
            "baudrate": 9600,               /* oder 300  */
//          "pullseq": "2F3F210D0A",        /* Pullsequenz in 'hex' */
//          "ackseq": "063030300d0a",       /* Antwortsequenz auf Zaehlerantwort,063030300d0a = 300bd, 063035300d0a = 9600bd */
//          "baudrate_read": 300,           /* Baudratenumschaltung auf gewuenschte Baudrate, abhaengig von Zaehlerantwort */
//          "aggtime": 20,                  /* in Sekunden */
//          "aggmode": "AVG",               /* Mittelwert fuer Leistung, "MAX" fuer Zaehler, "SUM" fuer Counter */
            "interval": 6,                  /* Wartezeit in Sekunden bis neue Werte in die middleware uebertragen werden */
            "channel": {                    /* Beispiel-channel */
                "uuid": "11111111-1111-1111-1111-111111111111",
                "middleware": "http://127.0.1.1/middleware.php",
                "identifier": "1-0:1.8.1" 	/* alias for '1-0:1.8.1', see 'vzlogger -h' for list of available aliases */
            }
        },
//------------------------------------------------------------------------------------------------------------------------
//				 Examples for non-device protocols
//------------------------------------------------------------------------------------------------------------------------
        {
            "enabled": false,               /* disabled meters will be ignored */
            "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://127.0.1.1/middleware.php"
            }
        },
        {
            "enabled": false,               /* disabled meters will be ignored */
            "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                   /* of ommitted, we will try to listen on changes with inotify */
        },
//--------------------------------------------------------------------------------------------------------------------------
//              Example for Flukso-based sensors
//--------------------------------------------------------------------------------------------------------------------------
        {
            "enabled": false,               /* disabled meters will be ignored */
            "protocol": "fluksov2",
            "fifo": "/var/spid/delta/out",
            "channel": {
                "uuid": "3b4da450-42a8-11e1-8b8d-c526d853edec",
                "middleware": "http://127.0.1.1/middleware.php",
                "identifier": "sensor0/power" /* or "sensor2/consumption" e.g. */
            }
        },
//----------------------------------------------------------------------------------------------------------------------------
// 				Examples for MySmartGrid as middleware
//----------------------------------------------------------------------------------------------------------------------------
        {
            "enabled": false,               /* disabled meters will be ignored */
            "protocol": "d0",               /* see 'vzlogger -h' for list of available protocols */
            "device": "/dev/ttyUSB2",
            "interval": 2,
            "resolution": 2000,
            "channels": [{
                "protocol": "mysmartgrid",  /* use MySmartgrid as middleware protocol */
                "type": "sensor",
                "uuid": "01234567-9abc-def0-1234-56789abcdefe",
                "secretKey": "0123456789abcdef0123456789abcdef",
                "interval": 300,
                "middleware": "https://api.mysmartgrid.de:8443",    /* identifier for measurement: 1-0:1.8.0 */
                "identifier": "1-0:1.8.0",  /* see 'vzlogger -v20' for an output with all available identifiers/OBIS ids */
                "scaler": 1000              /* d0 counter is in kWh, so scaling is 1000 */
            }]
        },
        {
            "enabled": false,               /* disabled meters will be ignored */
            "protocol": "sml",              /* see 'vzlogger -h' for list of available protocols */
            "device": "/dev/ttyUSB0",
            "interval": 2,
            "resolution": 2000,
            "channels": [{
                "protocol": "mysmartgrid",  /* use MySmartgrid as middleware protocol */
                "type": "sensor",
                "uuid": "01234567-9abc-def0-1234-56789abcdefe",
                "secretKey": "0123456789abcdef0123456789abcdef",
                "interval": 300,
                "middleware": "https://api.mysmartgrid.de:8443",    /* identifier for measurement: 1-0:1.8.0 */
                "identifier": "1-0:1.8.0",  /* see 'vzlogger -v20' for an output with all available identifiers/OBIS ids */
                "scaler": 1                 /* sml counter is in Wh, so scaling is 1 */
            }]
        },
        {
            "enabled": false,               /* disabled meters will be ignored */
            "protocol": "s0",               /* see 'vzlogger -h' for list of available protocols */
            "device": "/dev/ttyUSB1",
            "interval": 2,
            "resolution": 2000,
            "channels": [{
                "protocol": "mysmartgrid",  /* use MySmartgrid as middleware protocol */
                "type": "sensor",
                "uuid": "01234567-9abc-def0-1234-56789abcdefe",
                "secretKey": "0123456789abcdef0123456789abcdef",
                "interval": 300,
                "middleware": "https://api.mysmartgrid.de:8443",    /* identifier for measurement: 1-0:1.8.0 */
                "identifier": "counter",
                "scaler": 1-0               /* s0 counter is in Wh */
            }]
        }
    ]
}


More information about the volkszaehler-dev mailing list