Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. Java Adapter crash durch node-c02-monitor / node-usb

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    UNSOLVED Java Adapter crash durch node-c02-monitor / node-usb

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

      Hallo,

      Ich habe ein simples javascript, dass mit Hilfe von node-co2-monitor welches wiederum node-usb benützt von einem TFA Dostman C02 sensor die Werte importiert. Seit einiger Zeit stürzt mein Java adapter ab. Offensichtlich ist in der node-usb eine Funktion hotplug depricated und neuerdings kommt es zu den abstürzen. Kann mir wer helfen, was ich tun könnte? Muss ich warten bis das NPM paket gefixt wurde?

      Danke

      Wolfgang

      host.ioBrokerPIB32	2020-10-19 11:01:04.240	info	Restart adapter system.adapter.javascript.2 because enabled
      host.ioBrokerPIB32	2020-10-19 11:01:04.239	error	instance system.adapter.javascript.2 terminated with code 1 (JS_CONTROLLER_STOPPED)
      host.ioBrokerPIB32	2020-10-19 11:01:04.239	error	Caught by controller[0]: at Transfer.transferDone (/opt/iobroker/node_modules/iobroker.javascript/node_modules/usb/usb.js:454:10)
      host.ioBrokerPIB32	2020-10-19 11:01:04.238	error	Caught by controller[0]: at InEndpoint.EventEmitter.emit (domain.js:482:12)
      host.ioBrokerPIB32	2020-10-19 11:01:04.237	error	Caught by controller[0]: at InEndpoint.emit (events.js:310:20)
      host.ioBrokerPIB32	2020-10-19 11:01:04.237	error	Caught by controller[0]: at Object.onceWrapper (events.js:416:28)
      host.ioBrokerPIB32	2020-10-19 11:01:04.236	error	Caught by controller[0]: at InEndpoint.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/node-co2-monitor/co2_monitor.js:90:33)
      host.ioBrokerPIB32	2020-10-19 11:01:04.235	error	Caught by controller[0]: at Interface.attachKernelDriver (/opt/iobroker/node_modules/iobroker.javascript/node_modules/usb/usb.js:330:21)
      host.ioBrokerPIB32	2020-10-19 11:01:04.233	error	Caught by controller[0]: Error: LIBUSB_ERROR_BUSY
      javascript.2	2020-10-19 11:01:02.851	error	at Transfer.transferDone (/opt/iobroker/node_modules/iobroker.javascript/node_modules/usb/usb.js:454:10)
      javascript.2	2020-10-19 11:01:02.851	error	at InEndpoint.EventEmitter.emit (domain.js:482:12)
      javascript.2	2020-10-19 11:01:02.851	error	at InEndpoint.emit (events.js:310:20)
      javascript.2	2020-10-19 11:01:02.851	error	at Object.onceWrapper (events.js:416:28)
      javascript.2	2020-10-19 11:01:02.851	error	at InEndpoint.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/node-co2-monitor/co2_monitor.js:90:33)
      javascript.2	2020-10-19 11:01:02.851	error	at Interface.attachKernelDriver (/opt/iobroker/node_modules/iobroker.javascript/node_modules/usb/usb.js:330:21)
      javascript.2	2020-10-19 11:01:02.851	error	(3370) Error: LIBUSB_ERROR_BUSY
      javascript.2	2020-10-19 11:01:02.851	error	(3370) Error: LIBUSB_ERROR_BUSY
      javascript.2	2020-10-19 11:01:02.850	error	(3370) An error happened which is most likely from one of your scripts, but the originating script could not be detected.
      javascript.2	2020-10-19 11:01:02.843	error	at Transfer.transferDone (/opt/iobroker/node_modules/iobroker.javascript/node_modules/usb/usb.js:441:9)
      javascript.2	2020-10-19 11:01:02.843	error	at InEndpoint.EventEmitter.emit (domain.js:482:12)
      javascript.2	2020-10-19 11:01:02.843	error	at InEndpoint.emit (events.js:310:20)
      javascript.2	2020-10-19 11:01:02.843	error	at InEndpoint.<anonymous> (/opt/iobroker/node_modules/iobroker.javascript/node_modules/node-co2-monitor/co2_monitor.js:127:34)
      javascript.2	2020-10-19 11:01:02.843	error	(3370) script.js.garden.CO2_Monitor_Gästezimmer: Error: Checksum Error.
      javascript.2	2020-10-19 11:01:02.333	info	(3370) script.js.garden.CO2_Monitor_Gästezimmer: CO2 Monitor connected.
      
      
      realwax 1 Reply Last reply Reply Quote 0
      • realwax
        realwax @realwax last edited by realwax

        Beim installieren kommt es zu Fehlern. Es funktioniert, aber crasht eben von Zeit zu Zeit.

        pi@ioBrokerPIB32:/opt/iobroker $ npm install node-co2-monitor
        [..................] | loadIdealTree:loadAllDepsIntoIdealTree: sill install load [..................] - fetchMetadata: sill removeObsoleteDep removing nan@2.13.2
        
        usb@1.6.3 install /opt/iobroker/node_modules/usb
        prebuild-install --verbose || node-gyp rebuild
        
        prebuild-install info begin Prebuild-install version 5.3.3
        prebuild-install info looking for cached prebuild @ /home/iobroker/.npm/_prebuilds/470134-usb-v1.6.3-node-v72-linux-arm.tar.gz
        prebuild-install http request GET https://github.com/tessel/node-usb/releases/download/v1.6.3/usb-v1.6.3-node-v72-linux-arm.tar.gz
        prebuild-install http 404 https://github.com/tessel/node-usb/releases/download/v1.6.3/usb-v1.6.3-node-v72-linux-arm.tar.gz
        prebuild-install WARN install No prebuilt binaries found (target=12.16.3 runtime=node arch=arm libc= platform=linux)
        make: Verzeichnis „/opt/iobroker/node_modules/usb/build“ wird betreten
        CC(target) Release/obj.target/libusb/libusb/libusb/core.o
        CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
        CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
        CC(target) Release/obj.target/libusb/libusb/libusb/io.o
        CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
        CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
        CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
        CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
        CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
        CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
        AR(target) Release/obj.target/usb.a
        COPY Release/usb.a
        CXX(target) Release/obj.target/usb_bindings/src/node_usb.o
        ../src/node_usb.cc: In function ‘void handleHotplug(std::pair<libusb_device*, libusb_hotplug_event>)’:
        ../src/node_usb.cc:151:58: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, const char*, int, v8::Local<v8: :Value>)’ is deprecated [-Wdeprecated-declarations]
        Nan::MakeCallback(Nan::New(hotplugThis), "emit", 2, argv);
        ^
        In file included from ../src/helpers.h:3:0,
        from ../src/node_usb.h:21,
        from ../src/node_usb.cc:1:
        ../node_modules/nan/nan.h:1001:46: note: declared here
        NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
        ^~~~~~~~~~~~
        CXX(target) Release/obj.target/usb_bindings/src/device.o
        ../src/device.cc: In static member function ‘static void Req::default_after(uv_work_t)’:
        ../src/device.cc:237:64: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8: :Localv8::Value)’ is deprecated [-Wdeprecated-declarations]
        Nan::MakeCallback(device, Nan::New(baton->callback), 1, argv);
        ^
        In file included from ../src/helpers.h:3:0,
        from ../src/node_usb.h:21,
        from ../src/device.cc:1:
        ../node_modules/nan/nan.h:959:46: note: declared here
        NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
        ^~~~~~~~~~~~
        CXX(target) Release/obj.target/usb_bindings/src/transfer.o
        ../src/transfer.cc: In function ‘void handleCompletion(Transfer)’:
        ../src/transfer.cc:126:72: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v 8::Localv8::Value*)’ is deprecated [-Wdeprecated-declarations]
        Nan::MakeCallback(self->handle(), Nan::New(self->v8callback), 3, argv);
        ^
        In file included from ../src/helpers.h:3:0,
        from ../src/node_usb.h:21,
        from ../src/transfer.cc:1:
        ../node_modules/nan/nan.h:959:46: note: declared here
        NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
        ^~~~~~~~~~~~
        SOLINK_MODULE(target) Release/obj.target/usb_bindings.node
        COPY Release/usb_bindings.node
        make: Verzeichnis „/opt/iobroker/node_modules/usb/build“ wird verlassen
        npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
        npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
        
        
        Thomas Braun 1 Reply Last reply Reply Quote 0
        • Thomas Braun
          Thomas Braun Most Active @realwax last edited by Thomas Braun

          @realwax

          Bitte Konsolentext in CodeTags packen. 51717875-14c8-4ab3-a283-941c093a9717-image.png

          Ich würde die aktuelle node12-Version installieren und schauen ob libusb-dev installiert ist.

          Fehler beim kompilieren sehe ich aber keine, das sind ganz normale Rückmeldungen.

          realwax 1 Reply Last reply Reply Quote 0
          • realwax
            realwax @Thomas Braun last edited by

            @Thomas-Braun
            Done - sry 😉

            Ja, es ist die Hotplug Funktionalität. Ich habe mal abgesteckt - adapter crasht.
            Ansich geschieht es nur, wenn er die Verbindung zum device verliert. Da ich zwei Sensoren auf zwei pie's habe und einer ständig crasht und der andere nicht, habe ich mal auf dem einen USB port gewechselt.

            Ändert aber nichts am issue - node-co2-monitor nutzt eine depricated hotplug function von node-usb und deswegen crash.
            Ansich habe ich im GIT das mit issues belegt. Kann ich noch etwas tun, oder einfach Geduld?

            https://github.com/tessel/node-usb/issues/387

            Bzw. sehe ich gerade es gibt einen eigenen branch mit
            https://github.com/mitakas/node-co2-monitor/tree/fix-libusb-error-busy-on-linux

            Wie bekomme ich den in npm hinein. Meine Kenntnisse sind da leider etwas zu schwach.

            @Thomas-Braun ? HILFE 😉

            DANKE!

            LG
            Wolfgang

            Thomas Braun 1 Reply Last reply Reply Quote 0
            • Thomas Braun
              Thomas Braun Most Active @realwax last edited by

              @realwax
              Das Ding ist ja seit 3 Jahren nicht mehr angefasst worden.

              realwax 1 Reply Last reply Reply Quote 0
              • realwax
                realwax @Thomas Braun last edited by

                @Thomas-Braun
                Ja leider. Scheinen ja auch nicht viele zu verwenden. Bzw. funkt er ja. somit kein Grund.
                Aber durch die Änderung in der libusb - node-usb crasht er bei hotplug, oder verbindungsverlust.

                Die frage ist wie bekomme ich in node - npm den anderen Branch rein, der das schon anscheinend gefixt hat.

                https://github.com/mitakas/node-co2-monitor/tree/fix-libusb-error-busy-on-linux

                Danke Dir...

                realwax 1 Reply Last reply Reply Quote 0
                • realwax
                  realwax @realwax last edited by

                  Das ist der Original branch
                  https://github.com/huhamhire/node-co2-monitor

                  Es gibt anscheinend einen fork auf npm der aber aufs original git ref. https://www.npmjs.com/package/@jaller94/node-co2-monitor

                  und dann gibts den hier https://github.com/mitakas/node-co2-monitor/tree/fix-libusb-error-busy-on-linux
                  aber hinter dem master.

                  Wie löse ich das am besten?

                  Danke

                  Thomas Braun 1 Reply Last reply Reply Quote 0
                  • Thomas Braun
                    Thomas Braun Most Active @realwax last edited by

                    @realwax
                    🙂 Das weiß ich auch nicht...

                    realwax 1 Reply Last reply Reply Quote 0
                    • realwax
                      realwax @Thomas Braun last edited by

                      @Thomas-Braun danke dennoch für deine Zeit und das Drübersehen. 😉

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

                      Support us

                      ioBroker
                      Community Adapters
                      Donate

                      470
                      Online

                      31.9k
                      Users

                      80.1k
                      Topics

                      1.3m
                      Posts

                      javascript adapter node-co2-monitor node-usb npm
                      2
                      9
                      533
                      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