<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Rene,<div class=""><br class=""></div><div class="">Das hat wie vermutet mit vzlogger überhaupt gar nicht zu tun:</div><div class=""><br class=""></div><div class="">> <span style="font-family: Calibri, sans-serif; font-size: 11pt;" class="">Subject: Cron <pi@raspberrypi> php /var/www/</span><a href="http://volkszaehler.org/bin/aggregate" class="" style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(149, 79, 114);">volkszaehler.org/bin/aggregate</a><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""> </span><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class="">run -m delta -l minute >/dev/null</span></div><div class=""><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""><br class=""></span></div><div class=""><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class="">Irgendwie hast Du es geschafft einen Fehler zu provozieren den es noch nie gab. Mach mal bitte ein </span></div><div class=""><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""><br class=""></span></div><div class=""><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>aggregate clear (oder so ähnlich)</span></div><div class=""><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""><br class=""></span></div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">dann den Befehl von oben.</span></font></div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class=""></span></font></div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">Mal schauen ob die Tabelle sauber wieder aufgebaut werden kann. Irgendwas ist da sehr krumm…</span></font></div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class=""></span></font></div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">Viele Grüße, Andreas</span></font></div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class=""></span></font></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 15. Jun 2019, at 12:04, René W. <<a href="mailto:tylonhh@gmail.com" class="">tylonhh@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hallo Zusammen,</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">da habe ich wohl zu weit Gedacht und nur auf meine Anfängererfahrung vertraut. Manchmal ist es aber nicht gut wenn man „mitdenkt“. Daher meine zielgerichtete Frage.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Also dann mal von ganz Anfang:</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">In SSH erhalte ich die Meldung das ich eine „Mail“ habe</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">pi@raspberrypi:~ $ cat /var/mail/pi</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">From pi@raspberrypi Sat Jun 15 11:50:02 2019</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Return-path: <pi@raspberrypi></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Envelope-to: pi@raspberrypi</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Delivery-date: Sat, 15 Jun 2019 11:50:02 +0200</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Received: from pi by raspberrypi with local (Exim 4.92)</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> (envelope-from <pi@raspberrypi>)</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> id 1hc5Jy-0004aw-An</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> for pi@raspberrypi; Sat, 15 Jun 2019 11:50:02 +0200</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">From: root@raspberrypi (Cron Daemon)</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">To: pi@raspberrypi</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Subject: Cron <pi@raspberrypi> php /var/www/<a href="http://volkszaehler.org/bin/aggregate" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">volkszaehler.org/bin/aggregate</a><span class="Apple-converted-space"> </span>run -m delta -l minute >/dev/null</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">MIME-Version: 1.0</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Content-Type: text/plain; charset=UTF-8</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Content-Transfer-Encoding: 8bit</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">X-Cron-Env: <SHELL=/bin/sh></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">X-Cron-Env: <HOME=/home/pi></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">X-Cron-Env: <PATH=/usr/bin:/bin></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">X-Cron-Env: <LOGNAME=pi></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Message-Id: <E1hc5Jy-0004aw-An@raspberrypi></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Date: Sat, 15 Jun 2019 11:50:02 +0200</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">In AbstractMySQLDriver.php line 106:</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> An exception occurred while executing 'REPLACE INTO aggregate (channel_id,</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> type, timestamp, value, count) SELECT channel_id, ? AS type, MAX(agg.timest</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> amp) AS timestamp, COALESCE( SUM(agg.val_by_time) / (MAX(agg.timestamp) - M</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> IN(agg.prev_timestamp)), AVG(agg.value)) AS value, COUNT(agg.value) AS coun</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> t FROM ( SELECT channel_id, timestamp, value, value * (timestamp - @prev_ti</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> mestamp) AS val_by_time, COALESCE(@prev_timestamp, 0) AS prev_timestamp, @p</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> rev_timestamp := timestamp FROM data CROSS JOIN (SELECT @prev_timestamp :=</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> UNIX_TIMESTAMP(DATE_ADD(FROM_UNIXTIME(MAX(timestamp) / 1000, "%Y-%m-%d %H:%</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> i:00"), INTERVAL 1 minute)) * 1000 FROM aggregate WHERE type = ? AND aggreg</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> ate.channel_id = ?) AS vars WHERE channel_id = ? AND timestamp >= IFNULL((S</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> ELECT UNIX_TIMESTAMP(DATE_ADD(FROM_UNIXTIME(MAX(timestamp) / 1000, "%Y-%m-%</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> d %H:%i:00"), INTERVAL 1 minute)) * 1000 FROM aggregate WHERE type = ? AND</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> aggregate.channel_id = ? ), 0) AND timestamp < UNIX_TIMESTAMP(DATE_FORMAT(N</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> OW(), "%Y-%m-%d %H:%i:00")) * 1000 ) AS agg GROUP BY channel_id, YEAR(FROM_</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> UNIXTIME(timestamp/1000)), DAYOFYEAR(FROM_UNIXTIME(timestamp/1000)), HOUR(F</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> ROM_UNIXTIME(timestamp/1000)), MINUTE(FROM_UNIXTIME(timestamp/1000))' with</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> params [1, 1, "1", "1", 1, "1"]:</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> SQLSTATE[22012]: Division by zero: 1365 Division by 0</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">In PDOStatement.php line 119:</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> SQLSTATE[22012]: Division by zero: 1365 Division by 0</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">In PDOStatement.php line 117:</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> SQLSTATE[22012]: Division by zero: 1365 Division by 0</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">run [-l|--level LEVEL] [-m|--mode MODE] [-p|--periods PERIODS] [-v|--verbose] [--] [<uuid>...]</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Das ist erstmal die Ausgangssituation.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Wenn ich jetzt aber so über die Sinnhaftigkeit der aggtime nachdenke, macht es dann nicht eher Sinn mit den Gesamtzählerständen zu arbeiten? Mein Ziel ist es jedenfalls den momentanen Verbrauch (also die Differenz zweier Gesamtstände) darzustellen. Das hätte zumindest den Vorteil das mir kein Verbrauch flöten geht. Oder?</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Ich würde stand jetzt erstmal den Intervall bei den Leistungswerten deaktivieren, wenn ich das richtig verstanden habe.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">LG</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; border: none; padding: 0cm;" class=""><b class="">Von:<span class="Apple-converted-space"> </span></b><a href="mailto:vz@jahp.de" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">Daniel Lauckner</a><br class=""><b class="">Gesendet:<span class="Apple-converted-space"> </span></b>Samstag, 15. Juni 2019 08:25<br class=""><b class="">An:<span class="Apple-converted-space"> </span></b><a href="mailto:volkszaehler-users@demo.volkszaehler.org" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">volkszaehler.org - users</a><br class=""><b class="">Betreff:<span class="Apple-converted-space"> </span></b>Re: [vz-users] SQLSTATE[22012]: Division by zero</div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hallo,</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">am Samstag, 15. Juni 2019 um 04:30 hat René W. geschrieben:</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">> ich erhalte eine SQL Fehlermeldung „SQLSTATE[22012]: Division by Zero“.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Details?</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">> Ich vermute sehr stark das es an den aggtime und interval</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">> liegt.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Glaube ich ehrlich gesagt nicht.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">> Kann da bitte jemand mal auf meine conf schauen?</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Jupp, kann ja nix schaden.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">> Welche Werte würden denn dort sonst Sinn machen?</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Bei d0-Zählern stellt sich eigentlich die Frage: Entweder/Oder</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Es ergibt keine Sinn den Zähler(stand) mehrfach abzufragen nur um</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">dann die Werte zu aggregieren. Es genügt die Anwendung von Intervall.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Bei Leistungswerten muss man aber jeden verfügbaren Wert abgreifen um</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">einen möglichst aussgekräftigen Mittelwert zu erhalten. Da würde man</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">auch bei einem D0-Zähler auf Aggregation zurückgreifen. Aber ohne</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Intervall.</div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">mfg Daniel</div></div></div></blockquote></div><br class=""></div></body></html>