[vz-users] Problem mit vzlogger / interval Konfiguration

Gottfried Rossmanith gottfried.rossmanith at gmx.de
Sun Jan 18 10:14:54 CET 2015


Hallo,

ich benutze den vzlogger (0.4.0) auf einem Raspberry (B) mit der neusten
Debian Wheezy Distro. Ich lese mit 2 USB-IR_Leseköpfen die Daten von 2
Zählern (d0-protocol) aus.
 
Da die Zähler alle 2 Sekunden einen Datensatz liefern wollte ich mit
Hilfe der "interval" Variable nur jede Minute einen Wert speichern. Setz
man diesen auf interval=60 dann wird auch nur jede Minute ein Wert
abgespeichert, jedoch entspricht dieser Wert nicht dem neusten Zählerstand.

In der Datei threads.cpp wird das Intervall mit einer sleep Funktion
realisiert (Zeile 160). Ich bin der Meinung dass aber die anfallenden
Datensätze (alle 2 Sekunden) im seriellen Interface weiterhin
zwischengespeichert werden (nicht alle, aber ziemlich viele). Ich habe
daher einfach um die Lesefunktion (Zeile 72 mtr->read) eine Loop gemacht
und bekomme jetzt immer den aktuellen Wert.

Habe ich irgendwas falsch verstanden oder konfiguriert? Ich habe die
vzlogger.conf-Datei angehängt.

Gruß
Gottfried
-------------- 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
//    "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?
        "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": [
        {
            "enabled": true,                // disabled meters will be ignored (default)
//          "skip": false,                 // if enabled, errors when opening meter will lead to meter being ignored
            "protocol": "d0",               // see 'vzlogger -h' for list of available protocols
            "device": "/dev/ttyUSB0",
            "parity": "7E1",                // oder 8N1
            "baudrate": 9600,               // oder 300
//          "aggtime": 20,                  // in Sekunden
//          "aggmode": "AVG",               // Mittelwert für Leistung, "MAX" für Zähler, "SUM" für Counter
            "interval": 0,                // Wartezeit in Sekunden bis neue Werte in die middleware übertragen werden
            "channels": [{  	
                	"uuid": "015591c0-98c4-11e4-a065-533edbfc5885",
                	"middleware": "http://localhost/middleware.php",
                	"identifier": "1-0:1.8.0"
            	},{
                        "uuid": "29b4a960-98c4-11e4-b4d0-b1d7c1bbc793",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:2.8.0"
                },{
                        "uuid": "5cc60c40-98c4-11e4-8c1e-edc9f3ab54d1",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:21.7.255"
                },{
                        "uuid": "727fff20-98c4-11e4-ac8a-17bb5e57d475",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:61.7.255"
                },{
                        "uuid": "8a8df0c0-98c4-11e4-94ea-95ac433e8d76",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:1.7.255"
                }]
        },{
            "enabled": true,                // disabled meters will be ignored (default)
//          "skip": false,                 // if enabled, errors when opening meter will lead to meter being ignored
            "protocol": "d0",               // see 'vzlogger -h' for list of available protocols
            "device": "/dev/ttyUSB1",
            "parity": "7E1",                // oder 8N1
            "baudrate": 9600,               // oder 300
//          "aggtime": 20,                  // in Sekunden
//          "aggmode": "AVG",               // Mittelwert für Leistung, "MAX" für Zähler, "SUM" für Counter
            "interval": 0,                // Wartezeit in Sekunden bis neue Werte in die middleware übertragen werden
            "channels": [{       
                        "uuid": "3778fb40-98c5-11e4-9b5e-a7bc2516acc9",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:1.8.0"
                },{     
                        "uuid": "4847b080-98c5-11e4-b4db-0b41cd993107",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:2.8.0"
                },{
                        "uuid": "65c07dc0-98c5-11e4-afec-cbbd0414e8d5",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:21.7.255"
                },{
                        "uuid": "6d1fbc40-98c5-11e4-96d2-8116d8fe90e8",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:41.7.255"
                },{
                        "uuid": "80146ba0-98c5-11e4-8b9c-5b9a738805f6",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:61.7.255"
                },{
                        "uuid": "8cd4e240-98c5-11e4-a62d-e396802d204b",
                        "middleware": "http://localhost/middleware.php",
                        "identifier": "1-0:1.7.255"
                }]
	}]
}


More information about the volkszaehler-users mailing list