[vz-users] volkszaehler image -> MQTT

Sven E. sven at ellner.eu
Mon Apr 22 09:32:48 CEST 2019


Hallo Andreas,

habe genau die beiden Schritte ausgeführt; danach auch mal einen Reboot 
probiert... das Image ist nahezu unverändert; habe nur einen Restore der 
DB gemacht.

hier noch gewünschten Infos:

pi at powerPI:~ $ wget --no-check-certificate 
https://raw.github.com/volkszaehler/vzlogger/master/install.sh
--2019-04-22 09:18:59-- 
https://raw.github.com/volkszaehler/vzlogger/master/install.sh
Resolving raw.github.com (raw.github.com)... 151.101.112.133
Connecting to raw.github.com (raw.github.com)|151.101.112.133|:443... 
connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: 
https://raw.githubusercontent.com/volkszaehler/vzlogger/master/install.sh 
[following]
--2019-04-22 09:18:59-- 
https://raw.githubusercontent.com/volkszaehler/vzlogger/master/install.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 
151.101.112.133
Connecting to raw.githubusercontent.com 
(raw.githubusercontent.com)|151.101.112.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6616 (6.5K) [text/plain]
Saving to: ‘install.sh.2’

install.sh.2 
100%[======================================================>] 6.46K  
--.-KB/s    in 0.001s

2019-04-22 09:18:59 (6.76 MB/s) - ‘install.sh.2’ saved [6616/6616]

pi at powerPI:~ $ sudo bash install.sh
volkszaehler.org installation script

checking prerequisites: php: /usr/bin/php
  mysql: /usr/bin/mysql
  awk: /usr/bin/awk
  sed: /bin/sed
  grep: /bin/grep
  wget: /usr/bin/wget
  mktemp: /bin/mktemp
  mkdir: /bin/mkdir
  git: /usr/bin/git

checking php version: 7.3.4-2 >= 7.1, ok

volkszaehler setup...
volkszaehler path? [/root/volkszaehler.org] //home/pi
//home/pi already exists. Remove it and get new git clone? (you have to 
type 'Yes' to do this!) [n] ^C
pi at powerPI:~ $ sudo bash install.sh
volkszaehler.org installation script

checking prerequisites: php: /usr/bin/php
  mysql: /usr/bin/mysql
  awk: /usr/bin/awk
  sed: /bin/sed
  grep: /bin/grep
  wget: /usr/bin/wget
  mktemp: /bin/mktemp
  mkdir: /bin/mkdir
  git: /usr/bin/git

checking php version: 7.3.4-2 >= 7.1, ok

volkszaehler setup...
volkszaehler path? [/root/volkszaehler.org]
git clone volkszaehler.org into /root/volkszaehler.org
Cloning into '/root/volkszaehler.org'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 12064 (delta 2), reused 5 (delta 1), pack-reused 12053
Receiving objects: 100% (12064/12064), 7.55 MiB | 2.53 MiB/s, done.
Resolving deltas: 100% (6818/6818), done.
link from webserver to volkszaehler directory? [/var/www/volkszaehler.org]
/var/www/volkszaehler.org symlink already exists. Remove it? (you have 
to type 'Yes' to do this!) [n] Yes
linking /var/www/volkszaehler.org to /root/volkszaehler.org

checking composer...
composer: /usr/local/bin/composer

