Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. Amazon Dash Adapter spinnt sich aus

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Amazon Dash Adapter spinnt sich aus

    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      denjo last edited by

      @msiemers:

      @Stabilostick:

      Um zu prüfen, ob das pcap Module korrekt funktioniert, kann die im Module mitgelieferte Bespieldatei „network_grep.js“ über die Kommandozeile ausgeführt werden. Diese Datei befindet sich z. B. im Ordner „node_modules“ unter pcap/examples/network_grep.js

      Beispiel Befehl:

      node /opt/iobroker/node_modules/pcap/examples/network_grep.js
      

      Hier sollte dann folgender Fehler NICHT mehr auftreten:

      /opt/iobroker/node_modules/pcap/pcap.js:49
              this.link_type = this.session.open_live(this.device_name, this.filter, this.buffer_size, this.outfile, packet_ready, this.is_monitor);
       
      Error: socket: Operation not permitted
          at new PcapSession (/opt/iobroker/node_modules/pcap/pcap.js:49:39)
          at Object.exports.createSession (/opt/iobroker/node_modules/pcap/pcap.js:123:12)
          at Object. <anonymous>(/opt/iobroker/node_modules/pcap/examples/network_grep.js:2:25)
          at Module._compile (module.js:571:32)
          at Object.Module._extensions..js (module.js:580:10)
          at Module.load (module.js:488:32)
          at tryModuleLoad (module.js:447:12)
          at Function.Module._load (module.js:439:3)
          at Module.runMain (module.js:605:10)
          at run (bootstrap_node.js:427:7)</anonymous>
      ````"
      
      Vollquote von [https://www.blogging-it.com/node-pcap-m … odejs.html](https://www.blogging-it.com/node-pcap-module-error-socket-operation-not-permitted-fehler-wenn-pcapsession-geoeffnet-wird/programmierung/javascript/nodejs.html)
      
      Danke, Markus. `  
      

      Was macht man denn wenn nach dem Befehl immer noch folgender Fehler kommt?

      TypeError: Cannot read property 'ip' of undefined
          at PcapSession. <anonymous>(/opt/iobroker/node_modules/pcap/examples/network_grep.js:9:28)
          at emitOne (events.js:116:13)
          at PcapSession.emit (events.js:211:7)
          at PcapSession.on_packet_ready (/opt/iobroker/node_modules/pcap/pcap.js:99:10)
          at packet_ready (/opt/iobroker/node_modules/pcap/pcap.js:44:14)
          at SocketWatcher.pcap_read_callback [as callback] (/opt/iobroker/node_modules/pcap/pcap.js:64:45)
      root@iobroker:/opt/iobroker#</anonymous> 
      

      Ich habe das gleiche Problem wie mein Vorredner. `

      schon eine lösung gefunden???

      1 Reply Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators last edited by

        Ich nutze den nicht.

        Aber in letzten Tagen häufen sich da Probleme

        Kennt ihr das:

        https://www.tagesschau.de/wirtschaft/am … n-103.html

        Gruß

        Rainer

        1 Reply Last reply Reply Quote 0
        • V
          vondefenn last edited by

          kann kaum an dem Urteil des Gerichtes liegen, dass die pcap auf einmal bzgl. Rechte spinnt 😉

          Sobald die Kommunikation des Dash-Buttons einmal nach Ersteinrichtung mit dem Internet unterbunden ist - ist Ama da raus 😉

          😛

          1 Reply Last reply Reply Quote 0
          • L
            ltsalvatore last edited by

            hi zusammen,

            eine frage vorab..

            sind die dash buttons, in naher zukunft hier in deutschland verboten und somit auch nicht mehr nutzbar?

            oder kann man diese dann zu hause weiterhin nutzen?

            ich vermute mal, dass wenn diese verboten werden, dann auch nicht mehr funktionieren werden, da keine verbindung mehr zu dem amazon server bestehen wird.

            sollte dies der fall sein, dann brauch ich auch keine lösung zu meinem anliegen und ich schmeiß das ding einfach ausm fenster.

            falls diese doch noch nutzbar sein sollten:

            ich bin gerade dabei mein iobroker von pi auf nuc umzustellen und installiere gerade auf das neue system alle adapter, die ich benötige.

            auf dem nuc ist proxmox inst. und auf diesen eine vm mit debian.

            jetzt bekomme ich bei der inst. des dash adapters folgende fehlermeldung:

            Fertig mit Fehler: host.shsrv Cannot install amazon-dash

            $ ./iobroker add amazon-dash  --host shsrv
            NPM version: 6.4.1
            npm install iobroker.amazon-dash --production --save --prefix "/opt/iobroker" (System call)
            
            WARNING: 
            apt
            
            does not have a stable CLI interface. 
            Use with caution in scripts.
            
            E
            : 
            Sperrdatei /var/lib/dpkg/lock konnte nicht geöffnet werden. - open (13: Keine Berechtigung)
            
            E
            : 
            Sperren des Administrationsverzeichnisses (/var/lib/dpkg/) nicht möglich, sind Sie root?
            
            ../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Callback(uv_poll_t*, int, int)’:../socket_watcher.cpp:77:60: warning: ‘v8::Local <v8::value>Nan::MakeCallback(v8::Local<v8::object>, v8::Local<v8::function>, int, v8::Local<v8::value>*)’ is deprecated [-Wdeprecated-declarations]
               Nan::MakeCallback(watcher->handle(), callback, argc, argv);
                                                                        ^
            
            In file included from ../socket_watcher.hpp:8:0,                 from ../socket_watcher.cpp:5:
            ../../nan/nan.h:959:46: note: declared here
               NAN_DEPRECATED inline v8::Local <v8::value>MakeCallback(
                                                          ^~~~~~~~~~~~
            
            ../pcap_binding.cc:2:23: fatal error: pcap/pcap.h: Datei oder Verzeichnis nicht gefunden #include <pcap pcap.h="">
                                   ^
            
            compilation terminated.
            make: *** [Release/obj.target/pcap_binding/pcap_binding.o] Fehler 1gyp ERR! build error 
            gyp ERR! stack Error: `make` failed with exit code: 2
            gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
            gyp ERR! stack     at emitTwo (events.js:126:13)
            gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
            gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
            gyp ERR! System Linux 4.9.0-8-amd64
            gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
            gyp ERR! cwd /opt/iobroker/node_modules/pcap
            gyp
             ERR! node -v v8.15.0gyp ERR! node-gyp -v v3.8.0
            gyp ERR! not ok 
            
            npm
            
            ERR!
            
            code
             ELIFECYCLE
            npm
            
            ERR!
            
            errno
             1
            npm
            
            ERR!
             pcap@2.1.0 install: `node-gyp rebuild`
            npm
            
            ERR!
             Exit status 1
            npm
             ERR! npm ERR!
             Failed at the pcap@2.1.0 install script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
            
            npm
            
            ERR!
             A complete log of this run can be found in:
            npm
            
            ERR!
                 /home/iobroker/.npm/_logs/2019-01-17T18_36_18_665Z-debug.log
            host.shsrv install adapter amazon-dash
            NPM version: 6.4.1npm install iobroker.amazon-dash --production --save --prefix "/opt/iobroker" (System call)
            
            WARNING: 
            apt
            
            does not have a stable CLI interface. 
            Use with caution in scripts.
            
            E
            : 
            Sperrdatei /var/lib/dpkg/lock konnte nicht geöffnet werden. - open (13: Keine Berechtigung)
            
            E
            : 
            Sperren des Administrationsverzeichnisses (/var/lib/dpkg/) nicht möglich, sind Sie root?
            
            ../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Callback(uv_poll_t*, int, int)’:../socket_watcher.cpp:77:60: warning: ‘v8::Local <v8::value>Nan::MakeCallback(v8::Local<v8::object>, v8::Local<v8::function>, int, v8::Local<v8::value>*)’ is deprecated [-Wdeprecated-declarations]
               Nan::MakeCallback(watcher->handle(), callback, argc, argv);
                                                                        ^
            
            In file included from ../socket_watcher.hpp:8:0,                 from ../socket_watcher.cpp:5:
            ../../nan/nan.h:959:46: note: declared here
               NAN_DEPRECATED inline v8::Local <v8::value>MakeCallback(
                                                          ^~~~~~~~~~~~
            
            ../pcap_binding.cc:2:23: fatal error: pcap/pcap.h: Datei oder Verzeichnis nicht gefunden #include <pcap pcap.h="">
                                   ^
            
            compilation terminated.
            make: *** [Release/obj.target/pcap_binding/pcap_binding.o] Fehler 1gyp ERR! build error 
            gyp ERR! stack Error: `make` failed with exit code: 2
            gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
            gyp ERR! stack     at emitTwo (events.js:126:13)
            gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
            gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
            gyp ERR! System Linux 4.9.0-8-amd64
            gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
            gyp ERR! cwd /opt/iobroker/node_modules/pcap
            gyp ERR! node -v v8.15.0
            gyp ERR! node-gyp -v v3.8.0
            gyp ERR! not ok 
            
            npm
            
            ERR!
            
            code
             ELIFECYCLE
            npm
            
            ERR!
            
            errno
             1
            npm
            
            ERR!
             pcap@2.1.0 install: `node-gyp rebuild`
            npm
            
            ERR!
             Exit status 1
            npm
             ERR! npm ERR! Failed at the pcap@2.1.0 install script.
            
            npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
            
            npm
            
            ERR!
             A complete log of this run can be found in:
            npm
            
            ERR!
                 /home/iobroker/.npm/_logs/2019-01-17T18_36_26_041Z-debug.log
            host.shsrv install adapter amazon-dash
            NPM version: 6.4.1npm install iobroker.amazon-dash --production --save --prefix "/opt/iobroker" (System call)
            
            WARNING: 
            apt
            
            does not have a stable CLI interface. 
            Use with caution in scripts.
            
            E
            : 
            Sperrdatei /var/lib/dpkg/lock konnte nicht geöffnet werden. - open (13: Keine Berechtigung)
            
            E
            : 
            Sperren des Administrationsverzeichnisses (/var/lib/dpkg/) nicht möglich, sind Sie root?
            
            ../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Callback(uv_poll_t*, int, int)’:../socket_watcher.cpp:77:60: warning: ‘v8::Local <v8::value>Nan::MakeCallback(v8::Local<v8::object>, v8::Local<v8::function>, int, v8::Local<v8::value>*)’ is deprecated [-Wdeprecated-declarations]
               Nan::MakeCallback(watcher->handle(), callback, argc, argv);
                                                                        ^
            
            In file included from ../socket_watcher.hpp:8:0,                 from ../socket_watcher.cpp:5:
            ../../nan/nan.h:959:46: note: declared here
               NAN_DEPRECATED inline v8::Local <v8::value>MakeCallback(
                                                          ^~~~~~~~~~~~
            
            ../pcap_binding.cc:2:23: fatal error: pcap/pcap.h: Datei oder Verzeichnis nicht gefunden #include <pcap pcap.h="">
                                   ^
            
            compilation terminated.
            make: *** [Release/obj.target/pcap_binding/pcap_binding.o] Fehler 1gyp ERR! build error 
            gyp ERR! stack Error: `make` failed with exit code: 2
            gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
            gyp ERR! stack     at emitTwo (events.js:126:13)
            gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
            gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
            gyp ERR! System Linux 4.9.0-8-amd64
            gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
            gyp ERR! cwd /opt/iobroker/node_modules/pcap
            gyp ERR! node -v v8.15.0
            gyp ERR! node-gyp -v v3.8.0
            
            gyp
            
            ERR!
            
            not ok
            
            npm
            
            ERR!
            
            code
             ELIFECYCLE
            npm
            
            ERR!
            
            errno
             1
            npm
            
            ERR!
             pcap@2.1.0 install: `node-gyp rebuild`
            npm ERR! Exit status 1npm
             ERR! npm
             ERR! Failed at the pcap@2.1.0 install script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
            
            npm
            
            ERR!
             A complete log of this run can be found in:
            npm
            
            ERR!
                 /home/iobroker/.npm/_logs/2019-01-17T18_36_33_546Z-debug.log
            host.shsrv install adapter amazon-dash
            ERROR: host.shsrv Cannot install amazon-dash
            ERROR: process exited with code 13</pcap></v8::value></v8::value></v8::function></v8::object></v8::value></pcap></v8::value></v8::value></v8::function></v8::object></v8::value></pcap></v8::value></v8::value></v8::function></v8::object></v8::value>
            

            leider kann ich mit dem ganzen code, der ausgespuckt wird nicht viel anfangen und hoffe, dass mir da jemand weiter helfen kann.

            danke und schöne grüße

            1 Reply Last reply Reply Quote 0
            • D
              denjo last edited by

              Das liegt an der neuen Installation Routine, bzw an den root rechten. Mach ein issus auf habe ich auch schon

              1 Reply Last reply Reply Quote 0
              • L
                ltsalvatore last edited by

                @denjo:

                Das liegt an der neuen Installation Routine, bzw an den root rechten. Mach ein issus auf habe ich auch schon `

                ein issue auf git?

                installatiosroutine bezogen auf den adapter oder der neuen iobroker installations routine?

                1 Reply Last reply Reply Quote 0
                • Homoran
                  Homoran Global Moderator Administrators last edited by

                  Es gibt ein issue in dem alle befehle gesammelt werden, die der user iobroker ausführen können muss, aber bisher nicht kann.

                  Dort bitte als Kommentar hinzuzufügen

                  Gruß

                  Rainer

                  1 Reply Last reply Reply Quote 0
                  • L
                    ltsalvatore last edited by

                    @Homoran:

                    Es gibt ein issue in dem alle befehle gesammelt werden, die der user iobroker ausführen können muss, aber bisher nicht kann.

                    Dort bitte als Kommentar hinzuzufügen

                    Gruß

                    Rainer `

                    hm.. wo denn und was soll ich da dann eintragen?

                    @denjo:

                    Das liegt an der neuen Installation Routine, bzw an den root rechten. Mach ein issus auf habe ich auch schon `

                    ich habe mich jetzt einfach mal bei deinem issue dazugesellt.

                    –--

                    den adapter konnt ich mittlerweile inst. aber aktiv ist dieser immer noch nicht und spuckt fehlermeldungen im iobroker log aus.

                    host.shsrv	2019-01-18 14:05:16.401	error	instance system.adapter.amazon-dash.0 terminated with code 0 (OK)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at Socket. <anonymous>(/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:787:25)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at createInstancesObjects (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:748:13)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at /opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:788:29
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at initAdapter (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4990:18)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at Adapter.emit (events.js:208:7)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at emitNone (events.js:106:13)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at Adapter. <anonymous>(/opt/iobroker/node_modules/iobroker.amazon-dash/main.js:43:5)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at main (/opt/iobroker/node_modules/iobroker.amazon-dash/main.js:78:29)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at Object.exports.createSession (/opt/iobroker/node_modules/pcap/pcap.js:123:12)
                    host.shsrv	2019-01-18 14:05:16.401	error	Caught by controller[0]: at new PcapSession (/opt/iobroker/node_modules/pcap/pcap.js:49:39)
                    host.shsrv	2019-01-18 14:05:16.400	error	Caught by controller[0]: Error: socket: Operation not permitted</anonymous></anonymous>
                    
                    1 Reply Last reply Reply Quote 0
                    • Homoran
                      Homoran Global Moderator Administrators last edited by

                      @ltsalvatore:

                      hm.. wo denn und was soll ich da dann eintragen? `

                      Sorry, war gestern unterwegs und konnte nicht suchen:

                      https://github.com/ioBroker/ioBroker/issues/96

                      dort einen Kommentar einfügen in dem der Command steht bei dem EACCESS oder ähnliche Fehler wegen fehlender Rechte stehen.

                      Gruß

                      Rainer

                      AlCalzone created this issue in ioBroker/ioBroker

                      closed Which commands should iobroker be allowed to execute as `sudo`? #96

                      1 Reply Last reply Reply Quote 0
                      • L
                        ltsalvatore last edited by

                        @Homoran:

                        @ltsalvatore:

                        hm.. wo denn und was soll ich da dann eintragen? `

                        Sorry, war gestern unterwegs und konnte nicht suchen:

                        https://github.com/ioBroker/ioBroker/issues/96

                        dort einen Kommentar einfügen in dem der Command steht bei dem EACCESS oder ähnliche Fehler wegen fehlender Rechte stehen.

                        Gruß

                        Rainer `

                        super, danke für den link.

                        werde ich eintragen, sobald ich gecheckt habe, welcher eintrag genau gemeint ist. :roll:

                        AlCalzone created this issue in ioBroker/ioBroker

                        closed Which commands should iobroker be allowed to execute as `sudo`? #96

                        1 Reply Last reply Reply Quote 0
                        • Homoran
                          Homoran Global Moderator Administrators last edited by

                          @ltsalvatore:

                          sobald ich gecheckt habe, welcher eintrag genau gemeint ist. :roll: `

                          ich bin auch kein scripter, aber das sieht z.B. danach aus:

                          Sperren des Administrationsverzeichnisses (/var/lib/dpkg/) nicht möglich, sind Sie root?
                          
                          gyp ERR! stack Error: `make` failed with exit code: 2
                          

                          make steht schon auf der Liste!

                          Am besten einen Link auf diese Fehlermeldungen in dem Kommentar angeben.

                          Gruß

                          Rainer

                          1 Reply Last reply Reply Quote 0
                          • D
                            deifel last edited by

                            Hallo zusammen,

                            ich habe leider nach wie vor Probleme, den Dash-Adapter ans Laufen zu bekommen.

                            Nachdem alles funktioniert hatte und ich einen Neustart vom System machen musste (Debian), spinnt Libcap bei mir.

                            Der Befehl:

                            sudo setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f $(which node))

                            bringt

                            :sudo: setcap: Befehl nicht gefunden

                            Egal ob mit oder ohne sudo.

                            Libcap ist allerdings installiert.

                            Remove klappt allerdings auch nicht:

                            Abhängigkeitsbaum wird aufgebaut.

                            Statusinformationen werden eingelesen…. Fertig

                            Paket »libcap-dev« ist nicht installiert, wird also auch nicht entfernt.

                            0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

                            Er sagt, es ist nicht installiert...

                            Wenn ich installieren möchte, erscheint:

                            libpcap-dev ist schon die neueste Version (1.8.1-3).

                            0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

                            Kann mir jemand sagen, wie ich das Teil richtig entfernen kann oder mit welchem Befehl ich die Rechte wieder richtig setze?

                            Ausfgabe dpkg ist:

                            root@IOBrokerhost:~# dpkg -L libpcap0.8

                            /.

                            /usr

                            /usr/lib

                            /usr/lib/x86_64-linux-gnu

                            /usr/lib/x86_64-linux-gnu/libpcap.so.1.8.1

                            /usr/share

                            /usr/share/doc

                            /usr/share/doc/libpcap0.8

                            /usr/share/doc/libpcap0.8/CREDITS.gz

                            /usr/share/doc/libpcap0.8/README

                            /usr/share/doc/libpcap0.8/README.Debian

                            /usr/share/doc/libpcap0.8/changelog.Debian.gz

                            /usr/share/doc/libpcap0.8/changelog.gz

                            /usr/share/doc/libpcap0.8/copyright

                            /usr/share/man

                            /usr/share/man/man7

                            /usr/share/man/man7/pcap-filter.7.gz

                            /usr/lib/x86_64-linux-gnu/libpcap.so.0.8

                            Vielen Dank im Voraus

                            1 Reply Last reply Reply Quote 0
                            • D
                              deifel last edited by

                              @denjo:

                              @msiemers:

                              @Stabilostick:

                              Um zu prüfen, ob das pcap Module korrekt funktioniert, kann die im Module mitgelieferte Bespieldatei „network_grep.js“ über die Kommandozeile ausgeführt werden. Diese Datei befindet sich z. B. im Ordner „node_modules“ unter pcap/examples/network_grep.js

                              Beispiel Befehl:

                              node /opt/iobroker/node_modules/pcap/examples/network_grep.js
                              

                              Hier sollte dann folgender Fehler NICHT mehr auftreten:

                              /opt/iobroker/node_modules/pcap/pcap.js:49
                                      this.link_type = this.session.open_live(this.device_name, this.filter, this.buffer_size, this.outfile, packet_ready, this.is_monitor);
                               
                              Error: socket: Operation not permitted
                                  at new PcapSession (/opt/iobroker/node_modules/pcap/pcap.js:49:39)
                                  at Object.exports.createSession (/opt/iobroker/node_modules/pcap/pcap.js:123:12)
                                  at Object. <anonymous>(/opt/iobroker/node_modules/pcap/examples/network_grep.js:2:25)
                                  at Module._compile (module.js:571:32)
                                  at Object.Module._extensions..js (module.js:580:10)
                                  at Module.load (module.js:488:32)
                                  at tryModuleLoad (module.js:447:12)
                                  at Function.Module._load (module.js:439:3)
                                  at Module.runMain (module.js:605:10)
                                  at run (bootstrap_node.js:427:7)</anonymous>
                              ````"
                              
                              Vollquote von [https://www.blogging-it.com/node-pcap-m … odejs.html](https://www.blogging-it.com/node-pcap-module-error-socket-operation-not-permitted-fehler-wenn-pcapsession-geoeffnet-wird/programmierung/javascript/nodejs.html)
                              
                              Danke, Markus. `  
                              

                              Was macht man denn wenn nach dem Befehl immer noch folgender Fehler kommt?

                              TypeError: Cannot read property 'ip' of undefined
                                  at PcapSession. <anonymous>(/opt/iobroker/node_modules/pcap/examples/network_grep.js:9:28)
                                  at emitOne (events.js:116:13)
                                  at PcapSession.emit (events.js:211:7)
                                  at PcapSession.on_packet_ready (/opt/iobroker/node_modules/pcap/pcap.js:99:10)
                                  at packet_ready (/opt/iobroker/node_modules/pcap/pcap.js:44:14)
                                  at SocketWatcher.pcap_read_callback [as callback] (/opt/iobroker/node_modules/pcap/pcap.js:64:45)
                              root@iobroker:/opt/iobroker#</anonymous> 
                              

                              Ich habe das gleiche Problem wie mein Vorredner. `

                              schon eine lösung gefunden??? `

                              Habe es (wenn auch evtl. nur vorübergehend) geschafft, den Dash-Adapter zum "Leben" zu erwecken.

                              Dazu haben ich

                              apt-get install libcap2-bin

                              installiert und danach den Befehl:

                              setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f $(which node))

                              ausgeführt. Adapter neu starten - dann sollte er wieder laufen. Habe aber noch keine Neustart getestet…

                              1 Reply Last reply Reply Quote 0
                              • R
                                rebe09 last edited by

                                Hallo.

                                Ich bekomme bei install Versuch folgende Fehlermeldung(en)

                                ! $ ./iobroker add amazon-dash –host octopi
                                ! npm install iobroker.amazon-dash --production --prefix "/root" (System call)
                                ! npm
                                ! WARN addRemoteGit Error: Command failed: git config --get remote.origin.urlnpm WARN addRemoteGit
                                ! npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:199:12)
                                ! npm WARN addRemoteGit at emitTwo (events.js:106:13)
                                ! npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
                                ! npm WARN addRemoteGit at maybeClose (internal/child_process.js:920:16)
                                ! npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
                                ! npm WARN addRemoteGit git+https://github.com/bytzdev/node-socketwatcher.git resetting remote /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02de because of error: { Error: Command failed: git config --get remote.origin.url
                                ! npm WARN addRemoteGit
                                ! npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:199:12)
                                ! npm WARN addRemoteGit at emitTwo (events.js:106:13)
                                ! npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
                                ! npm WARN addRemoteGit at maybeClose (internal/child_process.js:920:16)
                                ! npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
                                ! npm WARN addRemoteGit killed: false,
                                ! npm WARN addRemoteGit code: 1,
                                ! npm WARN addRemoteGit signal: null,
                                ! npm WARN addRemoteGit cmd: 'git config --get remote.origin.url' }
                                ! npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror https://github.com/bytzdev/node-socketwatcher.git /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02de: Please run git without sudo, your regular user account is enough 🙂
                                ! npm ERR! Linux 4.9.35-v7+npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "iobroker.amazon-dash" "--production" "--prefix" "/root"
                                ! npm
                                ! ERR! node v6.13.0
                                ! npm ERR! npm v3.10.10
                                ! npm ERR! code 1
                                ! npm
                                ! ERR! Command failed: git clone --template=/root/.npm/_git-remotes/_templates --mirror https://github.com/bytzdev/node-socketwatcher.git /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02denpm ERR!
                                ! npm ERR!
                                ! npm ERR! If you need help, you may report this error at:
                                ! npm ERR! <https://github.com/npm/npm/issues>
                                ! npm
                                ! ERR! Please include the following file with any support request:npm ERR!
                                ! /npm-debug.log
                                ! host.octopi install adapter amazon-dash
                                ! npm install iobroker.amazon-dash --production --prefix "/root" (System call)
                                ! npm
                                ! WARN addRemoteGit Error: Command failed: git config --get remote.origin.urlnpm WARN addRemoteGit
                                ! npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:199:12)
                                ! npm WARN addRemoteGit at emitTwo (events.js:106:13)
                                ! npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
                                ! npm WARN addRemoteGit at maybeClose (internal/child_process.js:920:16)
                                ! npm WARN addRemoteGit
                                ! at Socket. <anonymous>(internal/child_process.js:351:11)npm WARN addRemoteGit at emitOne (events.js:96:13)
                                ! npm WARN addRemoteGit at Socket.emit (events.js:188:7)
                                ! npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:509:12)
                                ! npm WARN addRemoteGit git+https://github.com/bytzdev/node-socketwatcher.git resetting remote /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02de because of error: { Error: Command failed: git config –get remote.origin.url
                                ! npm WARN addRemoteGit
                                ! npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:199:12)
                                ! npm WARN addRemoteGit at emitTwo (events.js:106:13)
                                ! npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
                                ! npm WARN addRemoteGit at maybeClose (internal/child_process.js:920:16)
                                ! npm WARN addRemoteGit at Socket. <anonymous>(internal/child_process.js:351:11)
                                ! npm WARN addRemoteGit at emitOne (events.js:96:13)
                                ! npm WARN addRemoteGit at Socket.emit (events.js:188:7)
                                ! npm
                                ! WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:509:12)npm WARN addRemoteGit killed: false,
                                ! npm
                                ! WARN
                                ! addRemoteGit
                                ! code: 1,npm WARN addRemoteGit signal: null,
                                ! npm WARN addRemoteGit cmd: 'git config –get remote.origin.url' }
                                ! npm
                                ! ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror https://github.com/bytzdev/node-socketwatcher.git /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02de: Please run git without sudo, your regular user account is enough 🙂
                                ! npm
                                ! ERR! Linux 4.9.35-v7+npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "iobroker.amazon-dash" "--production" "--prefix" "/root"
                                ! npm ERR! node v6.13.0
                                ! npm ERR! npm v3.10.10
                                ! npm ERR! code 1
                                ! npm
                                ! ERR! Command failed: git clone --template=/root/.npm/_git-remotes/_templates --mirror https://github.com/bytzdev/node-socketwatcher.git /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02denpm ERR!
                                ! npm ERR!
                                ! npm ERR! If you need help, you may report this error at:
                                ! npm ERR! <https://github.com/npm/npm/issues>
                                ! npm ERR! Please include the following file with any support request:npm ERR! /npm-debug.log
                                ! host.octopi install adapter amazon-dash
                                ! npm install iobroker.amazon-dash --production --prefix "/root" (System call)
                                ! npm
                                ! WARN addRemoteGit Error: Command failed: git config --get remote.origin.url
                                ! npm WARN addRemoteGit npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:199:12)
                                ! npm WARN addRemoteGit at emitTwo (events.js:106:13)
                                ! npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
                                ! npm WARN addRemoteGit at maybeClose (internal/child_process.js:920:16)
                                ! npm WARN addRemoteGit at Socket. <anonymous>(internal/child_process.js:351:11)
                                ! npm WARN addRemoteGit at emitOne (events.js:96:13)
                                ! npm WARN addRemoteGit at Socket.emit (events.js:188:7)
                                ! npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:509:12)
                                ! npm WARN addRemoteGit git+https://github.com/bytzdev/node-socketwatcher.git resetting remote /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02de because of error: { Error: Command failed: git config –get remote.origin.url
                                ! npm WARN addRemoteGit
                                ! npm WARN addRemoteGit
                                ! at ChildProcess.exithandler (child_process.js:199:12)npm WARN addRemoteGit at emitTwo (events.js:106:13)
                                ! npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
                                ! npm WARN addRemoteGit at maybeClose (internal/child_process.js:920:16)
                                ! npm
                                ! WARN
                                ! addRemoteGit at Socket. <anonymous>(internal/child_process.js:351:11)npm WARN addRemoteGit at emitOne (events.js:96:13)
                                ! npm WARN addRemoteGit at Socket.emit (events.js:188:7)
                                ! npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:509:12)
                                ! npm WARN addRemoteGit killed: false,
                                ! npm WARN addRemoteGit
                                ! code: 1,
                                ! npm
                                ! WARN addRemoteGit signal: null,npm WARN addRemoteGit cmd: 'git config –get remote.origin.url' }
                                ! npm
                                ! ERR!
                                ! git clone --template=/root/.npm/_git-remotes/_templates --mirror https://github.com/bytzdev/node-socketwatcher.git /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02de:
                                ! Please run git without sudo, your regular user account is enough 🙂
                                ! npm
                                ! ERR! Linux 4.9.35-v7+npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "iobroker.amazon-dash" "--production" "--prefix" "/root"
                                ! npm ERR! node v6.13.0
                                ! npm ERR! npm v3.10.10npm ERR! code 1
                                ! npm ERR! Command failed: git clone --template=/root/.npm/_git-remotes/_templates --mirror https://github.com/bytzdev/node-socketwatcher.git /root/.npm/_git-remotes/git-https-github-com-bytzdev-node-socketwatcher-git-e2de02denpm ERR!
                                ! npm ERR!
                                ! npm ERR! If you need help, you may report this error at:
                                ! npm ERR! <https://github.com/npm/npm/issues>
                                ! npm ERR! Please include the following file with any support request:npm ERR! /npm-debug.log
                                ! host.octopi install adapter amazon-dash
                                ! ERROR: host.octopi Cannot install amazon-dash
                                ! ERROR: process exited with code 13</anonymous></anonymous></anonymous></anonymous>

                                weiss jemand was zu tun ist und sagt es mir auch?

                                Vielen Dank!!

                                1 Reply Last reply Reply Quote 0
                                • R
                                  rebe09 last edited by

                                  Hallo nochmals.

                                  Ich habe nun nochmals versucht auf einem andern Raspberry iobroker neu aufzusetzen und anschließend den Amazon Adapter zu installieren.

                                  Das klappt leider auch nicht.

                                  folgender Output:

                                  ! $ ./iobroker add amazon-dash –host raspberrypi
                                  ! NPM version: 6.4.1
                                  ! npm install iobroker.amazon-dash --production --save --prefix "/opt/iobroker" (System call)
                                  ! WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
                                  ! E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
                                  ! ../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Callback(uv_poll_t*, int, int)’:../socket_watcher.cpp:77:60: warning: ‘v8::Local v8::valueNan::MakeCallback(v8::Localv8::object, v8::Localv8::function, int, v8::Localv8::value*)’ is deprecated [-Wdeprecated-declarations]
                                  ! Nan::MakeCallback(watcher->handle(), callback, argc, argv);
                                  ! ^
                                  ! In file included from ../socket_watcher.hpp:8:0, from ../socket_watcher.cpp:5:
                                  ! ../../nan/nan.h:959:46: note: declared here
                                  ! NAN_DEPRECATED inline v8::Local v8::valueMakeCallback(
                                  ! ^~~~~~~~~~~~</v8::value></v8::value></v8::function></v8::object></v8::value>

                                  1 Reply Last reply Reply Quote 0
                                  • F
                                    FabianM @Stabilostick last edited by

                                    @Stabilostick said in Amazon Dash Adapter spinnt sich aus:

                                    "Für unixartige Betriebssysteme stellt die Bibliothek „libpcap“ (packet capture library) Funktionen zur Verfügung, um den Datenverkehr, welcher über die Netzwerkschnittstellen läuft, mitzuschneiden und zu analysieren. Das JavaScript Modul „pcap“ stellt die entsprechenden Bindungen (engl. Bindings) für diese Bibliothek zur Verfügung. Diese können dann mit Node.js verwendet werden.

                                    <size size="150">Problem</size>

                                    Diese Bibliothek wird gerne in Node.js Modulen, wie z. B. dem Amazon Dashbutton Adapter für ioBroker, verwendet.

                                    Da die libpcap Bibliothek auf Funktionen des Betriebssystems zugreift, kann es zu folgender Fehlermeldung kommen, wenn der Code ausgeführt wird.

                                    Error: socket: Operation not permitted
                                    

                                    Der Benutzer, durch den der Code ausgeführt wurde, besitzt anscheinend nicht die notwendigen Rechte.

                                    Am Beispiel des Amazon Dashbutton Adapters, würde dann folgende Fehlermeldung im Log auftauchen.

                                    error   at Adapter. (/opt/iobroker/node_modules/iobroker.amazon-dash/main.js:50:29)
                                    error   at Object.exports.createSession (/opt/iobroker/node_modules/iobroker.amazon-dash/node_modules/pcap/pcap.js:123:12)
                                    error   at new PcapSession (/opt/iobroker/node_modules/iobroker.amazon-dash/node_modules/pcap/pcap.js:49:39)
                                    error   Error: socket: Operation not permitted
                                    error   uncaught exception: socket: Operation not permitted
                                    

                                    <size size="150">Lösung</size>

                                    Um das Problem zu lösen, müssen die Dateisystem „Capabilities“ für das Programm „node“ angepasst werden. Dies kann durch das Kommandozeilen-Tool „setcap“ erreicht werden.

                                    Hierzu muss folgender Befehl in der Kommandozeile ausgeführt werden.

                                    sudo setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f $(which node))
                                    

                                    Mit dem Tool „getcap“ kann geprüft werden, ob alles korrekt gesetzt wurde. Hierzu muss folgender Befehl in der Kommandozeile ausgeführt werden.

                                    sudo getcap $(readlink -f $(which node))
                                    

                                    Dies Ausgabe sollte dann z. B. so aussehen:

                                    /usr/bin/nodejs = cap_net_admin,cap_net_raw+eip
                                    

                                    Hier noch eine kurze Erklärung aus der Dokumentation:

                                    ` > In many distributions you can use the 'setcap' utility to add capabilities to individual files.

                                    CAP_NET_RAW:

                                    Allow use of RAW and PACKET sockets.

                                    CAP_NET_ADMIN:

                                    Allow various network-related operations (e.g. setting privileged socket options, enabling multicasting, setting promiscuous mode, interface configuration, modifying routing tables).

                                    The “+eip” means you’re adding the file capability sets Effective, Inherited and Permitted.

                                    Each thread has three capability sets containing zero or more of the above capabilities:

                                    The three file capability sets are:

                                    e: Effective - The capabilities used by the kernel to perform permission checks for the thread.

                                    i: Inherited - The capabilities preserved across an execve(2). A child created via fork(2) inherits copies of its parent's capability sets. See below for a discussion of the treatment of capabilities during exec(). Using capset(2), a thread may manipulate its own capability sets, or, if it has the CAP_SETPCAP capability, those of a thread in another process.

                                    p: Permitted - The capabilities that the thread may assume (i.e., a limiting superset for the effective and inheritable sets). If a thread drops a capability from its permitted set, it can never re-acquire that capability (unless it exec()s a set-user-ID-root program). `

                                    Um zu prüfen, ob das pcap Module korrekt funktioniert, kann die im Module mitgelieferte Bespieldatei „network_grep.js“ über die Kommandozeile ausgeführt werden. Diese Datei befindet sich z. B. im Ordner „node_modules“ unter pcap/examples/network_grep.js

                                    Beispiel Befehl:

                                    node /opt/iobroker/node_modules/pcap/examples/network_grep.js
                                    

                                    Hier sollte dann folgender Fehler NICHT mehr auftreten:

                                    /opt/iobroker/node_modules/pcap/pcap.js:49
                                            this.link_type = this.session.open_live(this.device_name, this.filter, this.buffer_size, this.outfile, packet_ready, this.is_monitor);
                                    
                                    Error: socket: Operation not permitted
                                        at new PcapSession (/opt/iobroker/node_modules/pcap/pcap.js:49:39)
                                        at Object.exports.createSession (/opt/iobroker/node_modules/pcap/pcap.js:123:12)
                                        at Object. <anonymous>(/opt/iobroker/node_modules/pcap/examples/network_grep.js:2:25)
                                        at Module._compile (module.js:571:32)
                                        at Object.Module._extensions..js (module.js:580:10)
                                        at Module.load (module.js:488:32)
                                        at tryModuleLoad (module.js:447:12)
                                        at Function.Module._load (module.js:439:3)
                                        at Module.runMain (module.js:605:10)
                                        at run (bootstrap_node.js:427:7)</anonymous>
                                    ````"
                                    
                                    Vollquote von [https://www.blogging-it.com/node-pcap-m … odejs.html](https://www.blogging-it.com/node-pcap-module-error-socket-operation-not-permitted-fehler-wenn-pcapsession-geoeffnet-wird/programmierung/javascript/nodejs.html)
                                    
                                    Danke, Markus.
                                    

                                    Vielen Dank, das hat bei mir geholfen!

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post

                                    Support us

                                    ioBroker
                                    Community Adapters
                                    Donate

                                    417
                                    Online

                                    31.6k
                                    Users

                                    79.6k
                                    Topics

                                    1.3m
                                    Posts

                                    13
                                    25
                                    4110
                                    Loading More Posts
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    Community
                                    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                    The ioBroker Community 2014-2023
                                    logo