Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Русский
    3. ioBroker
    4. ioBroker драйвера
    5. Драйвер ModBus

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Драйвер ModBus

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

      @Bluefox:

      Интересно. Что конкретно заработало? TCP? Master? с кем общается? `
      TCP заработал как и 0.3.11 (пока одно устройство ID 5 на arduino и 9 Holding регистров)

      На виртуалке ни вкакую не хочет в IOB видеть COM порты через USB.

      Что странно, то USB GSM модемы отлично работают в asterisk на этoм-же сервере.

      PS: RTU на OrangePi PC так-же не дает выбрать порт после сохранения…

      Но в логах уже есть обнадеживающие записи, касательно USB переходника

      ! ````
      host-orangepi-iot 2016-10-19 20:58:37.473 info Restart adapter system.adapter.modbus.0 because enabled
      host-orangepi-iot 2016-10-19 20:58:37.472 error instance system.adapter.modbus.0 terminated with code 0 (OK)
      modbus-0 2016-10-19 20:58:37.433 info terminating
      TypeError: 2016-10-19 20:58:37.344 error at Socket.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js:134:20)
      TypeError: 2016-10-19 20:58:37.344 error at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15)
      TypeError: 2016-10-19 20:58:37.344 error at Manager.ondata (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:323:16)
      TypeError: 2016-10-19 20:58:37.344 error at Decoder.add (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/socket.io-parser/index.js:247:12)
      TypeError: 2016-10-19 20:58:37.344 error at Decoder.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/socket.io-parser/node_modules/component-emitter/index.js:134:20)
      TypeError: 2016-10-19 20:58:37.344 error at Decoder. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15)
      TypeError: 2016-10-19 20:58:37.344 error at Manager.ondecoded (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:333:8)
      TypeError: 2016-10-19 20:58:37.344 error at Manager.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-emitter/index.js:131:20)
      TypeError: 2016-10-19 20:58:37.344 error at Manager. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15)
      TypeError: 2016-10-19 20:58:37.344 error at Socket.onpacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:229:12)
      TypeError: 2016-10-19 20:58:37.344 error at Socket.onack (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:305:9)
      TypeError: 2016-10-19 20:58:37.344 error at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:707:35)
      TypeError: 2016-10-19 20:58:37.344 error at /opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:773:21
      TypeError: 2016-10-19 20:58:37.344 error at /opt/iobroker/node_modules/iobroker.modbus/main.js:1258:13
      TypeError: 2016-10-19 20:58:37.344 error at clear (/opt/iobroker/node_modules/iobroker.modbus/main.js:1255:22)
      TypeError: 2016-10-19 20:58:37.344 error at Object.main.start (/opt/iobroker/node_modules/iobroker.modbus/main.js:1583:26)
      TypeError: 2016-10-19 20:58:37.344 error modbusClient.connect is not a function
      uncaught 2016-10-19 20:58:37.334 error exception: modbusClient.connect is not a function
      modbus-0 2016-10-19 20:58:36.299 info starting. Version 0.4.0 in /opt/iobroker/node_modules/iobroker.modbus
      host-orangepi-iot 2016-10-19 20:58:33.737 info instance system.adapter.modbus.0 started with pid 31857
      host-orangepi-iot 2016-10-19 20:58:31.239 info instance system.adapter.modbus.0 terminated with code 0 (OK)
      modbus-0 2016-10-19 20:58:31.204 info terminating
      host-orangepi-iot 2016-10-19 20:58:31.157 info stopInstance system.adapter.modbus.0 killing pid 31773
      host-orangepi-iot 2016-10-19 20:58:31.155 info stopInstance system.adapter.modbus.0
      host-orangepi-iot 2016-10-19 20:58:31.145 info object change system.adapter.modbus.0
      modbus-0 2016-10-19 20:58:06.901 info List of port: [{"comName":"/dev/ttyS0"},{"comName":"/dev/ttyUSB0","manufacturer":"1a86","serialNumber":"1a86_USB2.0-Serial","pnpId":"usb-1a86_USB2.0-Serial-if00-port0","vendorId":"0x1a86","productId"
      modbus-0 2016-10-19 20:57:53.650 warn Error: connect ECONNREFUSED 127.0.0.1:502
      modbus-0 2016-10-19 20:57:52.541 info starting. Version 0.4.0 in /opt/iobroker/node_modules/iobroker.modbus
      iobroker 2016-10-19 20:57:49.956 info exit 0
      iobroker 2016-10-19 20:57:49.936 info host.orangepi-iot object system.adapter.modbus.0 created

      1 Reply Last reply Reply Quote 0
      • Bluefox
        Bluefox last edited by

        Мы достаточно близко подошли к решению.

        Попробуй ещё раз обновиться

        1 Reply Last reply Reply Quote 0
        • H
          Haus last edited by

          @MSapogov:

          @Bluefox:

          Интересно. Что конкретно заработало? TCP? Master? с кем общается? `
          TCP заработал как и 0.3.11 (пока одно устройство ID 5 на arduino и 9 Holding регистров)

          На виртуалке ни вкакую не хочет в IOB видеть COM порты через USB.

          Что странно, то USB GSM модемы отлично работают в asterisk на этoм-же сервере.

          PS: RTU на OrangePi PC так-же не дает выбрать порт после сохранения…

          Но в логах уже есть обнадеживающие записи, касательно USB переходника

          ! host-orangepi-iot 2016-10-19 20:58:37.473 info Restart adapter system.adapter.modbus.0 because enabled host-orangepi-iot 2016-10-19 20:58:37.472 error instance system.adapter.modbus.0 terminated with code 0 (OK) modbus-0 2016-10-19 20:58:37.433 info terminating TypeError: 2016-10-19 20:58:37.344 error at Socket.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js:134:20) TypeError: 2016-10-19 20:58:37.344 error at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15) TypeError: 2016-10-19 20:58:37.344 error at Manager.ondata (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:323:16) TypeError: 2016-10-19 20:58:37.344 error at Decoder.add (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/socket.io-parser/index.js:247:12) TypeError: 2016-10-19 20:58:37.344 error at Decoder.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/socket.io-parser/node_modules/component-emitter/index.js:134:20) TypeError: 2016-10-19 20:58:37.344 error at Decoder. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15) TypeError: 2016-10-19 20:58:37.344 error at Manager.ondecoded (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:333:8) TypeError: 2016-10-19 20:58:37.344 error at Manager.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-emitter/index.js:131:20) TypeError: 2016-10-19 20:58:37.344 error at Manager. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15) TypeError: 2016-10-19 20:58:37.344 error at Socket.onpacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:229:12) TypeError: 2016-10-19 20:58:37.344 error at Socket.onack (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:305:9) TypeError: 2016-10-19 20:58:37.344 error at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:707:35) TypeError: 2016-10-19 20:58:37.344 error at /opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:773:21 TypeError: 2016-10-19 20:58:37.344 error at /opt/iobroker/node_modules/iobroker.modbus/main.js:1258:13 TypeError: 2016-10-19 20:58:37.344 error at clear (/opt/iobroker/node_modules/iobroker.modbus/main.js:1255:22) TypeError: 2016-10-19 20:58:37.344 error at Object.main.start (/opt/iobroker/node_modules/iobroker.modbus/main.js:1583:26) TypeError: 2016-10-19 20:58:37.344 error modbusClient.connect is not a function uncaught 2016-10-19 20:58:37.334 error exception: modbusClient.connect is not a function modbus-0 2016-10-19 20:58:36.299 info starting. Version 0.4.0 in /opt/iobroker/node_modules/iobroker.modbus host-orangepi-iot 2016-10-19 20:58:33.737 info instance system.adapter.modbus.0 started with pid 31857 host-orangepi-iot 2016-10-19 20:58:31.239 info instance system.adapter.modbus.0 terminated with code 0 (OK) modbus-0 2016-10-19 20:58:31.204 info terminating host-orangepi-iot 2016-10-19 20:58:31.157 info stopInstance system.adapter.modbus.0 killing pid 31773 host-orangepi-iot 2016-10-19 20:58:31.155 info stopInstance system.adapter.modbus.0 host-orangepi-iot 2016-10-19 20:58:31.145 info object change system.adapter.modbus.0 modbus-0 2016-10-19 20:58:06.901 info List of port: [{"comName":"/dev/ttyS0"},{"comName":"/dev/ttyUSB0","manufacturer":"1a86","serialNumber":"1a86_USB2.0-Serial","pnpId":"usb-1a86_USB2.0-Serial-if00-port0","vendorId":"0x1a86","productId" modbus-0 2016-10-19 20:57:53.650 warn Error: connect ECONNREFUSED 127.0.0.1:502 modbus-0 2016-10-19 20:57:52.541 info starting. Version 0.4.0 in /opt/iobroker/node_modules/iobroker.modbus iobroker 2016-10-19 20:57:49.956 info exit 0 iobroker 2016-10-19 20:57:49.936 info host.orangepi-iot object system.adapter.modbus.0 created `

          iobroker upload modbus
          

          у тебя версия старая

          У меня свисток зацепило с 0.4.1, пока нечем упровлять

          log

          inMem	2016-10-19 18:21:16.512	debug	message *.logging system.adapter.admin.0.logging val=false, ack=true, ts=1476890476494, q=0, from=system.adapter.admin.0, lc=1476890476494
          modbus-0	2016-10-19 18:21:11.815	debug	sendTo "listUart" to system.adapter.admin.0 from system.adapter.modbus.0
          modbus-0	2016-10-19 18:21:11.813	info	List of port: [{"comName":"/dev/ttyS0"},{"comName":"/dev/ttyS1"},{"comName":"/dev/ttyS2"},{"comName":"/dev/ttyS3"},{"comName":"/dev/ttyUSB0","manufacturer":"1a86","serialNumber":"1a86_USB2.0-Ser_","p
          inMem	2016-10-19 18:21:11.637	debug	message messagebox.system.adapter.modbus.0 messagebox.system.adapter.modbus.0 command=listUart, message=null, from=system.adapter.admin.0, message=null, id=244, ack=false, time=1476890471631, _id=75
          inMem	2016-10-19 18:21:10.952	debug	message *.logging system.adapter.admin.0.logging val=true, ack=true, ts=1476890470933, q=0, from=system.adapter.admin.0, lc=1476890470933
          inMem	2016-10-19 18:20:26.355	debug	message modbus.0.* modbus.0.info.pollTime val=8, ack=true, ts=1476890426342, q=0, from=system.adapter.modbus.0, lc=1476890426342
          inMem	2016-10-19 18:20:26.346	debug	message modbus.0.* modbus.0.info.connection val=true, ack=true, ts=1476890426332, q=0, from=system.adapter.modbus.0, lc=1476890426332
          modbus-0	2016-10-19 18:20:26.330	info	Connected to slave
          modbus-0	2016-10-19 18:20:25.459	info	starting. Version 0.4.1 in /opt/iobroker/node_modules/iobroker.modbus
          modbus-0	2016-10-19 18:20:25.349	debug	statesDB connected
          modbus-0	2016-10-19 18:20:25.320	debug	objectDB connected
          host-Server-PC	2016-10-19 18:20:23.522	info	instance system.adapter.modbus.0 started with pid 17789
          host-Server-PC	2016-10-19 18:20:23.480	info	object change system.adapter.modbus.0
          host-Server-PC	2016-10-19 18:19:55.221	info	object change system.adapter.modbus.0
          
          
          1 Reply Last reply Reply Quote 0
          • M
            MSapogov last edited by

            @Bluefox:

            Мы достаточно близко подошли к решению.

            Попробуй ещё раз обновиться `
            0.4.1

            Теперь COM порт запоминает!

            Я вижу появился бонус "RTU over TCP".

            Проверить работу RTU смогу только завтра (это часов через 12)

            PS: Как можно виртуалку на ESXi с USB-COM портом победить? При выборе Not available.

            ! log

            host-Bee-IoT	2016-10-19 22:57:09.443	info	stopInstance system.adapter.modbus.0 killing pid 3868
            host-Bee-IoT	2016-10-19 22:57:09.443	info	stopInstance system.adapter.modbus.0
            host-Bee-IoT	2016-10-19 22:57:09.443	info	object change system.adapter.modbus.0
            modbus-0	2016-10-19 22:56:50.658	warn	Module serialport is not available
            modbus-0	2016-10-19 22:56:44.854	error	IP address is not defined
            modbus-0	2016-10-19 22:56:44.815	warn	Serial is not available
            modbus-0	2016-10-19 22:56:44.811	info	starting. Version 0.4.1 in /opt/iobroker/node_modules/iobroker.modbus
            host-Bee-IoT	2016-10-19 22:56:44.368	info	instance system.adapter.modbus.0 started with pid 3868
            >! ````
            IOB Ubuntu
            

            root@Bee-IoT:~# lsusb
            Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
            Bus 002 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
            Bus 002 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
            Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
            Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
            Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
            root@Bee-IoT:~# ls -l /dev/ttyS* /dev/ttyUSB*
            crw-rw---- 1 root dialout 4, 64 окт 19 20:57 /dev/ttyS0
            crw-rw---- 1 root dialout 4, 65 окт 19 20:57 /dev/ttyS1
            crw-rw---- 1 root dialout 4, 74 окт 19 20:57 /dev/ttyS10
            crw-rw---- 1 root dialout 4, 75 окт 19 20:57 /dev/ttyS11
            crw-rw---- 1 root dialout 4, 76 окт 19 20:57 /dev/ttyS12
            crw-rw---- 1 root dialout 4, 77 окт 19 20:57 /dev/ttyS13
            crw-rw---- 1 root dialout 4, 78 окт 19 20:57 /dev/ttyS14
            crw-rw---- 1 root dialout 4, 79 окт 19 20:57 /dev/ttyS15
            crw-rw---- 1 root dialout 4, 80 окт 19 20:57 /dev/ttyS16
            crw-rw---- 1 root dialout 4, 81 окт 19 20:57 /dev/ttyS17
            crw-rw---- 1 root dialout 4, 82 окт 19 20:57 /dev/ttyS18
            crw-rw---- 1 root dialout 4, 83 окт 19 20:57 /dev/ttyS19
            crw-rw---- 1 root dialout 4, 66 окт 19 20:57 /dev/ttyS2
            crw-rw---- 1 root dialout 4, 84 окт 19 20:57 /dev/ttyS20
            crw-rw---- 1 root dialout 4, 85 окт 19 20:57 /dev/ttyS21
            crw-rw---- 1 root dialout 4, 86 окт 19 20:57 /dev/ttyS22
            crw-rw---- 1 root dialout 4, 87 окт 19 20:57 /dev/ttyS23
            crw-rw---- 1 root dialout 4, 88 окт 19 20:57 /dev/ttyS24
            crw-rw---- 1 root dialout 4, 89 окт 19 20:57 /dev/ttyS25
            crw-rw---- 1 root dialout 4, 90 окт 19 20:57 /dev/ttyS26
            crw-rw---- 1 root dialout 4, 91 окт 19 20:57 /dev/ttyS27
            crw-rw---- 1 root dialout 4, 92 окт 19 20:57 /dev/ttyS28
            crw-rw---- 1 root dialout 4, 93 окт 19 20:57 /dev/ttyS29
            crw-rw---- 1 root dialout 4, 67 окт 19 20:57 /dev/ttyS3
            crw-rw---- 1 root dialout 4, 94 окт 19 20:57 /dev/ttyS30
            crw-rw---- 1 root dialout 4, 95 окт 19 20:57 /dev/ttyS31
            crw-rw---- 1 root dialout 4, 68 окт 19 20:57 /dev/ttyS4
            crw-rw---- 1 root dialout 4, 69 окт 19 20:57 /dev/ttyS5
            crw-rw---- 1 root dialout 4, 70 окт 19 20:57 /dev/ttyS6
            crw-rw---- 1 root dialout 4, 71 окт 19 20:57 /dev/ttyS7
            crw-rw---- 1 root dialout 4, 72 окт 19 20:57 /dev/ttyS8
            crw-rw---- 1 root dialout 4, 73 окт 19 20:57 /dev/ttyS9
            crw-rw---- 1 root dialout 188, 0 окт 19 22:55 /dev/ttyUSB0
            crw-rw---- 1 root dialout 188, 1 окт 19 22:55 /dev/ttyUSB1
            root@Bee-IoT:~#

            ! ````

            1 Reply Last reply Reply Quote 0
            • M
              MSapogov last edited by

              @Haus:

              у тебя версия старая

              У меня свисток зацепило с 0.4.1, пока нечем упровлять `
              На тот момент была только 0.4.0 (с доработками)

              А у тебя IOB локально работает или на виртуалке?

              И как свисток свисток подключен к IOB?

              1 Reply Last reply Reply Quote 0
              • H
                Haus last edited by

                @MSapogov:

                @Haus:

                у тебя версия старая

                У меня свисток зацепило с 0.4.1, пока нечем упровлять `
                На тот момент была только 0.4.0 (с доработками)

                А у тебя IOB локально работает или на виртуалке?

                И как свисток свисток подключен к IOB? `
                ioBroker локально работает, USB-RS485 настройка /dev/ttyUSB2. ttyUSB0 и ttyUSB1 мастера 1-wite.

                1 Reply Last reply Reply Quote 0
                • M
                  MSapogov last edited by

                  Serial RTU - на сколько смог проверил. (пока одно устройство ID 5 на arduino и 9 Holding регистров)

                  Работает…

                  Странно, если разорвать RS-485, а потом обратно соединить, то опрос невзобновляется. (Recconect time - 60000 ms)

                  В логах````
                  modbus-0 2016-10-20 10:27:07.660 warn Poll error count: 1 code: {"err":"timeout"}

                  Приходится перезапускать драйвер.
                  1 Reply Last reply Reply Quote 0
                  • Bluefox
                    Bluefox last edited by

                    @MSapogov:

                    Serial RTU - на сколько смог проверил. (пока одно устройство ID 5 на arduino и 9 Holding регистров)

                    Работает…

                    Странно, если разорвать RS-485, а потом обратно соединить, то опрос невзобновляется. (Recconect time - 60000 ms)

                    В логах````
                    modbus-0 2016-10-20 10:27:07.660 warn Poll error count: 1 code: {"err":"timeout"}

                    Приходится перезапускать драйвер. `  
                    

                    Попробуй ещё раз обновиться.

                    1 Reply Last reply Reply Quote 0
                    • M
                      MSapogov last edited by

                      @Bluefox:

                      @MSapogov:

                      Странно, если разорвать RS-485, а потом обратно соединить, то опрос невзобновляется. (Recconect time - 60000 ms)

                      В логах````
                      modbus-0 2016-10-20 10:27:07.660 warn Poll error count: 1 code: {"err":"timeout"}

                      Приходится перезапускать драйвер. `  
                      

                      Попробуй ещё раз обновиться. `
                      0.4.2

                      Ждал 5 минут, опросы не взобновились.

                      Я только разрываю линию RS-485.

                      Кажется когда эксперементировал с ModbusTCP то при разрыве WiFi было так-же.

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

                        Добрый день всем.

                        Столкнулся со странной штукой - установлен драйвер 0.4.5, хочу затащить в IOB данные с контроллера datakom via Modbus RTU.

                        Для чего через socat был поднят виртуальный serial порт в системе (виртуалка VurtualBox).

                        Тестовая утилитка modpoll видит устройство через виртуальный порт и прекрасно получает данные:

                        ./modpoll -m rtu -a 1 -t 4 -r 48 -b 9600 -p none /dev/ttyvir0
                        
                        

                        ! modpoll 3.4 - FieldTalk™ Modbus(R) Master Simulator
                        ! Copyright (c) 2002-2013 proconX Pty Ltd
                        ! Visit http://www.modbusdriver.com for Modbus libraries and tools.
                        ! Protocol configuration: Modbus RTU
                        ! Slave configuration...: address = 1, start reference = 48, count = 1
                        ! Communication.........: /dev/ttyvir0, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
                        ! Data type.............: 16-bit register, output (holding) register table
                        ! -- Polling slave... (Ctrl-C to stop)
                        ! [48]: 120
                        ! – Polling slave... (Ctrl-C to stop)
                        ! [48]: 120
                        ! – Polling slave... (Ctrl-C to stop)
                        ! [48]: 120
                        ! – Polling slave... (Ctrl-C to stop)
                        ! [48]: 120
                        Но тут мое счастье и закончилось. Драйвер не видит этот порт в упор в списке. Права 666 не помогли.

                        Решил немного обмануть драйвер, сделал виртуальный порт как ttyS33. Результат - драйвер не видит ничего вообще. В списке undefined.

                        Как пофиксить, никто не знает?

                        1 Reply Last reply Reply Quote 0
                        • Bluefox
                          Bluefox last edited by

                          Можешь создать в папке node_modules/iobroker.modbus файл port.js:

                          var serialport = require('serialport');
                          serialport.list(function (err, ports) {
                          	console.log(JSON.stringify(ports, null, 2));
                          	process.exit();
                          });
                          
                          

                          Запустить его из консоли node port.js

                          Вот что я вижу:

                          C:\ioBroker\node_modules\ioBroker.modbus>node port.js
                          [
                            {
                              "comName": "COM3",
                              "manufacturer": "Intel",
                              "pnpId": "PCI\\VEN_8086&DEV_1E3D&SUBSYS_ABCDED&REV_04\\3&11583666&0&B3"
                            },
                            {
                              "comName": "COM1",
                              "manufacturer": "(����������� �����)",
                              "pnpId": "ACPI\\PNP0501\\1"
                            }
                          ]
                          

                          А у тебя?

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

                            @Bluefox:

                            Можешь создать в папке node_modules/iobroker.modbus файл port.js:

                            …..

                            А у тебя? `

                            А у меня вот что:

                            ! root@spy-sh:/opt/iobroker/node_modules/iobroker.modbus# node ./port.js
                            ! (node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
                            ! (node) and will stop working in the next major release.
                            ! ==== JS stack trace =========================================
                            ! Security context: 0x310f666cfb51 <js object="">#0#
                            ! 1: .node [module.js:583] [pc=0x1fb2eb572ec4] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x92652d61fc1 <a module/with/map/0x285de601b7a9="">#2#,filename=0x92652d5f239 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 2: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x92652d61fc1</string[96]:></a> <a module/with/map/0x285de601b7a9="">#2#,filename=0x92652d5f239 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 3: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x92652d61fc1</undefined></string[96]:></a> <a module/with/map/0x285de601b7a9="">#2#,filename=0x92652d5f239 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 4: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x92652d5e1e9 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">,parent=0x92652d4ded1</string[96]:></js></string[96]:></a> <a module/with/map/0x285de601b7a9="">#4#,isMain=0x310f66604271 <false>)
                            ! 5: require [module.js:483] [pc=0x1fb2eb546d93] (this=0x92652d4ded1</false></a> <a module/with/map/0x285de601b7a9="">#4#,path=0x92652d5e1e9 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 6: require(aka require) [internal/module.js:20] [pc=0x1fb2eb546ac6] (this=0x310f66604381 <undefined>,path=0x92652d5e1e9 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 7: bindings [/opt/iobroker/node_modules/iobroker.modbus/node_modules/serialport/node_modules/bindings/bindings.js:76] [pc=0x1fb2eb56e3f6] (this=0x310f666e60e1 <js global/object="">#5#,opts=0x12e371ba7c61 <string[15]: serialport.node="">)
                            ! 8: /* anonymous / [/opt/iobroker/node_modules/iobroker.modbus/node_modules/serialport/lib/bindings.js:3] [pc=0x1fb2eb56cf0e] (this=0x92652d45ef9 <an object/with/map/0xc8c151075e9="">#6#,exports=0x92652d45ef9 <an object/with/map/0xc8c151075e9="">#6#,require=0x92652d47551 <js function/require/(sharedfunctioninfo/0x12e371b5d751)="">#7#,module=0x92652d45ea9</js></an></an></string[15]:></js></string[96]:></undefined></string[96]:></a> <a module/with/map/0x285de601b7a9="">#8#,__filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">,__dirname=0x92652d474e9 <string[70]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib="">)
                            ! 9: _compile [module.js:556] [pc=0x1fb2eb546270] (this=0x92652d45ea9</string[70]:></string[82]:></a> <a module/with/map/0x285de601b7a9="">#8#,content=0x92652d46b01 <string[784]: 'use/strict';\n\nvar/bindings="require('bindings')('serialport.node');\nvar" listunix="require('./list-unix');\n\nvar" linux="process.platform" !="=" 'win32'/&&/process.platform/'darwin';\n\nfunction/listlinux(callback)/{\n/callback="callback" ||/function(err)/if/(err)/{/this.emit('error',/err)/}\n/}.bind(this);\n/return/listunix(callback);\n};\n\nvar/platformoptions="{};\nif" (process.platform/'win32')/vmin:/1,\n/vtime:/0\n/};\n}\n\nmodule.exports="{\n" close:/bindings.close,\n/drain:/bindings.drain,\n/flush:/bindings.flush,\n/list:/?/listlinux/:/bindings.list,\n/open:/bindings.open,\n/serialportpoller:/bindings.serialportpoller,\n/set:/bindings.set,\n/update:/bindings.update,\n/write:/bindings.write,\n/platformoptions:/platformoptions\n};\n="">,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 10: .js [module.js:565] [pc=0x1fb2eb53f4eb] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x92652d45ea9</an></string[82]:></string[784]:></a> <a module/with/map/0x285de601b7a9="">#8#,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 11: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x92652d45ea9</string[82]:></a> <a module/with/map/0x285de601b7a9="">#8#,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 12: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x92652d45ea9</undefined></string[82]:></a> <a module/with/map/0x285de601b7a9="">#8#,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 13: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x12e371b61659 <string[10]: ./bindings="">,parent=0x2c52d40056b9</string[10]:></js></string[82]:></a> <a module/with/map/0x285de601b7a9="">#9#,isMain=0x310f66604271 <false>)
                            ! 14: require [module.js:483] [pc=0x1fb2eb546d93] (this=0x2c52d40056b9</false></a> <a module/with/map/0x285de601b7a9="">#9#,path=0x12e371b61659 <string[10]: ./bindings="">)
                            ! 15: require(aka require) [internal/module.js:20] [pc=0x1fb2eb546ac6] (this=0x310f66604381 <undefined>,path=0x12e371b61659 <string[10]: ./bindings="">)
                            ! 16: /
                            anonymous / [/opt/iobroker/node_modules/iobroker.modbus/node_modules/serialport/lib/serialport.js:16] [pc=0x1fb2eb54b32e] (this=0x2c52d40059f1 <an object/with/map/0xc8c151075e9="">#10#,exports=0x2c52d40059f1 <an object/with/map/0xc8c151075e9="">#10#,require=0x2c52d40057c9 <js function/require/(sharedfunctioninfo/0x12e371b5d751)="">#11#,module=0x2c52d40056b9</js></an></an></string[10]:></undefined></string[10]:></a> <a module/with/map/0x285de601b7a9="">#9#,__filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">,__dirname=0x2c52d4005959 <string[70]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib="">)
                            ! 17: _compile [module.js:556] [pc=0x1fb2eb546270] (this=0x2c52d40056b9</string[70]:></string[84]:></a> <a module/with/map/0x285de601b7a9="">#9#,content=0x2c52d4008f99 <very long/string[13557]="">#12#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 18: .js [module.js:565] [pc=0x1fb2eb53f4eb] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x2c52d40056b9</an></string[84]:></very></a> <a module/with/map/0x285de601b7a9="">#9#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 19: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x2c52d40056b9</string[84]:></a> <a module/with/map/0x285de601b7a9="">#9#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 20: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x2c52d40056b9</undefined></string[84]:></a> <a module/with/map/0x285de601b7a9="">#9#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 21: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x12e371b5d0d1 <string[10]: serialport="">,parent=0x2c52d400c4c9</string[10]:></js></string[84]:></a> <a module/with/map/0x285de601b7a9="">#13#,isMain=0x310f66604271 <false>)
                            ! 22: require [module.js:483] [pc=0x1fb2eb546d93] (this=0x2c52d400c4c9</false></a> <a module/with/map/0x285de601b7a9="">#13#,path=0x12e371b5d0d1 <string[10]: serialport="">)
                            ! 23: require(aka require) [internal/module.js:20] [pc=0x1fb2eb546ac6] (this=0x310f66604381 <undefined>,path=0x12e371b5d0d1 <string[10]: serialport="">)
                            ! 24: /
                            anonymous / [/opt/iobroker/node_modules/iobroker.modbus/port.js:1] [pc=0x1fb2eb54653f] (this=0x2c52d400c699 <an object/with/map/0xc8c151075e9="">#14#,exports=0x2c52d400c699 <an object/with/map/0xc8c151075e9="">#14#,require=0x2c52d400c591 <js function/require/(sharedfunctioninfo/0x12e371b5d751)="">#15#,module=0x2c52d400c4c9</js></an></an></string[10]:></undefined></string[10]:></a> <a module/with/map/0x285de601b7a9="">#13#,__filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">,__dirname=0x2c52d400c621 <string[42]: opt/iobroker/node_modules/iobroker.modbus="">)
                            ! 25: _compile [module.js:556] [pc=0x1fb2eb546270] (this=0x2c52d400c4c9</string[42]:></string[50]:></a> <a module/with/map/0x285de601b7a9="">#13#,content=0x2c52d400c7e9 <string[151]: var/serialport="require('serialport');\nserialport.list(function" (err,/ports)/{\n/console.log(json.stringify(ports,/null,/2));\n/process.exit();\n});\n="">,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 26: .js [module.js:565] [pc=0x1fb2eb53f4eb] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x2c52d400c4c9</an></string[50]:></string[151]:></a> <a module/with/map/0x285de601b7a9="">#13#,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 27: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x2c52d400c4c9</string[50]:></a> <a module/with/map/0x285de601b7a9="">#13#,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 28: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x2c52d400c4c9</undefined></string[50]:></a> <a module/with/map/0x285de601b7a9="">#13#,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 29: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x12e371b53209 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">,parent=0x310f66604201 <null>,isMain=0x310f666043c1 <true>)
                            ! 30: /
                            anonymous /(aka / anonymous /) [module.js:590] [pc=0x1fb2eb534cea] (this=0x310f66604381 <undefined>)
                            ! 31: run(aka run) [bootstrap_node.js:394] [pc=0x1fb2eb534b68] (this=0x310f66604381 <undefined>,entryFunction=0x12e371b51381 <js function/module.runmain/(sharedfunctioninfo/0x12e371b2cc19)="">#16#)
                            ! 32: startup(aka startup) [bootstrap_node.js:149] [pc=0x1fb2eb4448f2] (this=0x310f66604381 <undefined>)
                            ! 33: /
                            anonymous /(aka / anonymous /) [bootstrap_node.js:509] [pc=0x1fb2eb44274e] (this=0x310f66604201 <null>,process=0x310f666e1949</null></undefined></js></undefined></undefined></true></null></string[50]:></js></string[50]:></a> <a process/with/map/0xc8c15111619="">#17#)
                            ! =====================
                            ! ==== C stack trace ===============================
                            ! 1: v8::Template::Set(v8::Localv8::name, v8::Localv8::data, v8::PropertyAttribute)
                            ! 2: SerialportPoller::Init(v8::Localv8::object)
                            ! 3: init
                            ! 4: node::DLOpen(v8::FunctionCallbackInfo v8::valueconst&)
                            ! 5: v8::internal::FunctionCallbackArguments::Call(void (
                            )(v8::FunctionCallbackInfo v8::valueconst&))
                            ! 6: 0x9ee352
                            ! 7: 0x9eeb7e
                            ! 8: 0x1fb2eb4092a7
                            ! (node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
                            ! (node) and will stop working in the next major release.
                            ! ==== JS stack trace =========================================
                            ! Security context: 0x310f666cfb51 <js object="">#0#
                            ! 1: .node [module.js:583] [pc=0x1fb2eb572ec4] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x92652d61fc1</an></js></v8::value></v8::value></v8::object></v8::data></v8::name></a> <a module/with/map/0x285de601b7a9="">#2#,filename=0x92652d5f239 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 2: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x92652d61fc1</string[96]:></a> <a module/with/map/0x285de601b7a9="">#2#,filename=0x92652d5f239 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 3: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x92652d61fc1</undefined></string[96]:></a> <a module/with/map/0x285de601b7a9="">#2#,filename=0x92652d5f239 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 4: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x92652d5e1e9 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">,parent=0x92652d4ded1</string[96]:></js></string[96]:></a> <a module/with/map/0x285de601b7a9="">#4#,isMain=0x310f66604271 <false>)
                            ! 5: require [module.js:483] [pc=0x1fb2eb546d93] (this=0x92652d4ded1</false></a> <a module/with/map/0x285de601b7a9="">#4#,path=0x92652d5e1e9 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 6: require(aka require) [internal/module.js:20] [pc=0x1fb2eb546ac6] (this=0x310f66604381 <undefined>,path=0x92652d5e1e9 <string[96]: opt/iobroker/node_modules/iobroker.modbus/serialport/build/release/serialport.node="">)
                            ! 7: bindings [/opt/iobroker/node_modules/iobroker.modbus/node_modules/serialport/node_modules/bindings/bindings.js:76] [pc=0x1fb2eb56e3f6] (this=0x310f666e60e1 <js global/object="">#5#,opts=0x12e371ba7c61 <string[15]: serialport.node="">)
                            ! 8: /* anonymous / [/opt/iobroker/node_modules/iobroker.modbus/node_modules/serialport/lib/bindings.js:3] [pc=0x1fb2eb56cf0e] (this=0x92652d45ef9 <an object/with/map/0xc8c151075e9="">#6#,exports=0x92652d45ef9 <an object/with/map/0xc8c151075e9="">#6#,require=0x92652d47551 <js function/require/(sharedfunctioninfo/0x12e371b5d751)="">#7#,module=0x92652d45ea9</js></an></an></string[15]:></js></string[96]:></undefined></string[96]:></a> <a module/with/map/0x285de601b7a9="">#8#,__filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">,__dirname=0x92652d474e9 <string[70]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib="">)
                            ! 9: _compile [module.js:556] [pc=0x1fb2eb546270] (this=0x92652d45ea9</string[70]:></string[82]:></a> <a module/with/map/0x285de601b7a9="">#8#,content=0x92652d46b01 <string[784]: 'use/strict';\n\nvar/bindings="require('bindings')('serialport.node');\nvar" listunix="require('./list-unix');\n\nvar" linux="process.platform" !="=" 'win32'/&&/process.platform/'darwin';\n\nfunction/listlinux(callback)/{\n/callback="callback" ||/function(err)/if/(err)/{/this.emit('error',/err)/}\n/}.bind(this);\n/return/listunix(callback);\n};\n\nvar/platformoptions="{};\nif" (process.platform/'win32')/vmin:/1,\n/vtime:/0\n/};\n}\n\nmodule.exports="{\n" close:/bindings.close,\n/drain:/bindings.drain,\n/flush:/bindings.flush,\n/list:/?/listlinux/:/bindings.list,\n/open:/bindings.open,\n/serialportpoller:/bindings.serialportpoller,\n/set:/bindings.set,\n/update:/bindings.update,\n/write:/bindings.write,\n/platformoptions:/platformoptions\n};\n="">,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 10: .js [module.js:565] [pc=0x1fb2eb53f4eb] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x92652d45ea9</an></string[82]:></string[784]:></a> <a module/with/map/0x285de601b7a9="">#8#,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 11: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x92652d45ea9</string[82]:></a> <a module/with/map/0x285de601b7a9="">#8#,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 12: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x92652d45ea9</undefined></string[82]:></a> <a module/with/map/0x285de601b7a9="">#8#,filename=0x92652d43d31 <string[82]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/bindings.js="">)
                            ! 13: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x12e371b61659 <string[10]: ./bindings="">,parent=0x2c52d40056b9</string[10]:></js></string[82]:></a> <a module/with/map/0x285de601b7a9="">#9#,isMain=0x310f66604271 <false>)
                            ! 14: require [module.js:483] [pc=0x1fb2eb546d93] (this=0x2c52d40056b9</false></a> <a module/with/map/0x285de601b7a9="">#9#,path=0x12e371b61659 <string[10]: ./bindings="">)
                            ! 15: require(aka require) [internal/module.js:20] [pc=0x1fb2eb546ac6] (this=0x310f66604381 <undefined>,path=0x12e371b61659 <string[10]: ./bindings="">)
                            ! 16: /
                            anonymous / [/opt/iobroker/node_modules/iobroker.modbus/node_modules/serialport/lib/serialport.js:16] [pc=0x1fb2eb54b32e] (this=0x2c52d40059f1 <an object/with/map/0xc8c151075e9="">#10#,exports=0x2c52d40059f1 <an object/with/map/0xc8c151075e9="">#10#,require=0x2c52d40057c9 <js function/require/(sharedfunctioninfo/0x12e371b5d751)="">#11#,module=0x2c52d40056b9</js></an></an></string[10]:></undefined></string[10]:></a> <a module/with/map/0x285de601b7a9="">#9#,__filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">,__dirname=0x2c52d4005959 <string[70]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib="">)
                            ! 17: _compile [module.js:556] [pc=0x1fb2eb546270] (this=0x2c52d40056b9</string[70]:></string[84]:></a> <a module/with/map/0x285de601b7a9="">#9#,content=0x2c52d4008f99 <very long/string[13557]="">#12#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 18: .js [module.js:565] [pc=0x1fb2eb53f4eb] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x2c52d40056b9</an></string[84]:></very></a> <a module/with/map/0x285de601b7a9="">#9#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 19: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x2c52d40056b9</string[84]:></a> <a module/with/map/0x285de601b7a9="">#9#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 20: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x2c52d40056b9</undefined></string[84]:></a> <a module/with/map/0x285de601b7a9="">#9#,filename=0x2c52d4005981 <string[84]: opt/iobroker/node_modules/iobroker.modbus/serialport/lib/serialport.js="">)
                            ! 21: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x12e371b5d0d1 <string[10]: serialport="">,parent=0x2c52d400c4c9</string[10]:></js></string[84]:></a> <a module/with/map/0x285de601b7a9="">#13#,isMain=0x310f66604271 <false>)
                            ! 22: require [module.js:483] [pc=0x1fb2eb546d93] (this=0x2c52d400c4c9</false></a> <a module/with/map/0x285de601b7a9="">#13#,path=0x12e371b5d0d1 <string[10]: serialport="">)
                            ! 23: require(aka require) [internal/module.js:20] [pc=0x1fb2eb546ac6] (this=0x310f66604381 <undefined>,path=0x12e371b5d0d1 <string[10]: serialport="">)
                            ! 24: /
                            anonymous / [/opt/iobroker/node_modules/iobroker.modbus/port.js:1] [pc=0x1fb2eb54653f] (this=0x2c52d400c699 <an object/with/map/0xc8c151075e9="">#14#,exports=0x2c52d400c699 <an object/with/map/0xc8c151075e9="">#14#,require=0x2c52d400c591 <js function/require/(sharedfunctioninfo/0x12e371b5d751)="">#15#,module=0x2c52d400c4c9</js></an></an></string[10]:></undefined></string[10]:></a> <a module/with/map/0x285de601b7a9="">#13#,__filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">,__dirname=0x2c52d400c621 <string[42]: opt/iobroker/node_modules/iobroker.modbus="">)
                            ! 25: _compile [module.js:556] [pc=0x1fb2eb546270] (this=0x2c52d400c4c9</string[42]:></string[50]:></a> <a module/with/map/0x285de601b7a9="">#13#,content=0x2c52d400c7e9 <string[151]: var/serialport="require('serialport');\nserialport.list(function" (err,/ports)/{\n/console.log(json.stringify(ports,/null,/2));\n/process.exit();\n});\n="">,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 26: .js [module.js:565] [pc=0x1fb2eb53f4eb] (this=0x2c52d4005619 <an object/with/map/0x285de601a889="">#1#,module=0x2c52d400c4c9</an></string[50]:></string[151]:></a> <a module/with/map/0x285de601b7a9="">#13#,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 27: load [module.js:473] [pc=0x1fb2eb53df12] (this=0x2c52d400c4c9</string[50]:></a> <a module/with/map/0x285de601b7a9="">#13#,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 28: tryModuleLoad(aka tryModuleLoad) [module.js:432] [pc=0x1fb2eb53da3d] (this=0x310f66604381 <undefined>,module=0x2c52d400c4c9</undefined></string[50]:></a> <a module/with/map/0x285de601b7a9="">#13#,filename=0x2c52d400c649 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">)
                            ! 29: _load [module.js:424] [pc=0x1fb2eb535222] (this=0x2c52d4005741 <js function/module/(sharedfunctioninfo/0x12e371b2be99)="">#3#,request=0x12e371b53209 <string[50]: opt/iobroker/node_modules/iobroker.modbus/port.js="">,parent=0x310f66604201 <null>,isMain=0x310f666043c1 <true>)
                            ! 30: /
                            anonymous /(aka / anonymous /) [module.js:590] [pc=0x1fb2eb534cea] (this=0x310f66604381 <undefined>)
                            ! 31: run(aka run) [bootstrap_node.js:394] [pc=0x1fb2eb534b68] (this=0x310f66604381 <undefined>,entryFunction=0x12e371b51381 <js function/module.runmain/(sharedfunctioninfo/0x12e371b2cc19)="">#16#)
                            ! 32: startup(aka startup) [bootstrap_node.js:149] [pc=0x1fb2eb4448f2] (this=0x310f66604381 <undefined>)
                            ! 33: /
                            anonymous /(aka / anonymous /) [bootstrap_node.js:509] [pc=0x1fb2eb44274e] (this=0x310f66604201 <null>,process=0x310f666e1949</null></undefined></js></undefined></undefined></true></null></string[50]:></js></string[50]:></a> <a process/with/map/0xc8c15111619="">#17#)
                            ! =====================
                            ! ==== C stack trace ===============================
                            ! 1: v8::Template::Set(v8::Localv8::name, v8::Localv8::data, v8::PropertyAttribute)
                            ! 2: SerialportPoller::Init(v8::Localv8::object)
                            ! 3: init
                            ! 4: node::DLOpen(v8::FunctionCallbackInfo v8::valueconst&)
                            ! 5: v8::internal::FunctionCallbackArguments::Call(void (
                            )(v8::FunctionCallbackInfo v8::valueconst&))
                            ! 6: 0x9ee352
                            ! 7: 0x9eeb7e
                            ! 8: 0x1fb2eb4092a7
                            ! undefined</v8::value></v8::value></v8::object></v8::data></v8::name></a></an></js>

                            1 Reply Last reply Reply Quote 0
                            • M
                              MSapogov last edited by

                              @Bluefox:

                              Можешь создать в папке node_modules/iobroker.modbus файл port.js:

                              var serialport = require('serialport');
                              serialport.list(function (err, ports) {
                              	console.log(JSON.stringify(ports, null, 2));
                              	process.exit();
                              });
                              
                              

                              Запустить его из консоли `
                              У меня вывод такой на ESXi
                              ! root@Bee-IoT:/opt/iobroker/node_modules/iobroker.modbus# node port.js:

                              module.js:327
                                  throw err;
                                  ^
                              >! Error: Cannot find module 'serialport'
                                  at Function.Module._resolveFilename (module.js:325:15)
                                  at Function.Module._load (module.js:276:25)
                                  at Module.require (module.js:353:17)
                                  at require (internal/module.js:12:17)
                                  at Object. <anonymous>(/opt/iobroker/node_modules/iobroker.modbus/port.js:1:80)
                                  at Module._compile (module.js:409:26)
                                  at Object.Module._extensions..js (module.js:416:10)
                                  at Module.load (module.js:343:32)
                                  at Function.Module._load (module.js:300:12)
                                  at Function.Module.runMain (module.js:441:10)</anonymous> 
                              

                              root@Bee-IoT:/opt/iobroker/node_modules/iobroker.modbus# lsusb -````
                              Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
                              Bus 002 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
                              Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
                              Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
                              Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

                              ! ````
                              root@Bee-IoT:/opt/iobroker/node_modules/iobroker.modbus# node -v
                              ! v4.5.0
                              ! PS: полазил по папкам внутри драйвера…. запустил
                              ! root@Bee-IoT:/opt/iobroker/node_modules/iobroker.modbus/node_modules/jsmodbus/node_modules/serialport/bin# ./serialport-list.js

                              /dev/ttyS0
                              /dev/ttyS1
                              /dev/ttyS10
                              /dev/ttyS11
                              /dev/ttyS12
                              /dev/ttyS13
                              /dev/ttyS14
                              /dev/ttyS15
                              /dev/ttyS16
                              /dev/ttyS17
                              /dev/ttyS18
                              /dev/ttyS19
                              /dev/ttyS2
                              /dev/ttyS20
                              /dev/ttyS21
                              /dev/ttyS22
                              /dev/ttyS23
                              /dev/ttyS24
                              /dev/ttyS25
                              /dev/ttyS26
                              /dev/ttyS27
                              /dev/ttyS28
                              /dev/ttyS29
                              /dev/ttyS3
                              /dev/ttyS30
                              /dev/ttyS31
                              /dev/ttyS4
                              /dev/ttyS5
                              /dev/ttyS6
                              /dev/ttyS7
                              /dev/ttyS8
                              /dev/ttyS9
                              /dev/ttyUSB0    usb-1a86_USB2.0-Serial-if00-port0       1a86
                              
                              1 Reply Last reply Reply Quote 0
                              • V
                                VictorS last edited by

                                @Bluefox:

                                Можешь создать в папке node_modules/iobroker.modbus файл port.js:

                                ….

                                А у тебя? `

                                Насколько я понимаю Вы имеете отношение к разработке данного драйвера? Если так - можно ли дать возможность прямого ввода имени порта, не из списка? Может это поможет?

                                Есть подозрение что либа которая работает с serial devices (serialport) обламывается при попытке получить какие-то конфигурационные данные с порта, драйвер которого работает не на уровне kernel.

                                Или подскажите где настройки на порт лежат, может туда можно в ручном режиме внести информацию о нестандартном порте.

                                1 Reply Last reply Reply Quote 0
                                • Bluefox
                                  Bluefox last edited by

                                  @VictorS:

                                  @Bluefox:

                                  Можешь создать в папке node_modules/iobroker.modbus файл port.js:

                                  ….

                                  А у тебя? `

                                  Насколько я понимаю Вы имеете отношение к разработке данного драйвера? Если так - можно ли дать возможность прямого ввода имени порта, не из списка? Может это поможет?

                                  Есть подозрение что либа которая работает с serial devices (serialport) обламывается при попытке получить какие-то конфигурационные данные с порта, драйвер которого работает не на уровне kernel.

                                  Или подскажите где настройки на порт лежат, может туда можно в ручном режиме внести информацию о нестандартном порте. `
                                  Попробуй так
                                  48_2016-11-01_10_25_30-minozw___________-_microsoft_visual_studio.png

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

                                    @Bluefox:

                                    @VictorS:

                                    @Bluefox:

                                    Можешь создать в папке node_modules/iobroker.modbus файл port.js:

                                    ….

                                    А у тебя? `

                                    Насколько я понимаю Вы имеете отношение к разработке данного драйвера? Если так - можно ли дать возможность прямого ввода имени порта, не из списка? Может это поможет?

                                    Есть подозрение что либа которая работает с serial devices (serialport) обламывается при попытке получить какие-то конфигурационные данные с порта, драйвер которого работает не на уровне kernel.

                                    Или подскажите где настройки на порт лежат, может туда можно в ручном режиме внести информацию о нестандартном порте. Попробуй так

                                    Попробовал. Порт внес в ручном режимы, но в ответ в логах:

                                    ! host-spy-sh 2016-11-01 14:49:54.569 error instance system.adapter.modbus.0 terminated with code 0 (OK)
                                    ! modbus-0 2016-11-01 14:49:54.556 info terminating
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Socket.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/component-emitter/index.js:134:20)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Manager.ondata (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:323:16)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Decoder.add (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/socket.io-parser/index.js:247:12)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Decoder.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/socket.io-parser/node_modules/component-emitter/index.js:134:20)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Decoder. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Manager.ondecoded (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:333:8)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Manager.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-emitter/index.js:131:20)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Manager. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/node_modules/component-bind/index.js:21:15)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Socket.onpacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:229:12)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Socket.onack (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:305:9)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:707:35)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at /opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:773:21
                                    ! TypeError: 2016-11-01 14:49:54.530 error at /opt/iobroker/node_modules/iobroker.modbus/main.js:1332:13
                                    ! TypeError: 2016-11-01 14:49:54.530 error at clear (/opt/iobroker/node_modules/iobroker.modbus/main.js:1328:22)
                                    ! TypeError: 2016-11-01 14:49:54.530 error at Object.start (/opt/iobroker/node_modules/iobroker.modbus/main.js:1738:25)
                                    ! TypeError: 2016-11-01 14:49:54.530 error Cannot read property 'on' of null
                                    ! uncaught 2016-11-01 14:49:54.529 error exception: Cannot read property 'on' of null
                                    ! modbus-0 2016-11-01 14:49:54.521 error Cannot open port "/dev/ttyvirt1" [9600]: TypeError: Cannot read property 'complete' of undefined
                                    ! modbus-0 2016-11-01 14:49:54.171 info starting. Version 0.4.5 in /opt/iobroker/node_modules/iobroker.modbus

                                    Возможно проблема как раз кроется в этой ошибке: Cannot read property 'complete' of undefined

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

                                      Добрый день,

                                      отчетик по проблеме с виртуальным драйвером serial порта и modbus драйвером к IOB.

                                      Проблема описана вот тут: http://stackoverflow.com/questions/3232 … up-in-list

                                      И кроется в каком-то внутреннем нежелании либы serialport работать с портами сделанными socat и не только.

                                      Поскольку времени (да и особого опыта в JS) ковырять чужие либы нету, был найден workarround, а именно - устанавливаем на сервере IOB шлюз Modbus RTU <-> Modbus RTU over TCP. http://mbus.sourceforge.net/index.html

                                      В результате шлюз общается в serial созданным socat, а драйвер IOB modbus видит данные с шлюза по протоколу TCP или RTU over TCP (работают оба варианта).

                                      Может кому-то пригодится

                                      1 Reply Last reply Reply Quote 0
                                      • Bluefox
                                        Bluefox last edited by

                                        @VictorS:

                                        Добрый день,

                                        отчетик по проблеме с виртуальным драйвером serial порта и modbus драйвером к IOB.

                                        Проблема описана вот тут: http://stackoverflow.com/questions/3232 … up-in-list

                                        И кроется в каком-то внутреннем нежелании либы serialport работать с портами сделанными socat и не только.

                                        Поскольку времени (да и особого опыта в JS) ковырять чужие либы нету, был найден workarround, а именно - устанавливаем на сервере IOB шлюз Modbus RTU <-> Modbus RTU over TCP. http://mbus.sourceforge.net/index.html

                                        В результате шлюз общается в serial созданным socat, а драйвер IOB modbus видит данные с шлюза по протоколу TCP или RTU over TCP (работают оба варианта).

                                        Может кому-то пригодится `
                                        Отличная новость. Мне надо внести это решение в readme.md

                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          MSapogov last edited by

                                          @VictorS:

                                          Добрый день,

                                          отчетик по проблеме с виртуальным драйвером serial порта и modbus драйвером к IOB.

                                          Проблема описана вот тут: http://stackoverflow.com/questions/3232 … up-in-list

                                          И кроется в каком-то внутреннем нежелании либы serialport работать с портами сделанными socat и не только.

                                          Поскольку времени (да и особого опыта в JS) ковырять чужие либы нету, был найден workarround, а именно - устанавливаем на сервере IOB шлюз Modbus RTU <-> Modbus RTU over TCP. http://mbus.sourceforge.net/index.html

                                          В результате шлюз общается в serial созданным socat, а драйвер IOB modbus видит данные с шлюза по протоколу TCP или RTU over TCP (работают оба варианта).

                                          Может кому-то пригодится `
                                          Скомпилил…

                                          Запускаю - mbusd -p /dev/ttyUSB0 -s 9600 -m 8N1 -P 502

                                          И теперь работает!!! Даже после разрыва RS-485 и восстановлении связи опрос продолжается.

                                          Даже после перезапуска mbusd опрос взобновляется через Reconnect time в настройках.

                                          Спасибо!

                                          PS: Правильно ли я понял, что если я буду добавлять еще устройства на эту линию RS-485 в паралель, с другими ID, то мне необходимо добавлять еще драйвера modbus.1, modbus.2 и.т.д. Со своими настройками для каждго устройства, интервал опроса, Reconnect time ...

                                          А параметрах соединения TCP, Адресс, порт, и тип Master остаются неизменными?

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

                                            @MSapogov:

                                            PS: Правильно ли я понял, что если я буду добавлять еще устройства на эту линию RS-485 в паралель, с другими ID, то мне необходимо добавлять еще драйвера modbus.1, modbus.2 и.т.д. Со своими настройками для каждго устройства, интервал опроса, Reconnect time …

                                            А параметрах соединения TCP, Адресс, порт, и тип Master остаются неизменными? `

                                            Да, так и есть. Для каждого Modbus ID свой экземпляр драйвера. Сам mbusd поддерживает несколько одновременных TCP-соединений.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            770
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

                                            25
                                            174
                                            48637
                                            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