installing dependencies...
~/volkszaehler.org /home/pi
Do not run Composer as root/super user! See https://getcomposer.org/root 
for details
Loading composer repositories with package information
Updating dependencies
Package operations: 51 installs, 0 updates, 0 removals
   - Installing symfony/routing (v4.2.7): Loading from cache
   - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
   - Installing symfony/http-foundation (v4.2.7): Loading from cache
   - Installing ralouphie/getallheaders (2.0.5): Loading from cache
   - Installing psr/http-message (1.0.1): Loading from cache
   - Installing guzzlehttp/psr7 (1.5.2): Loading from cache
   - Installing react/promise (v2.7.1): Loading from cache
   - Installing react/event-loop (v1.1.0): Loading from cache
   - Installing react/promise-timer (v1.5.1): Loading from cache
   - Installing evenement/evenement (v3.0.1): Loading from cache
   - Installing react/stream (v1.1.0): Loading from cache
   - Installing react/cache (v0.5.0): Loading from cache
   - Installing react/dns (v0.4.17): Loading from cache
   - Installing react/socket (v1.2.0): Loading from cache
   - Installing ratchet/rfc6455 (v0.2.5): Loading from cache
   - Installing cboden/ratchet (v0.4.1): Loading from cache
   - Installing symfony/contracts (v1.0.2): Loading from cache
   - Installing symfony/console (v4.2.7): Loading from cache
   - Installing doctrine/instantiator (1.2.0): Loading from cache
   - Installing doctrine/event-manager (v1.0.0): Loading from cache
   - Installing doctrine/cache (v1.8.0): Loading from cache
   - Installing doctrine/dbal (v2.9.2): Loading from cache
   - Installing doctrine/lexer (v1.0.1): Loading from cache
   - Installing doctrine/annotations (v1.6.1): Loading from cache
   - Installing doctrine/reflection (v1.0.0): Loading from cache
   - Installing doctrine/collections (v1.6.1): Loading from cache
   - Installing doctrine/persistence (v1.1.0): Loading from cache
   - Installing doctrine/inflector (v1.3.0): Loading from cache
   - Installing doctrine/common (v2.10.0): Loading from cache
   - Installing doctrine/orm (v2.6.3): Loading from cache
   - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
   - Installing symfony/yaml (v4.2.7): Loading from cache
   - Installing guzzlehttp/promises (v1.3.1): Loading from cache
   - Installing guzzlehttp/guzzle (6.3.3): Loading from cache
   - Installing influxdb/influxdb-php (1.14.7): Loading from cache
   - Installing symfony/event-dispatcher (v4.2.7): Loading from cache
   - Installing andig/dbcopy (1.3.3): Loading from cache
   - Installing andig/php-shunting-yard (1.0.2): Loading from cache
   - Installing react/promise-stream (v1.1.1): Loading from cache
   - Installing ringcentral/psr7 (1.2.2): Loading from cache
   - Installing react/http (v0.8.4): Loading from cache
   - Installing psr/log (1.1.0): Loading from cache
   - Installing symfony/debug (v4.2.7): Loading from cache
   - Installing symfony/http-kernel (v4.2.7): Loading from cache
   - Installing psr/http-server-handler (1.0.1): Loading from cache
   - Installing monolog/monolog (1.24.0): Loading from cache
   - Installing react/child-process (v0.6.1): Loading from cache
   - Installing symfony/process (v4.2.7): Loading from cache
   - Installing php-pm/php-pm (2.0): Loading from cache
   - Installing php-pm/httpkernel-adapter (2.0.1): Loading from cache
   - Installing webpatser/laravel-uuid (3.0.2): Loading from cache
Writing lock file
Generating autoload files
/home/pi

volkszaehler.org is not configured yet. creating new config from sample 
config file.
mysql root user? [root]
mysql root password? []
mysql database? [volkszaehler]
mysql admin to volkszaehler database? [vz-admin]
mysql admin password? []
mysql user? [vz]
mysql password? [demo]

create volkszaehler.org database and admin user? [y] n

create volkszaehler.org database user? [y] n

allow channel deletion? [n] n

insert demo data in to database? [n] n
pi at powerPI:~ $

pi at powerPI:~ $ sudo reboot now


- Screenshot der Browserkonsole

- Ausgabe tail /var/log/httpd/error.log (oder apache/ ?)

