Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. modbus Error: undefined

    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

    SOLVED modbus Error: undefined

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

      Systemdata Bitte Ausfüllen
      Hardwaresystem: Pi4
      Arbeitsspeicher: 4GB
      Festplattenart: USB SSD
      Betriebssystem: raspbian 5.4.79-v7l+
      Node-Version: 10.17.0
      Nodejs-Version: 10.17.0
      NPM-Version: 6.11.3
      Installationsart: Skript
      Image genutzt: Ja
      Ort/Name der Imagedatei: ioBroker_Image_RPi_2-3-4_20190723_buster

      Hallo Community, ich verzweifle - seit kurzem geht mein modbus Adapter (3.1.10) nicht mehr.
      Er updatet die Objekte nicht mehr und verliert ständig die Verbindung - als der Punkt vor dem Adapter wechselt ständig von grün zu gelb.... im "Timeout" Intervall.

      Im Log erscheint:

      modbus.0	2020-12-03 22:51:24.658	debug	(13026) Cleaning up request fifo.
      modbus.0	2020-12-03 22:51:24.657	debug	(13026) Clearing timeout of the current request.
      modbus.0	2020-12-03 22:51:24.648	info	(13026) Disconnected from slave
      modbus.0	2020-12-03 22:51:23.648	warn	(13026) Poll error count: 1 code: {"err":"timeout","timeout":5000}
      modbus.0	2020-12-03 22:51:23.646	error	(13026) Request timed out.
      modbus.0	2020-12-03 22:51:23.645	warn	(13026) Error: undefined
      modbus.0	2020-12-03 22:51:18.636	debug	(13026) Poll inputRegs DevID(1) address 0 - 1 bytes
      modbus.0	2020-12-03 22:51:18.634	debug	(13026) Poll device 1
      modbus.0	2020-12-03 22:51:18.633	info	(13026) Connected to slave
      modbus.0	2020-12-03 22:51:18.616	debug	(13026) connect to serial /dev/ttyUSB0 with 9600
      modbus.0	2020-12-03 22:51:18.048	info	(13026) starting. Version 3.1.10 in /opt/iobroker/node_modules/iobroker.modbus, node: v10.17.0, js-controller: 3.1.6
      

      Wenn ich den Adapter entferne und neu installiere kommt folgendes:

      /opt/iobroker$ whoami
      
      iobroker
      /opt/iobroker$ npm install iobroker.modbus --prefix="/opt/iobroker"
      
      
      > @serialport/bindings@8.0.8 install /opt/iobroker/node_modules/iobroker.modbus/node_modules/@serialport/bindings
      > prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
      
      prebuild-install
      WARN install No prebuilt binaries found (target=10.17.0 runtime=node arch=arm libc= platform=linux)
      make: Verzeichnis „/opt/iobroker/node_modules/iobroker.modbus/node_modules/@serialport/bindings/build“ wird betreten
        CXX(target) Release/obj.target/bindings/src/serialport.o
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:78:69: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);
                                                                           ^~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:135:71: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);
                                                                             ^~~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:175:70: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);
                                                                            ^~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:215:70: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);
                                                                            ^~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:270:68: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);
                                                                          ^~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:314:68: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);
                                                                          ^~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:363:76: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);
                                                                                  ^~~~~~~~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
      ../src/serialport.cpp:409:70: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
         uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);
                                                                            ^~~~~~~~~~~~~~
      ../src/serialport.cpp: At global scope:
      ../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
      SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
                                  ^
      ../src/serialport.cpp:449:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses]
      SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
                                    ^
      In file included from ../../../../../nan/nan.h:56,
                       from ../src/./serialport.h:6,
                       from ../src/serialport.cpp:1:
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
             (node::addon_register_func) (regfunc),                          \
                                                 ^
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
         NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
         ^~~~~~~~~~~~~
      ../src/serialport.cpp:483:1: note: in expansion of macro ‘NODE_MODULE’
      NODE_MODULE(serialport, init);
      ^~~~~~~~~~~
      In file included from /home/iobroker/.cache/node-gyp/10.17.0/include/node/node.h:63,
                       from ../../../../../nan/nan.h:56,
                       from ../src/./serialport.h:6,
                       from ../src/serialport.cpp:1:
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/node_object_wrap.h:84:78:   required from here
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                      reinterpret_cast<Callback>(callback), type);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
      ../../../../../nan/nan_object_wrap.h:65:61:   required from here
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
        CXX(target) Release/obj.target/bindings/src/serialport_unix.o
      In file included from /home/iobroker/.cache/node-gyp/10.17.0/include/node/node.h:63,
                       from ../../../../../nan/nan.h:56,
                       from ../src/serialport.h:6,
                       from ../src/serialport_unix.cpp:2:
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/node_object_wrap.h:84:78:   required from here
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                      reinterpret_cast<Callback>(callback), type);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
      ../../../../../nan/nan_object_wrap.h:65:61:   required from here
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
      ../src/serialport_unix.cpp: In function ‘int setup(int, OpenBaton*)’:
      ../src/serialport_unix.cpp:176:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Wformat-truncation=]
           snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
      ../src/serialport_unix.cpp:176:13: note: ‘snprintf’ output 20 or more bytes (assuming 1043) into a destination of size 1024
           snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../src/serialport_unix.cpp: In function ‘void EIO_Open(uv_work_t*)’:
      ../src/serialport_unix.cpp:86:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1003 [-Wformat-truncation=]
           snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../src/serialport_unix.cpp:86:13: note: ‘snprintf’ output 22 or more bytes (assuming 1045) into a destination of size 1024
           snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        CXX(target) Release/obj.target/bindings/src/poller.o
      In file included from /home/iobroker/.cache/node-gyp/10.17.0/include/node/node.h:63,
                       from ../../../../../nan/nan.h:56,
                       from ../src/poller.cpp:1:
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/node_object_wrap.h:84:78:   required from here
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                      reinterpret_cast<Callback>(callback), type);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
      ../../../../../nan/nan_object_wrap.h:65:61:   required from here
      /home/iobroker/.cache/node-gyp/10.17.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
        CXX(target) Release/obj.target/bindings/src/serialport_linux.o
        SOLINK_MODULE(target) Release/obj.target/bindings.node
        COPY Release/bindings.node
      make: Verzeichnis „/opt/iobroker/node_modules/iobroker.modbus/node_modules/@serialport/bindings/build“ wird verlassen
      
      > serialport@8.0.8 postinstall /opt/iobroker/node_modules/iobroker.modbus/node_modules/serialport
      > node thank-you.js
      
      96Thank you for using serialport!96
      96If you rely on this package, please consider supporting our open collective:
      > 94https://opencollective.com/serialport/donate
      
      
      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"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: osx-temperature-sensor@^1.0.7 (node_modules/iobroker.info/node_modules/osx-temperature-sensor):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for osx-temperature-sensor@1.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
      npm WARN enoent ENOENT: no such file or directory, open '/opt/iobroker/node_modules/@serialport/bindings/package.json'
      
      + iobroker.modbus@3.1.10
      added 41 packages from 29 contributors and audited 2123 packages in 44.966s
      found 42 vulnerabilities (23 low, 4 moderate, 15 high)
        run `npm audit fix` to fix them, or `npm audit` for details
      /opt/iobroker$  
      

      Irgendwas mit serialport scheint nicht zu stimmen? Was ist die richtige Version von serialport? Welche soll ich installieren?

      UncleSam 1 Reply Last reply Reply Quote 0
      • M
        mo2mk @UncleSam last edited by

        @UncleSam der Modbus USB-RS485 Stick ist vermutlich defekt - hab ihn auch an einem PC mit Windows getestet - dort war auch jedes Register 0x00... egal welches Register man abgefragt hat.
        Jetzt habe ich ein Modbus-Lan Gateway verbaut, mit dem geht der mobus Adapter im ioBroker wieder... danke.

        1 Reply Last reply Reply Quote 1
        • UncleSam
          UncleSam Developer @mo2mk last edited by

          @mo2mk sagte in modbus Error: undefined:

          Irgendwas mit serialport scheint nicht zu stimmen?

          Bei der Installation ist alles in Ordnung. Das sind alles nur Warnungen.

          Ich habe bei mir ein ähnliches Problem mit einem Wechselrichter an Modbus, das Problem liegt allerdings beim Gerät selber: wenn ich den Wechselrichter vom Netz trenne und damit neue starte, funktioniert alles wieder. Ich sehe leider nicht, was für ein Gerät du einsetzt, aber hast du das schon mal versucht?

          M 1 Reply Last reply Reply Quote 0
          • M
            mo2mk @UncleSam last edited by

            @UncleSam
            Es hanelt sich um einen Stromzähler B+G E-Tech & Eastron SDM530-Modbus, der hängt direkt in der Hauptzuleitung - also mal kurz neu starten ist nicht 👎 .
            Dann meinst du das es dennoch - trotz der warnungen funktionieren sollte?

            Könntest du mir nur zum Abgleich mal deine serialport version sagen? Danke 🙂

            UncleSam 1 Reply Last reply Reply Quote 0
            • UncleSam
              UncleSam Developer @mo2mk last edited by

              @mo2mk Ich verwende Modbus über TCP. Kann es sein, dass das Kabel nicht mehr richtig verbunden ist? Geht es gar nicht oder nur ab und zu nicht?

              M 1 Reply Last reply Reply Quote 0
              • M
                mo2mk @UncleSam last edited by

                @UncleSam der Modbus USB-RS485 Stick ist vermutlich defekt - hab ihn auch an einem PC mit Windows getestet - dort war auch jedes Register 0x00... egal welches Register man abgefragt hat.
                Jetzt habe ich ein Modbus-Lan Gateway verbaut, mit dem geht der mobus Adapter im ioBroker wieder... danke.

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

                Support us

                ioBroker
                Community Adapters
                Donate

                963
                Online

                31.9k
                Users

                80.1k
                Topics

                1.3m
                Posts

                modbus undefined serialport
                2
                5
                477
                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