Ankündigung

Einklappen
Keine Ankündigung bisher.

Amazon Alexa Plugin

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Okay moment. Das war jetzt nicht genau das was ich wollte sorry, mein Fehler.

    Code:
    sudo dpkg -l | grep php
    sudo netstat -tulpen
    sudo ps aux | grep php

    Kommentar


      Code:
       [smarthome@SmartHomeNG ~]$ sudo dpkg -l | grep php
      ii  libapache2-mod-php7.0            7.0.19-1                          armhf        server-side, HTML-embedded scripting language (Apache 2 module)
      ii  libawl-php                       0.57-1                            all          Andrew's Web Libraries - PHP Utility Libraries
      ii  php-common                       1:49                              all          Common files for PHP packages
      ii  php-curl                         1:7.0+49                          all          CURL module for PHP [default]
      ii  php-mbstring                     1:7.0+49                          all          MBSTRING module for PHP [default]
      ii  php7.0                           7.0.19-1                          all          server-side, HTML-embedded scripting language (metapackage)
      ii  php7.0-cli                       7.0.19-1                          armhf        command-line interpreter for the PHP scripting language
      ii  php7.0-common                    7.0.19-1                          armhf        documentation, examples and common module for PHP
      ii  php7.0-curl                      7.0.19-1                          armhf        CURL module for PHP
      ii  php7.0-json                      7.0.19-1                          armhf        JSON module for PHP
      ii  php7.0-mbstring                  7.0.19-1                          armhf        MBSTRING module for PHP
      ii  php7.0-opcache                   7.0.19-1                          armhf        Zend OpCache module for PHP
      ii  php7.0-readline                  7.0.19-1                          armhf        readline module for PHP
      ii  php7.0-xml                       7.0.19-1                          armhf        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
      Code:
      [smarthome@SmartHomeNG ~]$ sudo netstat -tulpen
      Aktive Internetverbindungen (Nur Server)
      Proto Recv-Q Send-Q Local Address           Foreign Address         State       Benutzer   Inode      PID/Program name
      tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      1001       11051      477/python3
      tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      0          10888      470/smbd
      tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      0          7154       206/rpcbind
      tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          47790      7011/nginx: master
      tcp        0      0 0.0.0.0:2323            0.0.0.0:*               LISTEN      1001       11061      477/python3
      tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          10178      419/sshd
      tcp        0      0 0.0.0.0:2424            0.0.0.0:*               LISTEN      1001       11060      477/python3
      tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      0          10887      470/smbd
      tcp        0      0 192.168.1.13:8383       0.0.0.0:*               LISTEN      1001       11055      477/python3
      tcp6       0      0 :::139                  :::*                    LISTEN      0          10886      470/smbd
      tcp6       0      0 :::111                  :::*                    LISTEN      0          7161       206/rpcbind
      tcp6       0      0 :::22                   :::*                    LISTEN      0          10180      419/sshd
      tcp6       0      0 :::445                  :::*                    LISTEN      0          10885      470/smbd
      tcp6       0      0 :::6720                 :::*                    LISTEN      0          7345       1/init
      udp        0      0 192.168.1.255:137       0.0.0.0:*                           0          10476      445/nmbd
      udp        0      0 192.168.1.13:137        0.0.0.0:*                           0          10475      445/nmbd
      udp        0      0 0.0.0.0:137             0.0.0.0:*                           0          10465      445/nmbd
      udp        0      0 192.168.1.255:138       0.0.0.0:*                           0          10478      445/nmbd
      udp        0      0 192.168.1.13:138        0.0.0.0:*                           0          10477      445/nmbd
      udp        0      0 0.0.0.0:138             0.0.0.0:*                           0          10466      445/nmbd
      udp        0      0 0.0.0.0:36263           0.0.0.0:*                           108        7760       234/avahi-daemon: r
      udp        0      0 0.0.0.0:5353            0.0.0.0:*                           108        7758       234/avahi-daemon: r
      udp        0      0 0.0.0.0:806             0.0.0.0:*                           0          7153       206/rpcbind
      udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          9367       413/dhcpcd
      udp        0      0 0.0.0.0:3671            0.0.0.0:*                           109        10191      421/knxd
      udp        0      0 0.0.0.0:111             0.0.0.0:*                           0          7152       206/rpcbind
      udp        0      0 192.168.1.13:39541      0.0.0.0:*                           109        10187      421/knxd
      udp6       0      0 :::56238                :::*                                108        7761       234/avahi-daemon: r
      udp6       0      0 :::5353                 :::*                                108        7759       234/avahi-daemon: r
      udp6       0      0 :::806                  :::*                                0          7160       206/rpcbind
      udp6       0      0 :::111                  :::*                                0          7157       206/rpcbind
      Code:
      [smarthome@SmartHomeNG ~]$ sudo ps aux | grep php
      smartho+  7107  0.0  0.4   4764  1884 pts/0    S+   10:43   0:00 grep --color=auto php

      Kommentar


        Also ich kann mich auch täuschen aber ich sehe mal als erstes, dass bei dir kein Port 443 läuft und somit keine verbindung per https möglich ist. Außerdem hast du kein php-fpm installiert. Das habe ich aber glaube ich aus einem anderen Grund gemacht.

        Also solltest du mal die NGINX Logs darauf prüfen warum der Port 443 nicht gebunden wird. Hast du das in der aktuellen Config noch auskommentiert?

        Kommentar


          Ja, es war noch auskommentiert.

          Code:
          [smarthome@SmartHomeNG ~]$ sudo dpkg -l | grep php
          ii  libapache2-mod-php7.0            7.0.19-1                          armhf        server-side, HTML-embedded scripting language (Apache 2 module)
          ii  libawl-php                       0.57-1                            all          Andrew's Web Libraries - PHP Utility Libraries
          ii  php-common                       1:49                              all          Common files for PHP packages
          ii  php-curl                         1:7.0+49                          all          CURL module for PHP [default]
          ii  php-mbstring                     1:7.0+49                          all          MBSTRING module for PHP [default]
          ii  php7.0                           7.0.19-1                          all          server-side, HTML-embedded scripting language (metapackage)
          ii  php7.0-cli                       7.0.19-1                          armhf        command-line interpreter for the PHP scripting language
          ii  php7.0-common                    7.0.19-1                          armhf        documentation, examples and common module for PHP
          ii  php7.0-curl                      7.0.19-1                          armhf        CURL module for PHP
          ii  php7.0-json                      7.0.19-1                          armhf        JSON module for PHP
          ii  php7.0-mbstring                  7.0.19-1                          armhf        MBSTRING module for PHP
          ii  php7.0-opcache                   7.0.19-1                          armhf        Zend OpCache module for PHP
          ii  php7.0-readline                  7.0.19-1                          armhf        readline module for PHP
          ii  php7.0-xml                       7.0.19-1                          armhf        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
          Code:
          [smarthome@SmartHomeNG ~]$ sudo netstat -tulpen
          Aktive Internetverbindungen (Nur Server)
          Proto Recv-Q Send-Q Local Address           Foreign Address         State       Benutzer   Inode      PID/Program name
          tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      1001       11051      477/python3
          tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      0          10888      470/smbd
          tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      0          7154       206/rpcbind
          tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          49100      7201/nginx: master
          tcp        0      0 0.0.0.0:2323            0.0.0.0:*               LISTEN      1001       11061      477/python3
          tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          10178      419/sshd
          tcp        0      0 0.0.0.0:2424            0.0.0.0:*               LISTEN      1001       11060      477/python3
          tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      0          49101      7201/nginx: master
          tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      0          10887      470/smbd
          tcp        0      0 192.168.1.13:8383       0.0.0.0:*               LISTEN      1001       11055      477/python3
          tcp6       0      0 :::139                  :::*                    LISTEN      0          10886      470/smbd
          tcp6       0      0 :::111                  :::*                    LISTEN      0          7161       206/rpcbind
          tcp6       0      0 :::22                   :::*                    LISTEN      0          10180      419/sshd
          tcp6       0      0 :::445                  :::*                    LISTEN      0          10885      470/smbd
          tcp6       0      0 :::6720                 :::*                    LISTEN      0          7345       1/init
          udp        0      0 192.168.1.255:137       0.0.0.0:*                           0          10476      445/nmbd
          udp        0      0 192.168.1.13:137        0.0.0.0:*                           0          10475      445/nmbd
          udp        0      0 0.0.0.0:137             0.0.0.0:*                           0          10465      445/nmbd
          udp        0      0 192.168.1.255:138       0.0.0.0:*                           0          10478      445/nmbd
          udp        0      0 192.168.1.13:138        0.0.0.0:*                           0          10477      445/nmbd
          udp        0      0 0.0.0.0:138             0.0.0.0:*                           0          10466      445/nmbd
          udp        0      0 0.0.0.0:36263           0.0.0.0:*                           108        7760       234/avahi-daemon: r
          udp        0      0 0.0.0.0:5353            0.0.0.0:*                           108        7758       234/avahi-daemon: r
          udp        0      0 0.0.0.0:806             0.0.0.0:*                           0          7153       206/rpcbind
          udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          9367       413/dhcpcd
          udp        0      0 0.0.0.0:3671            0.0.0.0:*                           109        10191      421/knxd
          udp        0      0 0.0.0.0:111             0.0.0.0:*                           0          7152       206/rpcbind
          udp        0      0 192.168.1.13:39541      0.0.0.0:*                           109        10187      421/knxd
          udp6       0      0 :::56238                :::*                                108        7761       234/avahi-daemon: r
          udp6       0      0 :::5353                 :::*                                108        7759       234/avahi-daemon: r
          udp6       0      0 :::806                  :::*                                0          7160       206/rpcbind
          udp6       0      0 :::111                  :::*                                0          7157       206/rpcbind
          Code:
          [smarthome@SmartHomeNG ~]$ sudo ps aux | grep php
          smartho+  7227  1.0  0.4   4764  1932 pts/0    S+   10:54   0:00 grep --color=auto php

          Kommentar


            Und funktioniert der https Zugriff jetzt und wird in der Auth auch der Name Alexa angegeben oder nicht?

            Kommentar


              Beim Aufruf von xyz.spdns.eu kommt eine Authentifizierung.
              Nach Eingabe der Daten aus htpasswd kommt wieder eine Authentifizierung.
              Nach Eingabe der Daten aus htpasswd.alexa kommt "Error response. Error Code 501"

              Das passiert mit dieser config
              Code:
              # SSL-Redirect & LetsEncrypt Endpoint
              server {
                  listen 80 default_server;
              
                  # redirect every requested $host (any, even invalid ones) to its SSL URL
                  location / {
                      return 301 https://$host$request_uri;
                  }
              
                  # LetsEncrypt Endpoint
                  location /.well-known {
                    alias /var/www/html/.well-known;
                  }
              }
              
              # Sitemap
               server {
                 listen 443 ssl default_server;
              
                 access_log /var/log/nginx/sitemap.log combined;
                 auth_basic "smartvisu36.spdns.eu";
                 auth_basic_user_file /etc/nginx/htpasswd;
                 include /etc/nginx/include.d/common;
              
                 add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
              
                 location / {
                      root /var/www/html/sitemap;
                      index index.html;
                  }
               }
              
              # Alexa
               server {
                  listen 443 ssl;
                  server_name smartvisu36.spdns.eu;
                  access_log /var/log/nginx/alexa.log combined;
                  auth_basic "Alexa";
                  auth_basic_user_file /etc/nginx/htpasswd.alexa;
                  include /etc/nginx/include.d/common;
              
                  location / {
                      proxy_pass http://192.168.1.13:9000/;
                  proxy_set_header Host $host;
                      proxy_set_header X-Real-IP $remote_addr;
                      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  }
                }

              Kommentar


                PERFEKT! Das 501 willst du sehen. Das kommt weil du keine JSON Anfrage liefern kannst. Das tut aber deine Alexa, wenn du ihr was sagst. Suche mal in deiner Alexa App jetzt nach Devices.

                Kommentar


                  Ok, in der AWS Lambda weiß ich aber nicht so recht, welche Pfade wo hin gehören.
                  Code:
                  /*
                  You need to specify the following environmental variables in the lambda function:
                  - SMARTHOME_HOST
                          http://xyz.spdns.eu
                  - SMARTHOME_PORT
                          443 - endpoint must be https enabled!
                  - SMARTHOME_PATH
                          '/usr/local/'
                  - SMARTHOME_AUTH
                          'user:password'
                  */
                  So werden keine Geräte gefunden.
                  Und der Log
                  Code:
                   {   "errorMessage": "connect ECONNREFUSED 127.0.0.1:443",   "errorType": "Error",   "stackTrace": [     "Object.exports._errnoException (util.js:870:11)",     "exports._exceptionWithHostPort (util.js:893:20)",     "TCPConnectWrap.afterConnect [as oncomplete] (net.js:1062:14)"   ] }
                  Zuletzt geändert von Max2612; 21.09.2017, 10:30.

                  Kommentar


                    Der Pfad sollte in deinem Fall / sein.

                    Und sollte der Discovery in der App dann nicht gehen versuche mal den kompletten Abschnitt #Sitemap in der Config des nginx auszukommentieren, nicht aber den #Alexa abschnitt und nicht vergessen nginx neustarten danach.

                    Kommentar


                      Um sicher zu gehen...

                      smarthome host: /
                      smarthome port: 443 ohne den Text??
                      smarthome path: /usr/local/
                      smarthome auth: muss hier das hin, was in htpasswd.alexa steht?

                      Kommentar


                        Ne

                        smarthome host: deine.domain.de
                        smarthome port: 443
                        smarthome path: /
                        smarthome auth: benutzername:asswort

                        Benutzername und Passwort muss das aus der htpasswd.alexa sein.

                        Kommentar


                          Schade, Geräte werden keine gefunden. Und der Lambda Test sagt
                          Code:
                           START RequestId: 8696c5e6-9eb0-11e7-bd62-f3e4619bc011 Version: $LATEST 2017-09-21T09:37:47.555Z	8696c5e6-9eb0-11e7-bd62-f3e4619bc011	requesting {"header":{"payloadVersion":"2","namespace":"Alexa.ConnectedHome.Discovery","name":"DiscoverAppliancesRequest","messageId":"F8752B11-69BB-4246-B923-3BFB27C06C7D"},"payload":{"accessToken":"1"}} 2017-09-21T09:37:47.674Z	8696c5e6-9eb0-11e7-bd62-f3e4619bc011	request failed { [Error: connect ECONNREFUSED 127.0.0.1:443]   code: 'ECONNREFUSED',   errno: 'ECONNREFUSED',   syscall: 'connect',   address: '127.0.0.1',   port: 443 } 2017-09-21T09:37:48.253Z	8696c5e6-9eb0-11e7-bd62-f3e4619bc011	{"errorMessage":"connect ECONNREFUSED 127.0.0.1:443","errorType":"Error","stackTrace":["Object.exports._errnoException (util.js:870:11)","exports._exceptionWithHostPort (util.js:893:20)","TCPConnectWrap.afterConnect [as oncomplete] (net.js:1062:14)"]} END RequestId: 8696c5e6-9eb0-11e7-bd62-f3e4619bc011 REPORT RequestId: 8696c5e6-9eb0-11e7-bd62-f3e4619bc011	Duration: 1160.28 ms	Billed Duration: 1200 ms 	Memory Size: 128 MB	Max Memory Used: 24 MB

                          Kommentar


                            Okay. Hast du den Sitemap Part schon auskommentiert und den nginx neugestartet und dann das discovery nochmals versucht?
                            Was mich im AWS Log wundert ist, dass er der meinung ist bei 127.0.0.1 zu fragen. Das scheint seltsam.

                            Kommentar


                              Sitemap auskommentiert, nginx neu gestartet, Geräte gesucht. Leider kein Erfolg
                              Müssen die angaben in Lambda mit oder ohne ' gemacht werden?

                              Kommentar


                                Ohne aber auch an der richtigen Stelle. Nicht oben im Quelltext sondern, wenn du scrollst unten drunter:
                                screen.JPG

                                Kommentar

                                Lädt...
                                X