pi at powerPI:/var/log/nginx $ tail error.log
2019/04/22 07:54:56 [error] 456#456: *12 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET / HTTP/1.1", upstream: "http://[::1]:8080/", 
host: "powerpi"
2019/04/22 07:54:56 [error] 456#456: *12 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET /favicon.ico HTTP/1.1", upstream: 
"http://[::1]:8080/favicon.ico", host: "powerpi", referrer: 
"http://powerpi/"
2019/04/22 07:54:56 [error] 456#456: *12 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET / HTTP/1.1", upstream: "http://[::1]:8080/", 
host: "powerpi"
2019/04/22 07:54:56 [error] 456#456: *12 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET /favicon.ico HTTP/1.1", upstream: 
"http://[::1]:8080/favicon.ico", host: "powerpi", referrer: 
"http://powerpi/"
2019/04/22 07:54:57 [error] 456#456: *12 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET / HTTP/1.1", upstream: "http://[::1]:8080/", 
host: "powerpi"
2019/04/22 07:54:57 [error] 456#456: *12 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET /favicon.ico HTTP/1.1", upstream: 
"http://[::1]:8080/favicon.ico", host: "powerpi", referrer: 
"http://powerpi/"
2019/04/22 09:23:54 [error] 475#475: *1 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET / HTTP/1.1", upstream: "http://[::1]:8080/", 
host: "powerpi"
2019/04/22 09:23:54 [error] 475#475: *1 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET /favicon.ico HTTP/1.1", upstream: 
"http://[::1]:8080/favicon.ico", host: "powerpi", referrer: 
"http://powerpi/"
2019/04/22 09:23:56 [error] 475#475: *1 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET / HTTP/1.1", upstream: "http://[::1]:8080/", 
host: "powerpi"
2019/04/22 09:23:56 [error] 475#475: *1 connect() failed (111: 
Connection refused) while connecting to upstream, client: 192.168.11.21, 
server: , request: "GET /favicon.ico HTTP/1.1", upstream: 
"http://[::1]:8080/favicon.ico", host: "powerpi", referrer: 
"http://powerpi/"

- Ausgabe php -v
pi at powerPI:/var/log/nginx $ php -v
PHP 7.3.4-2 (cli) (built: Apr 13 2019 19:05:48) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies
     with Zend OPcache v7.3.4-2, Copyright (c) 1999-2018, by Zend 
Technologies

- Ausgabe git log
pi at powerPI:~/volkszaehler.org $ git log
commit ac590a45eef1508586e086a42d6b9412a3f9f232 (HEAD -> master, 
origin/master, origin/HEAD)
Author: andig <cpuidle at gmx.de>
Date:   Fri Apr 5 19:57:31 2019 +0200

     Fix missing config file for docker

