Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Node-RED
  4. node-red-contrib-mysensors release thread

node-red-contrib-mysensors release thread

Scheduled Pinned Locked Moved Node-RED
36 Posts 6 Posters 5.6k Views 8 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ThucarT Offline
    ThucarT Offline
    Thucar
    wrote on last edited by
    #8

    Awesome work! I was trying to create a bridge between a MQTT gateway and a Serial gateway (over TCP) so I could use firmware upload function of the MySController. However for some reason it seems to only work one way. I can send commands from the MySController to MQTTGateway but nothing is being received on the MySController side when data is sent from MQTT

    This is my flow, would be awesome if someone would spot the issue...

    [{"id":"e6a66581.c16ec8","type":"mysdecode","z":"229ed636.c3ff2a","name":"","mqtt":false,"x":450,"y":460,"wires":[["58ac0291.04974c","a3ba801.a63be8"]]},{"id":"eb5b52a1.29566","type":"tcp in","z":"229ed636.c3ff2a","name":"","server":"server","host":"","port":"5003","datamode":"stream","datatype":"utf8","newline":"\\n","topic":"","base64":false,"x":270,"y":460,"wires":[["e6a66581.c16ec8","ab0f8982.8a9588","78954899.688c28"]]},{"id":"58ac0291.04974c","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":510,"y":560,"wires":[]},{"id":"a3ba801.a63be8","type":"mysencode","z":"229ed636.c3ff2a","name":"","mqtt":true,"mqtttopic":"myGreenhouse-in","x":1040,"y":200,"wires":[["8d64662e.fbada8","595543a3.f537cc"]]},{"id":"ab0f8982.8a9588","type":"globalGetSet","z":"229ed636.c3ff2a","name":"Save Session","topic":"","context":"msg","variable":"_session","outContext":"global","outVar":"_session","x":440,"y":420,"wires":[[]]},{"id":"78954899.688c28","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":500,"y":720,"wires":[]},{"id":"cdf94190.9fb8e","type":"myscontroler","z":"229ed636.c3ff2a","database":"5fdbb924.88fb48","name":"","handleid":true,"x":770,"y":200,"wires":[["a3ba801.a63be8"]]},{"id":"8d64662e.fbada8","type":"mqtt out","z":"229ed636.c3ff2a","name":"","topic":"","qos":"","retain":"","broker":"1920bc44.5c3304","x":1270,"y":200,"wires":[]},{"id":"595543a3.f537cc","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1270,"y":260,"wires":[]},{"id":"c800320f.2a2b","type":"mysdecode","z":"229ed636.c3ff2a","name":"","mqtt":true,"x":560,"y":200,"wires":[["cdf94190.9fb8e","aa22f275.cc8ec"]]},{"id":"2222f84e.56c4e8","type":"mqtt in","z":"229ed636.c3ff2a","name":"","topic":"myGreenhouse-out/#","qos":"2","broker":"1920bc44.5c3304","x":320,"y":200,"wires":[["41588b7e.b61114","c800320f.2a2b"]]},{"id":"aa22f275.cc8ec","type":"switch","z":"229ed636.c3ff2a","name":"","property":"nodeId","propertyType":"msg","rules":[{"t":"eq","v":"203","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":360,"wires":[[],["ea8a0d53.8140b"]]},{"id":"41588b7e.b61114","type":"debug","z":"229ed636.c3ff2a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":530,"y":260,"wires":[]},{"id":"ea8a0d53.8140b","type":"mysencode","z":"229ed636.c3ff2a","name":"","mqtt":false,"mqtttopic":"","x":870,"y":420,"wires":[["2036eda1.dd8bf2","ad5ca8e4.1c4f68"]]},{"id":"2036eda1.dd8bf2","type":"debug","z":"229ed636.c3ff2a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":460,"wires":[]},{"id":"ad5ca8e4.1c4f68","type":"globalGetSet","z":"229ed636.c3ff2a","name":"Load Session","topic":"","context":"global","variable":"_session","outContext":"msg","outVar":"_session","x":1060,"y":420,"wires":[["cb6d084b.432238","f99fd97d.5f73c8"]]},{"id":"cb6d084b.432238","type":"tcp out","z":"229ed636.c3ff2a","host":"localhost","port":"5003","beserver":"reply","base64":true,"end":false,"name":"","x":1250,"y":420,"wires":[]},{"id":"f99fd97d.5f73c8","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1240,"y":480,"wires":[]},{"id":"5fdbb924.88fb48","type":"mysensorsdb","z":"","name":"Device DB","file":"sqlite"},{"id":"1920bc44.5c3304","type":"mqtt-broker","z":"","name":"LocalNew","broker":"localhost","port":"8883","tls":"","clientid":"Node-RedHome","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":""}]```

    Controller: Node-Red
    Gateway: SerialGateway & GSMMQTTGateway
    MySensors: 2.2.0

    1 Reply Last reply
    0
    • tbowmoT Offline
      tbowmoT Offline
      tbowmo
      Admin
      wrote on last edited by
      #9

      @Thucar

      The MysController node doesn't pass any messages through it, it only emits messages if it receives a node ID request.

      Also, (depending on your version) then it is not needed to pass messages through mysdecode / mysencode before / after the myscontroller node. It understands mqtt / serial protocol directly. (this has been a feature since 2.2.0)

      / Thomas

      1 Reply Last reply
      0
      • tbowmoT Offline
        tbowmoT Offline
        tbowmo
        Admin
        wrote on last edited by
        #10

        New release : 3.1.0

        Added features:

        Controller now supports the following messages:

        • I_TIME is replied with a unix timestamp corrected with local timezone offset
        • I_CONFIG, responds with Metric / Imperial setting

        Minor documentation updates to other nodes as well.

        1 Reply Last reply
        1
        • tbowmoT Offline
          tbowmoT Offline
          tbowmo
          Admin
          wrote on last edited by
          #11

          Bugfix release is out: 3.1.1

          @mirodin found an issue with assigning node ID's with the controller node, which should be addressed with this release.

          Basically I tried to assign nodeid 0 to nodes, and it never went out to the nodes. At the same time, the controller never got node ID 0 marked as used, as it filtered away all packages where the nodeId was 0, null or undefined, due to a missing nullcheck.

          1 Reply Last reply
          0
          • tbowmoT Offline
            tbowmoT Offline
            tbowmo
            Admin
            wrote on last edited by tbowmo
            #12

            New release: 3.2.0

            I added the possibility to do database lookups in the decode node, which is used to add info about sensor type to the mysensors messages in node-red. The info is gathered during node presentations

            An example, from a node that report door state from the chicken coop:

            topic: "mys-in/21/5/1/0/16"
            payload: "1"
            qos: 2
            retain: false
            _msgid: "ddf9aef9.9a21a"
            topicRoot: "mys-in"
            nodeId: 21
            childSensorId: 5
            messageType: 1
            ack: 0
            subType: 16
            origin: 2
            messageTypeStr: "C_SET"
            subTypeStr: "V_TRIPPED"
            sensorTypeStr: "S_DOOR"
            

            As seen above, the sensorTypeStr is added.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Maschler
              wrote on last edited by
              #13

              Hi,
              great work. I tried to install it, without success. First I installed node-red und npm. As operation system I use openHABian v1.4.1.

              This is the output:

              npm install node-red-contrib-mysensors
              (node:4359) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
              npm WARN package.json node-red-project@0.0.1 No repository field.
              npm WARN package.json node-red-project@0.0.1 No README data
              npm WARN package.json node-red-project@0.0.1 No license field.
              npm WARN package.json copy-descriptor@0.1.1 No README data
              npm WARN package.json log-ok@0.1.1 No README data
              npm WARN package.json log-utils@0.2.1 No README data
              npm WARN package.json object-copy@0.1.0 No README data
              npm WARN package.json static-extend@0.1.2 No README data
              npm WARN package.json ansi-wrap@0.1.0 license should be a valid SPDX license expression
              npm WARN package.json events@1.1.1 events is also the name of a node core module.
              npm WARN package.json format@0.2.2 No license field.
              npm WARN package.json jsonify@0.0.0 license should be a valid SPDX license expression
              npm WARN package.json string_decoder@1.1.1 string_decoder is also the name of a node core module.
              npm ERR! Error: Method Not Allowed
              npm ERR!     at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
              npm ERR!     at /usr/share/npm/lib/cache/add-named.js:203:12
              npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
              npm ERR!     at FSReqWrap.oncomplete (fs.js:135:15)
              npm ERR! If you need help, you may report this *entire* log,
              npm ERR! including the npm and node versions, at:
              npm ERR!     <http://github.com/npm/npm/issues>
              
              npm ERR! System Linux 4.14.52+
              npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "node-red-contrib-mysensors"
              npm ERR! cwd /home/openhabian/.node-red
              npm ERR! node -v v8.11.1
              npm ERR! npm -v 1.4.21
              npm ERR! code E405
              npm ERR!
              npm ERR! Additional logging details can be found in:
              npm ERR!     /home/openhabian/.node-red/npm-debug.log
              npm ERR! not ok code 0
              
              
              1 Reply Last reply
              0
              • tbowmoT Offline
                tbowmoT Offline
                tbowmo
                Admin
                wrote on last edited by tbowmo
                #14

                @Maschler

                Which version of node-red, nodejs and npm are you using?

                And what does /home/openhabian/.node-red/npm-debug.log tell you?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Maschler
                  wrote on last edited by Maschler
                  #15

                  hey @tbowmo

                  I found my mistake in /home/openhabian/.npm/_logs
                  I had to use sudo ....

                  But I have another Question. Do I need an Arduino in-between or can I connect the modul directly to the Raspberry pi like it is done here.

                  Thank you very much for your help!! :)

                  1 Reply Last reply
                  0
                  • tbowmoT Offline
                    tbowmoT Offline
                    tbowmo
                    Admin
                    wrote on last edited by
                    #16

                    @Maschler

                    It's not necessary to have an arduino to make the gateway. You can configure the linux variant as a MQTT gateway (which I recommend), and then have mosquitto as a broker and nodered listening for mqtt messages.

                    https://www.mysensors.org/build/raspberry#configure

                    1 Reply Last reply
                    0
                    • tbowmoT Offline
                      tbowmoT Offline
                      tbowmo
                      Admin
                      wrote on last edited by
                      #17

                      New release: 3.2.1

                      It's a minor update, as @pansen discovered that node IDs wasn't shown correctly in the controller view.

                      Also behind the scenes a couple of module dependencies have been updated to mitigate a couple of (low-risk) security issues that has been reported against some of the npm packages that was used.

                      1 Reply Last reply
                      0
                      • tbowmoT Offline
                        tbowmoT Offline
                        tbowmo
                        Admin
                        wrote on last edited by
                        #18

                        Today I have released version 3.3.0

                        New in this release is that battery level messages is now stored in the database by myscontroller, and are also shown in the table of mysensors nodes, when you open the myscontroller node.

                        1 Reply Last reply
                        1
                        • tbowmoT Offline
                          tbowmoT Offline
                          tbowmo
                          Admin
                          wrote on last edited by
                          #19

                          Version 3.3.1 is now released

                          A bug with the Encapsulate node was reported, where child sensor types didn't have the correct IDs. Also updated dependencies as a few where reported to have security vulnerabilities.

                          1 Reply Last reply
                          0
                          • magpernM Offline
                            magpernM Offline
                            magpern
                            wrote on last edited by
                            #20

                            @tbowmo I feel a little confused on how to use this node-red plugin. Is this something like "a node-red plug-in framework", but you have to invent the wheel yourself kind of solution?

                            I have just opted for the Home assistant (hass.io) system as the hub for my home automation.
                            Home assistant, according to documentation, is mysensors enabled, but compared to other add-ons, like zigbee2mqtt, zwave2mqtt, the mysensors implementaton is like a child's tricycle, while the others are sports cars.
                            The zigbee2mqtt, you just turn on and off the IKEA light buld six times and it is added, whereas the mysensors you have to type configuration files and have limited graphical administration possibilities.

                            So I thought, what if the mysensors could talk to mqtt and get into home assistant that way (my gateway is serial).

                            I understand the node-red implementation enables you to decode the messages as you like, but do I really need to invent how it should decode it and send it to mqtt?

                            Are there any ready to use implementations of the plug.in?

                            Could it support "auto discovery"? So you just have to turn the device on, and voila, it appears in home assistant (if mqtt auto discovery is turned on)?

                            tbowmoT 1 Reply Last reply
                            0
                            • magpernM magpern

                              @tbowmo I feel a little confused on how to use this node-red plugin. Is this something like "a node-red plug-in framework", but you have to invent the wheel yourself kind of solution?

                              I have just opted for the Home assistant (hass.io) system as the hub for my home automation.
                              Home assistant, according to documentation, is mysensors enabled, but compared to other add-ons, like zigbee2mqtt, zwave2mqtt, the mysensors implementaton is like a child's tricycle, while the others are sports cars.
                              The zigbee2mqtt, you just turn on and off the IKEA light buld six times and it is added, whereas the mysensors you have to type configuration files and have limited graphical administration possibilities.

                              So I thought, what if the mysensors could talk to mqtt and get into home assistant that way (my gateway is serial).

                              I understand the node-red implementation enables you to decode the messages as you like, but do I really need to invent how it should decode it and send it to mqtt?

                              Are there any ready to use implementations of the plug.in?

                              Could it support "auto discovery"? So you just have to turn the device on, and voila, it appears in home assistant (if mqtt auto discovery is turned on)?

                              tbowmoT Offline
                              tbowmoT Offline
                              tbowmo
                              Admin
                              wrote on last edited by
                              #21

                              @magpern this module is more if you want to only use nodered for your home automation, without Hass.io or the likes.

                              Most of the standard controllers (domoticz, openhab, home assistant etc) are all able to handle the mysensors network directly (more or less), and handle the device registration for you.

                              My module for nodered is implementing a crude controller, that only handles out node id's to the mysensors network, when asked for, and then leaves everything else up to your imagination, for how to wire things together behind the scenes.

                              That being said, if you only need to convert your serial mysensors gateway into mqtt, I do have a small python script that I use for that particular case, as my nodered instance can't access the serial Ports from my docker swarm setup. So this script is running besides everything else. I can post it tomorrow if interested, as my pc is closed for the night now.

                              / Thomas

                              magpernM 1 Reply Last reply
                              0
                              • tbowmoT tbowmo

                                @magpern this module is more if you want to only use nodered for your home automation, without Hass.io or the likes.

                                Most of the standard controllers (domoticz, openhab, home assistant etc) are all able to handle the mysensors network directly (more or less), and handle the device registration for you.

                                My module for nodered is implementing a crude controller, that only handles out node id's to the mysensors network, when asked for, and then leaves everything else up to your imagination, for how to wire things together behind the scenes.

                                That being said, if you only need to convert your serial mysensors gateway into mqtt, I do have a small python script that I use for that particular case, as my nodered instance can't access the serial Ports from my docker swarm setup. So this script is running besides everything else. I can post it tomorrow if interested, as my pc is closed for the night now.

                                / Thomas

                                magpernM Offline
                                magpernM Offline
                                magpern
                                wrote on last edited by
                                #22

                                @tbowmo said in node-red-contrib-mysensors release thread:

                                That being said, if you only need to convert your serial mysensors gateway into mqtt, I do have a small python script that I use for that particular case, as my nodered instance can't access the serial Ports from my docker swarm setup. So this script is running besides everything else. I can post it tomorrow if interested, as my pc is closed for the night now.

                                / Thomas

                                I'd love to try the script! /Magnus

                                tbowmoT 1 Reply Last reply
                                0
                                • magpernM magpern

                                  @tbowmo said in node-red-contrib-mysensors release thread:

                                  That being said, if you only need to convert your serial mysensors gateway into mqtt, I do have a small python script that I use for that particular case, as my nodered instance can't access the serial Ports from my docker swarm setup. So this script is running besides everything else. I can post it tomorrow if interested, as my pc is closed for the night now.

                                  / Thomas

                                  I'd love to try the script! /Magnus

                                  tbowmoT Offline
                                  tbowmoT Offline
                                  tbowmo
                                  Admin
                                  wrote on last edited by
                                  #23

                                  @magpern

                                  It's more or less the script below, I removed some stuff from my utility meter, that I also handles in my script (but isn't needed for just mysensors).

                                  #!/usr/bin/python3
                                  
                                  import serial
                                  import paho.mqtt.client as mqtt
                                  import time
                                  
                                  mysensors = serial.serial_for_url('/dev/ttyNRF24', 115200, rtscts=0, timeout=1000)
                                  mysensors.isOpen()
                                  mqtt_connect = False
                                  
                                  def mqtt_reception(client, userdata, msg):
                                      payload = msg.payload.decode("ascii")
                                      topic = msg.topic.split('/')
                                      topic.remove('mys-out')
                                      mymsg = ';'.join(topic) + ';' + payload + '\n'
                                      print("out <- ", mymsg)
                                      mysensors.write(str.encode(mymsg))
                                  
                                  def mqtt_connect(client, userdata, flags, rc):
                                      print('Connected')
                                      mqtt_connect = True
                                      client.subscribe('mys-out/#')
                                  
                                  def mqtt_disconnect(client, userdata, rc):
                                      print(rc)
                                      
                                  client = mqtt.Client('mys')
                                  client.on_connect = mqtt_connect
                                  client.on_message = mqtt_reception
                                  client.on_disconnect = mqtt_disconnect
                                  
                                  client.connect('192.168.1.64')
                                  
                                  def handle_data(data):
                                      print("in -> ", data)
                                      s = data.split(';')
                                      payload = s[-1]
                                      s.remove(payload)
                                      topic = 'mys-in/' + '/'.join(s)
                                      if mqtt_connect: 
                                          client.publish(topic, payload.rstrip())
                                  
                                  if __name__ == "__main__":
                                      client.loop_start()
                                      mys_data_str = '';
                                      util_data_str = '';
                                      while (True):
                                          if (mysensors.inWaiting()>0):
                                              char = mysensors.read(1).decode('ascii')
                                              mys_data_str += char
                                              if (char == '\n'):
                                                  handle_data(mys_data_str)
                                                  mys_data_str = ''
                                          time.sleep(0.01)
                                  
                                  1 Reply Last reply
                                  0
                                  • D Offline
                                    D Offline
                                    DenisJ
                                    wrote on last edited by
                                    #24

                                    Hi there all,
                                    I just try to install the node in my Node-Red (Home Assistant)
                                    and I got error:

                                    -----------------------------------------------------------
                                    2021-04-30T07:18:09.293Z Install : node-red-contrib-mysensors 3.3.1
                                    
                                    2021-04-30T07:18:07.624Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-mysensors@3.3.1
                                    2021-04-30T07:18:11.638Z [err] npm WARN deprecated @types/moment-timezone@0.5.30: This is a stub types definition. moment-timezone provides its own type definitions, so you do not need this installed.
                                    2021-04-30T07:18:14.813Z [err] npm WARN
                                    2021-04-30T07:18:14.813Z [err]  deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
                                    2021-04-30T07:18:19.176Z [out] 
                                    2021-04-30T07:18:19.176Z [out] > sqlite3@4.2.0 install /config/node-red/node_modules/sqlite3
                                    2021-04-30T07:18:19.176Z [out] > node-pre-gyp install --fallback-to-build
                                    2021-04-30T07:18:19.176Z [out] 
                                    2021-04-30T07:18:19.551Z [err] node-pre-gyp
                                    2021-04-30T07:18:19.552Z [err]  WARN Using request for node-pre-gyp https download 
                                    2021-04-30T07:18:20.511Z [err] node-pre-gyp
                                    2021-04-30T07:18:20.512Z [err]  WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-linux-x64.tar.gz 
                                    2021-04-30T07:18:20.512Z [err] node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.16.1 (node-v83 ABI, musl) (falling back to source compile with node-gyp) 
                                    2021-04-30T07:18:21.714Z [err] gyp
                                    2021-04-30T07:18:21.715Z [err]  
                                    2021-04-30T07:18:21.715Z [err] ERR!
                                    2021-04-30T07:18:21.715Z [err]  
                                    2021-04-30T07:18:21.716Z [err] build error
                                    2021-04-30T07:18:21.716Z [err]  
                                    2021-04-30T07:18:21.716Z [err] gyp
                                    2021-04-30T07:18:21.717Z [err]  
                                    2021-04-30T07:18:21.717Z [err] ERR!
                                    2021-04-30T07:18:21.717Z [err]  
                                    2021-04-30T07:18:21.717Z [err] stack
                                    2021-04-30T07:18:21.717Z [err]  Error: not found: make
                                    2021-04-30T07:18:21.717Z [err] gyp
                                    2021-04-30T07:18:21.717Z [err]  
                                    2021-04-30T07:18:21.717Z [err] ERR!
                                    2021-04-30T07:18:21.717Z [err]  
                                    2021-04-30T07:18:21.717Z [err] stack
                                    2021-04-30T07:18:21.717Z [err]      at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
                                    2021-04-30T07:18:21.718Z [err] gyp
                                    2021-04-30T07:18:21.718Z [err]  
                                    2021-04-30T07:18:21.718Z [err] ERR!
                                    2021-04-30T07:18:21.718Z [err]  
                                    2021-04-30T07:18:21.718Z [err] stack
                                    2021-04-30T07:18:21.718Z [err]      at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
                                    2021-04-30T07:18:21.718Z [err] gyp
                                    2021-04-30T07:18:21.718Z [err]  
                                    2021-04-30T07:18:21.718Z [err] ERR!
                                    2021-04-30T07:18:21.718Z [err]  
                                    2021-04-30T07:18:21.718Z [err] stack
                                    2021-04-30T07:18:21.719Z [err]      at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
                                    2021-04-30T07:18:21.719Z [err] gyp
                                    2021-04-30T07:18:21.719Z [err]  
                                    2021-04-30T07:18:21.719Z [err] ERR!
                                    2021-04-30T07:18:21.719Z [err]  
                                    2021-04-30T07:18:21.719Z [err] stack
                                    2021-04-30T07:18:21.719Z [err]      at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
                                    2021-04-30T07:18:21.719Z [err] gyp
                                    2021-04-30T07:18:21.719Z [err]  
                                    2021-04-30T07:18:21.719Z [err] ERR!
                                    2021-04-30T07:18:21.720Z [err]  
                                    2021-04-30T07:18:21.720Z [err] stack
                                    2021-04-30T07:18:21.720Z [err]      at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
                                    2021-04-30T07:18:21.720Z [err] gyp
                                    2021-04-30T07:18:21.720Z [err]  
                                    2021-04-30T07:18:21.720Z [err] ERR!
                                    2021-04-30T07:18:21.720Z [err]  
                                    2021-04-30T07:18:21.720Z [err] stack
                                    2021-04-30T07:18:21.720Z [err]      at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
                                    2021-04-30T07:18:21.720Z [err] gyp
                                    2021-04-30T07:18:21.720Z [err]  
                                    2021-04-30T07:18:21.721Z [err] ERR!
                                    2021-04-30T07:18:21.721Z [err]  
                                    2021-04-30T07:18:21.721Z [err] stack
                                    2021-04-30T07:18:21.721Z [err]      at FSReqCallback.oncomplete (fs.js:183:21)
                                    2021-04-30T07:18:21.721Z [err] gyp
                                    2021-04-30T07:18:21.721Z [err]  
                                    2021-04-30T07:18:21.721Z [err] ERR!
                                    2021-04-30T07:18:21.721Z [err]  
                                    2021-04-30T07:18:21.721Z [err] System
                                    2021-04-30T07:18:21.722Z [err]  Linux 5.0.0-27-generic
                                    2021-04-30T07:18:21.722Z [err] gyp
                                    2021-04-30T07:18:21.722Z [err]  
                                    2021-04-30T07:18:21.722Z [err] ERR!
                                    2021-04-30T07:18:21.722Z [err]  
                                    2021-04-30T07:18:21.722Z [err] command
                                    2021-04-30T07:18:21.722Z [err]  "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
                                    2021-04-30T07:18:21.722Z [err] gyp
                                    2021-04-30T07:18:21.722Z [err]  
                                    2021-04-30T07:18:21.722Z [err] ERR!
                                    2021-04-30T07:18:21.723Z [err]  
                                    2021-04-30T07:18:21.723Z [err] cwd
                                    2021-04-30T07:18:21.723Z [err]  /config/node-red/node_modules/sqlite3
                                    2021-04-30T07:18:21.723Z [err] gyp
                                    2021-04-30T07:18:21.723Z [err]  
                                    2021-04-30T07:18:21.723Z [err] ERR!
                                    2021-04-30T07:18:21.723Z [err]  
                                    2021-04-30T07:18:21.723Z [err] node -v
                                    2021-04-30T07:18:21.724Z [err]  v14.16.1
                                    2021-04-30T07:18:21.724Z [err] gyp
                                    2021-04-30T07:18:21.724Z [err]  
                                    2021-04-30T07:18:21.724Z [err] ERR!
                                    2021-04-30T07:18:21.724Z [err]  
                                    2021-04-30T07:18:21.724Z [err] node-gyp -v
                                    2021-04-30T07:18:21.725Z [err]  v5.1.0
                                    2021-04-30T07:18:21.725Z [err] gyp
                                    2021-04-30T07:18:21.725Z [err]  
                                    2021-04-30T07:18:21.725Z [err] ERR!
                                    2021-04-30T07:18:21.725Z [err]  
                                    2021-04-30T07:18:21.725Z [err] not ok
                                    2021-04-30T07:18:21.725Z [err]  
                                    2021-04-30T07:18:21.730Z [err] node-pre-gyp
                                    2021-04-30T07:18:21.730Z [err]  ERR! build error 
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp ERR! 
                                    2021-04-30T07:18:21.731Z [err] stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/config/node-red/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp 
                                    2021-04-30T07:18:21.731Z [err] ERR! stack     at ChildProcess.emit (events.js:315:20)
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp ERR! 
                                    2021-04-30T07:18:21.731Z [err] stack     at maybeClose (internal/child_process.js:1048:16)
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp ERR! 
                                    2021-04-30T07:18:21.731Z [err] System Linux 5.0.0-27-generic
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp
                                    2021-04-30T07:18:21.731Z [err]  ERR! command "/usr/bin/node" "/config/node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp
                                    2021-04-30T07:18:21.731Z [err]  ERR! cwd /config/node-red/node_modules/sqlite3
                                    2021-04-30T07:18:21.731Z [err] node-pre-gyp
                                    2021-04-30T07:18:21.731Z [err]  ERR! node -v v14.16.1
                                    2021-04-30T07:18:21.732Z [err] node-pre-gyp ERR! node-pre-gyp -v v0.11.0
                                    2021-04-30T07:18:21.732Z [err] node-pre-gyp ERR! not ok 
                                    2021-04-30T07:18:21.732Z [out] Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
                                    2021-04-30T07:18:22.158Z [err] npm ERR!
                                    2021-04-30T07:18:22.158Z [err]  code ELIFECYCLE
                                    2021-04-30T07:18:22.158Z [err] npm ERR! errno 1
                                    2021-04-30T07:18:22.164Z [err] npm ERR!
                                    2021-04-30T07:18:22.164Z [err]  sqlite3@4.2.0 install: `node-pre-gyp install --fallback-to-build`
                                    2021-04-30T07:18:22.164Z [err] npm ERR! Exit status 1
                                    2021-04-30T07:18:22.164Z [err] npm ERR! 
                                    2021-04-30T07:18:22.164Z [err] npm 
                                    2021-04-30T07:18:22.164Z [err] ERR! Failed at the sqlite3@4.2.0 install script.
                                    2021-04-30T07:18:22.164Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
                                    2021-04-30T07:18:22.178Z [err] 
                                    2021-04-30T07:18:22.178Z [err] npm ERR! A complete log of this run can be found in:
                                    2021-04-30T07:18:22.178Z [err] npm ERR!     /root/.npm/_logs/2021-04-30T07_18_22_169Z-debug.log
                                    2021-04-30T07:18:22.201Z rc=1
                                    

                                    Is there still possibility to install it please ?
                                    Thanks a lot
                                    Denis

                                    1 Reply Last reply
                                    0
                                    • tbowmoT Offline
                                      tbowmoT Offline
                                      tbowmo
                                      Admin
                                      wrote on last edited by
                                      #25

                                      NPM is trying to build sqlite, because it cannot find a suitable pre-built one for your architecture, it fails because you do not have the needed tools installed for this on your machine.

                                      Might help if you install build-essentials (sudo apt-get install build-essentials, assuming you are on a debian like install)

                                      I currently use it on node-red 1.1.2, without problems. But I'm using plain node-red in a docker container..

                                      1 Reply Last reply
                                      0
                                      • D Offline
                                        D Offline
                                        DenisJ
                                        wrote on last edited by
                                        #26

                                        @tbowmo said in node-red-contrib-mysensors release thread:

                                        ed 1.1.2, without problem

                                        Thanks for the answer.
                                        I have now Node-Red 1.3.3 under Home Assistant installed.
                                        But I must search on net how can I install the build-essentials from the docker console.

                                        Do you know if is there some other node that I can install from the palette that maybe incluse the build-essentials please ?

                                        Thanks again
                                        Denis

                                        1 Reply Last reply
                                        0
                                        • tbowmoT Offline
                                          tbowmoT Offline
                                          tbowmo
                                          Admin
                                          wrote on last edited by
                                          #27

                                          What I did way back when I got it up and running in docker, was to jump into the container shell, and install the package manually (So you are using the same node.js version that node-red is using).

                                          You could also (in that docker shell) do a apt install (given that it builds upon a debian based image).

                                          something in the line of:

                                          $ docker exec -it <id of container running node-red> /bin/bash
                                          # now you are in docker..
                                          $ apt install build-essentials
                                          $ cd <to your node-red data directory>
                                          $ npm install node-red-contrib-mysensors
                                          $ exit
                                          

                                          Above is taken purely from what I think is the right commands, as I have not tried working with home-assistant for a while.

                                          1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          20

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular