Auch gerne. Aber hier schon ein Hinweis: Die Installation war „Out Of The Box“. Keine Veränderungen, außer bei der .conf des Zählers. Der laufende Webserver scheint nginx zu sein. Ich grabe noch…
pi@vz:~/volkszaehler.org $ cat .htaccess # Apache 2.2 <IfModule !mod_authz_core.c> Deny from all Allow from localhost 127.0.0.1 </IfModule> # Apache 2.4 <IfModule mod_authz_core.c> Require local </IfModule> pi@vz:~/volkszaehler.org/htdocs $ cat .htaccess # allow access <IfModule mod_authz_core.c> Require all granted </IfModule> # disable negotiation to avoid rewrite rule conflicts <IfModule mod_negotiation.c> # Options -MultiViews </IfModule> # enable this rule if using ppm middleware <IfModule mod_proxy.c> # RewriteEngine On # RewriteRule ^middleware(.php)?(/.*)? http://localhost:8080$2 [P] # RewriteRule ^api(/.*)? http://localhost:8080$1 [P] </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(?:middleware|api)(/.*)? middleware.php$1 [L] # frontend alias RewriteRule ^frontend/(.*) $1 [L] </IfModule> <IfModule mod_headers.c> Header set Content-Security-Policy "default-src 'self'; connect-src * ws: wss: http: https:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;" </IfModule> Von: volkszaehler-users <volkszaehler-users-boun...@demo.volkszaehler.org> Im Auftrag von Andreas Goetz Gesendet: Montag, 20. April 2020 09:40 An: volkszaehler.org - users <volkszaehler-users@demo.volkszaehler.org> Betreff: Re: [vz-users] Anfängerfrage Ich glaube wir müssen da auch nicht raten sondern nachlesen: - welchen Webserver hast Du (nginx oder apache?)- bitte konfigurationsdatei(n) zeigen - wie sieht Deine Volkszähler .htaccess Datei im Volkszähler Root und im htdocs Verzeichnis aus? - was steht in Deiner options.js? Ist sicher schöner wenn wir das sauber herleiten. Viele Grüße, Andreas Am 19.04.2020 um 23:46 schrieb Maik Weidemann <m+vz@weidemann.online<mailto:m+vz@weidemann.online>>: Hallo Karl-Otto, poste doch mal das Ergebnis von diesem Kommando: sudo netstat -lp --inet Gruß Maik Am 19.04.20 um 23:05 schrieb Karl-Otto Feger: Hallo Maik, leider gleicher Effekt. Localhost ist nicht erreichbar: pi@vz:~ $ wget -o haus1.txt http://localhost:8080/api pi@vz:~ $ cat haus1.txt --2020-04-19 23:02:44-- http://localhost:8080/api Auflösen des Hostnamens localhost (localhost)… ::1, 127.0.0.1 Verbindungsaufbau zu localhost (localhost)|::1|:8080 … fehlgeschlagen: Verbindungsaufbau abgelehnt. Verbindungsaufbau zu localhost (localhost)|127.0.0.1|:8080 … verbunden. HTTP-Anforderung gesendet, auf Antwort wird gewartet … 400 Bad Request 2020-04-19 23:02:44 FEHLER 400: Bad Request. Von: volkszaehler-users <volkszaehler-users-boun...@demo.volkszaehler.org><mailto:volkszaehler-users-boun...@demo.volkszaehler.org> Im Auftrag von Maik Weidemann Gesendet: Sonntag, 19. April 2020 22:23 An: volkszaehler-users@demo.volkszaehler.org<mailto:volkszaehler-users@demo.volkszaehler.org> Betreff: Re: [vz-users] Anfängerfrage Hallo Karl-Otto, wenn du versuchst das Frontend zu erreichen benutzt du den Port 8080 und nicht den Standardport 80. Du müsstest dann ggf. http://localhost:8080/api benutzten. Gruß Maik Am 19.04.20 um 22:09 schrieb Karl-Otto Feger: Das sagt wget und Du hast recht: pi@vz:~ $ wget -o haus1.txt http://localhost/api pi@vz:~ $ cat haus1.txt --2020-04-19 22:07:35-- http://localhost/api Auflösen des Hostnamens localhost (localhost)… ::1, 127.0.0.1 Verbindungsaufbau zu localhost (localhost)|::1|:80 … verbunden. HTTP-Anforderung gesendet, auf Antwort wird gewartet … 404 Not Found 2020-04-19 22:07:35 FEHLER 404: Not Found. Von: volkszaehler-users <volkszaehler-users-boun...@demo.volkszaehler.org><mailto:volkszaehler-users-boun...@demo.volkszaehler.org> Im Auftrag von Andreas Goetz Gesendet: Sonntag, 19. April 2020 21:58 An: volkszaehler.org - users <volkszaehler-users@demo.volkszaehler.org><mailto:volkszaehler-users@demo.volkszaehler.org> Betreff: Re: [vz-users] Anfängerfrage …das sagt allerdings nichts darüber ob es lokal unter "http://localhost/api” erreichbar ist. Laut Logfile ja anscheinend nicht?! Viele Grüße, Andreas On 19. Apr 2020, at 21:56, Karl-Otto Feger <karl-otto.fe...@smuldom.de<mailto:karl-otto.fe...@smuldom.de>> wrote: Da ich den RasPi headless betreibe kann ich nur aus meinem Netzwerk drauf. Daher: Antwort von 192.168.100.179:8080/api ist „{"version":"0.3","exception":{"message":"Missing format","type":"Exception","code":0}}“ Also ja, erreichbar. Gruß ottO Von: volkszaehler-users <volkszaehler-users-boun...@demo.volkszaehler.org<mailto:volkszaehler-users-boun...@demo.volkszaehler.org>> Im Auftrag von Andreas Goetz Gesendet: Sonntag, 19. April 2020 21:37 An: volkszaehler.org<http://volkszaehler.org> - users <volkszaehler-users@demo.volkszaehler.org<mailto:volkszaehler-users@demo.volkszaehler.org>> Betreff: Re: [vz-users] Anfängerfrage Öffne mal localhost/api im Browser- geht das? Geht es ohne /api? Viele Grüße, Andreas On 19. Apr 2020, at 21:22, Karl-Otto Feger <karl-otto.fe...@smuldom.de<mailto:karl-otto.fe...@smuldom.de>> wrote: Hallo Alle, ich habe die ersten Schritte mit VZ gemacht und das RasPi-Image (7.7.2019) benutzt. Damit läuft vzlogger 0.8.0, das Frontend funktioniert. Mein Zähler liefert sml mit den ObisIDs 1.8.0, 1.8.1, 1.8.2 … und, der interessiert mich zuerst, 16.7.0. Im log stehen folgende Daten (Auszug): … [Apr 19 20:50:15][mtr0] Got 7 new readings from meter: [Apr 19 20:50:15][mtr0] Reading: id=1-0:1.8.0*255/ObisIdentifier:1-0:1.8.0*255 value=796802.80 ts=2797728000 [Apr 19 20:50:15][mtr0] Reading: id=1-0:1.8.1*255/ObisIdentifier:1-0:1.8.1*255 value=433872.20 ts=2797728000 [Apr 19 20:50:15][mtr0] Reading: id=1-0:1.8.2*255/ObisIdentifier:1-0:1.8.2*255 value=362930.60 ts=2797728000 [Apr 19 20:50:15][mtr0] Reading: id=1-0:2.8.0*255/ObisIdentifier:1-0:2.8.0*255 value=0.00 ts=2797728000 [Apr 19 20:50:15][mtr0] Reading: id=1-0:2.8.1*255/ObisIdentifier:1-0:2.8.1*255 value=0.00 ts=2797728000 [Apr 19 20:50:15][mtr0] Reading: id=1-0:2.8.2*255/ObisIdentifier:1-0:2.8.2*255 value=0.00 ts=2797728000 [Apr 19 20:50:15][mtr0] Reading: id=1-0:16.7.0*255/ObisIdentifier:1-0:16.7.0*255 value=1234.00 ts=1587322215556 [Apr 19 20:50:15][chn0] Adding reading to queue (value=1234.00 ts=1587322215556) [Apr 19 20:50:15][MAX] 1234.000000 @ 1587322215556 [Apr 19 20:50:15][MAX] RESULT 1234.000000 @ 1587322215556 [Apr 19 20:50:15][chn0] ==> number of tuples: 1 … Der eintrag „RESULT“ sagt mir (glaube ich..), dass meine .conf das macht, was ich möchte. Allerdings tauchen die Daten nicht im Frontend auf, denn auch im Log steht folgende Fehlermeldung: … [Apr 19 20:50:15][chn0] CURL: Received '<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>404 Not Found</title> </head> <body> <h1>404 Not Found</h1> </body> </html> ' bytes [Apr 19 20:50:15][chn0] CURL: Closing connection 11 [Apr 19 20:50:15][chn0] CURL Error from middleware: unexpected character [Apr 19 20:50:15][chn0] Waiting 0 secs for next request due to previous failure Ich habe keine Idee und auch nichts gefunden, was den Fehler aus der Middleware erklärt. Hier meine .conf: *************************************** { "retry": 0, "daemon": false, "verbosity": 15, "log": "/home/pi/haus1.log", "local": { "enabled": false, "port": 8080, "index": false, "timeout": 0, "buffer": 0 }, "meters" : [{ "protocol" : "sml", "enabled" : true, "device" : "/dev/lesekopf0", "parity" : "8N1", "baudrate" : 9600, "aggtime" : -1, "aggfixedinterval" : true, "channels": [{ "uuid" : "6a98c1a0-825b-11ea-b2ab-b5242325867d", "middleware" : "http://localhost/api", "identifier" : "1-0:16.7.0", "aggmode" : "MAX" }] } ] } ************************************************* Vielleicht eine dumme Frage. Wenn ja, dann verzeiht einem Anfänger. ottO