commit 07deff71429e5ca6eb5199c5d88a969091855037
Author: andig <cpuidle at gmx.de>
Date:   Thu Apr 4 19:18:43 2019 +0200

     Upgrade dependencies (#755)

commit 0789ac3674c313b55886ffac809a2c6e0be85ade
Author: andig <cpuidle at gmx.de>
Date:   Thu Apr 4 17:36:34 2019 +0200

     Improve sanity checks (#757)

commit f9a4a9161541bb724a05aa59688b45c16aff4817
Author: andig <cpuidle at gmx.de>
Date:   Thu Apr 4 10:45:54 2019 +0200

     Fix isset not working on magic interpreter properties (#756)

commit 11fe1143bc5c62be65a1fc117267c09715e827e0
Author: andig <cpuidle at gmx.de>
Date:   Tue Apr 2 20:21:22 2019 +0200

     Add sanity checks for invalid options.js or middleware uri (#754)

commit 32d25c2d26ccc77c240dbbba14c3196147e5ffda
Merge: 877a97f ca941d0
Author: Jakob Hirsch <jahir at users.noreply.github.com>
Date:   Mon Apr 1 12:25:20 2019 +0200

     Merge pull request #753 from jahir/atom

     added Atom view

commit ca941d0921e96dccf8cb7a859691f2ddd7fe3ed5
Author: Jakob Hirsch <jh.github at plonk.de>
Date:   Thu Mar 28 16:06:21 2019 +0100

     added Atom view

     this can be used e.g. to read power or consumption with your FRITZ!Fon.
     Examples:
     * current power: /api/data/UUID.atom
     * todays consumption: /api/data/UUID.atom?from=midnight&to=now&tuples=1
     * multiple channels: 
/api/data.atom/uuid%5B%5D%=UUID1&uuid%5B%5D%=UUID2&...
       (you have to use %5B%5D% instead of [] in your FRITZ!Box web 
interface)
     * consumption grouped by hour/day/...:
/api/data/UUID.atom?from=midnight&to=now&group=hour&options=consumption

     This could be extended to show some kind of overview (current power,
     consumption last hour and today), but there's now api syntax

     Atom output was validated by https://validator.w3.org/feed/

commit 877a97f3e973d8b040844452dc56ccc185a077e5
Author: andig <cpuidle at gmx.de>
Date:   Fri Mar 29 22:11:36 2019 +0100

     Add dbcopy.dist.yaml

commit 12b3f6ea6bb926394b2175d4113c9b7eb919b4e1
Author: andig <cpuidle at gmx.de>
Date:   Fri Mar 29 19:46:46 2019 +0100

     Let middleware speedup queries when desired tuple count is 
specified (#740)

commit 2008ff883962c08025e8240a3b50243a2b0ccc7f
Author: andig <cpuidle at gmx.de>
Date:   Fri Mar 29 15:26:22 2019 +0100

     Re-build flot

commit a423ce2876aa20bd541c2544d7d2730f09c361cb
Merge: 4231f6e df27e17
:

- Ausgabe composer update
pi at powerPI:~/volkszaehler.org $ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 29 installs, 9 updates, 0 removals
   - Updating symfony/console (v4.2.5 => v4.2.7): Downloading (100%)
   - Updating symfony/debug (v4.2.5 => v4.2.7): Downloading (100%)
   - Updating symfony/http-foundation (v4.2.5 => v4.2.7): Downloading (100%)
   - Updating symfony/event-dispatcher (v4.2.5 => v4.2.7): Downloading 
(100%)
   - Updating symfony/http-kernel (v4.2.5 => v4.2.7): Downloading (100%)
   - Updating symfony/routing (v4.2.5 => v4.2.7): Downloading (100%)
   - Updating symfony/yaml (v4.2.5 => v4.2.7): Loading from cache
   - Updating ratchet/rfc6455 (0.2.4 => v0.2.5): Downloading (100%)
   - Updating symfony/process (v4.2.5 => v4.2.7): Downloading (100%)
   - Installing sebastian/version (2.0.1): Downloading (100%)
   - Installing sebastian/resource-operations (2.0.1): Downloading (100%)
   - Installing sebastian/recursion-context (3.0.0): Downloading (100%)
   - Installing sebastian/object-reflector (1.1.1): Downloading (100%)
   - Installing sebastian/object-enumerator (3.0.3): Downloading (100%)
   - Installing sebastian/global-state (2.0.0): Downloading (100%)
   - Installing sebastian/exporter (3.1.0): Downloading (100%)
   - Installing sebastian/environment (4.1.0): Downloading (100%)
   - Installing sebastian/diff (3.0.2): Downloading (100%)
   - Installing sebastian/comparator (3.0.2): Downloading (100%)
   - Installing phpunit/php-timer (2.1.1): Downloading (100%)
   - Installing phpunit/php-text-template (1.2.1): Downloading (100%)
   - Installing phpunit/php-file-iterator (2.0.2): Downloading (100%)
   - Installing theseer/tokenizer (1.1.2): Downloading (100%)
   - Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading 
(100%)
   - Installing phpunit/php-token-stream (3.0.1): Downloading (100%)
   - Installing phpunit/php-code-coverage (6.1.4): Downloading (100%)
   - Installing webmozart/assert (1.4.0): Downloading (100%)
   - Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)
   - Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)
   - Installing phpdocumentor/reflection-docblock (4.3.0): Downloading 
(100%)
   - Installing phpspec/prophecy (1.8.0): Downloading (100%)
   - Installing phar-io/version (2.0.1): Downloading (100%)
   - Installing phar-io/manifest (1.0.3): Downloading (100%)
   - Installing myclabs/deep-copy (1.9.1): Downloading (100%)
   - Installing phpunit/phpunit (7.5.9): Downloading (100%)
   - Installing symfony/psr-http-message-bridge (v1.2.0): Downloading (100%)
   - Installing zendframework/zend-diactoros (1.8.6): Downloading (100%)
   - Installing jdorn/sql-formatter (v1.2.17): Downloading (100%)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.6.0)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
phpunit/phpunit suggests installing ext-soap (*)
phpunit/phpunit suggests installing ext-xdebug (*)
symfony/psr-http-message-bridge suggests installing nyholm/psr7 (For a 
super lightweight PSR-7/17 implementation)
Writing lock file
Generating autoload files
pi at powerPI:~/volkszaehler.org $

- /etc/httpd.conf (richtige Datei?)
pi at powerPI:/etc/nginx $ cat nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
         worker_connections 768;
         # multi_accept on;
}

http {

         ##
         # Basic Settings
         ##

         sendfile on;
         tcp_nopush on;
         tcp_nodelay on;
         keepalive_timeout 65;
         types_hash_max_size 2048;
         # server_tokens off;

         # server_names_hash_bucket_size 64;
         # server_name_in_redirect off;

         include /etc/nginx/mime.types;
         default_type application/octet-stream;

         ##
         # SSL Settings
         ##

         ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
         ssl_prefer_server_ciphers on;

         ##
         # Logging Settings
         ##

         access_log /var/log/nginx/access.log;
         error_log /var/log/nginx/error.log;

         ##
         # Gzip Settings
         ##

         gzip on;

         # gzip_vary on;
         # gzip_proxied any;
         # gzip_comp_level 6;
         # gzip_buffers 16 8k;
         # gzip_http_version 1.1;
         # gzip_types text/plain text/css application/json 
application/javascript text/xml application/xml application/xml+rss 
text/javascript;

         ##
         # Virtual Host Configs
         ##

         include /etc/nginx/conf.d/*.conf;
         include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}


- falls modifiziert: js/options.js
-> nichts geändert

Am 22.04.2019 um 09:17 schrieb Andreas Goetz:
> Hi Sven,
>
> danke :)
>
> Soweit ich sehe gibts da nur 2 Schritte:
>
> If you want to use MQTT support: sudo apt-get install libmosquitto-dev
>
> Then run the installation:
>
> |wget --no-check-certificate 
> https://raw.github.com/volkszaehler/vzlogger/master/install.sh sudo 
> bash install.sh|
>
> die *können* nichts mit dem Frontend zu tun haben. Was hast Du also 
> konkret gemacht? Genau diese und nicht Anderes?
>
> Bzgl. geschrottetem Frontend die gleichen Fragen wie immer:
>
> - Screenshot der Browserkonsole
> - Ausgabe tail /var/log/httpd/error.log (oder apache/ ?)
> - Ausgabe php -v
> - Ausgabe git log
> - Ausgabe composer update
> - /etc/httpd.conf (richtige Datei?)
> - falls modifiziert: js/options.js
>
> Viele Grüße,
> Andreas
>
>
>> On 22. Apr 2019, at 09:14, Sven E. <sven at ellner.eu 
>> <mailto:sven at ellner.eu>> wrote:
>>
>> Hallo,
>>
>> scheinbar ist bei dem volkszaehler image MQTT nicht standardmäßig 
>> aktiviert...
>>
>> Ignoring invalid field or type: mqtt={ "enabled": true, "host": 
>> "xxx", "port": 1883, "cafile": "", "capath": "", "certfile": "", 
>> "keyfile": "", "keypass": "", "keepalive": 30, "topic": 
>> "vzlogger\/data", "user": "xxx", "pass": "xxx", "retain": false, 
>> "timestamp": true, "rawAndAgg": false } (object)
>>
>> wäre es möglich das bei der nächsten Version zu aktivieren?
>>
>> die Anleitung zur Aktivierung von MQTT unter 
>> "https://github.com/volkszaehler/vzlogger" schrottet meine 
>> installation (danach erhalte ich nur noch "Bad Gateway" beim Aufruf 
>> der VZ URL)....
>>
>> VG
>> SVEN
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://demo.volkszaehler.org/pipermail/volkszaehler-users/attachments/20190422/f21fbc9c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fbmmpmdbcjijeceb.png
Type: image/png
Size: 27570 bytes
Desc: not available
URL: <http://demo.volkszaehler.org/pipermail/volkszaehler-users/attachments/20190422/f21fbc9c/attachment-0001.png>


More information about the volkszaehler-users mailing list