Trouble adding new node to Node Red to connect to Azure IoT Hub

Home Forums Conduit: AEP Model Trouble adding new node to Node Red to connect to Azure IoT Hub

Tagged: , ,

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #18202
    Evan Wood
    Participant

    I am having trouble installing new nodes to node red connected to the multitech system. I have already used Putty to access the node with no issue, but I am receiving the following error when running

    npm install -g node-red-contrib-azure-iot-hub on Putty.

    login as: admin
    Using keyboard-interactive authentication.
    Password:
    Last login: Fri Apr  7 12:08:58 2017 from 192.168.2.132
    admin@mtcdt:~# cd /opt/node-red/nodes
    admin@mtcdt:/opt/node-red/nodes# npm install node-red-contrib-azure-iot-hub
    npm WARN package.json mts-gpio@ No description
    npm WARN package.json mts-gpio@ No repository field.
    npm WARN package.json mts-gpio@ No README data
    npm WARN package.json mts-mcard@ No description
    npm WARN package.json mts-mcard@ No repository field.
    npm WARN package.json mts-mcard@ No README data
    npm WARN package.json mts-serial@ No description
    npm WARN package.json mts-serial@ No repository field.
    npm WARN package.json mts-serial@ No README data
    npm ERR! network getaddrinfo ENOTFOUND
    npm ERR! network This is most likely not a problem with npm itself
    npm ERR! network and is related to network connectivity.
    npm ERR! network In most cases you are behind a proxy or have bad network settings.
    npm ERR! network
    npm ERR! network If you are behind a proxy, please make sure that the
    npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
    
    npm ERR! System Linux 3.12.27
    npm ERR! command "node" "/usr/bin/npm" "install" "node-red-contrib-azure-iot-hub"
    npm ERR! cwd /opt/node-red/nodes
    npm ERR! node -v v0.10.40
    npm ERR! npm -v 1.4.28
    npm ERR! syscall getaddrinfo
    npm ERR! code ENOTFOUND
    npm ERR! errno ENOTFOUND
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR!     /opt/node-red/nodes/npm-debug.log
    npm ERR! not ok code 0

    Any suggestions on how to fix this issue would be greatly appreciated.

    • This topic was modified 6 years, 11 months ago by Evan Wood.
    • This topic was modified 6 years, 11 months ago by Evan Wood.
    • This topic was modified 6 years, 11 months ago by Evan Wood.
    #18214
    Jeff Hatch
    Keymaster

    Evan,

    The npm utility cannot resolve a DNS hostname of some sort. You will need to fix the DNS on the Conduit in order to get the resolution to work.

    Jeff

    #18221
    Evan Wood
    Participant

    Jeff,

    Must the conduit be connected to the internet in order to get the npm files to download? Do I have to set up the internet connection with the conduit even though my computer connected to the conduit has an active internet connection?

    Evan

    #18224
    Jeff Hatch
    Keymaster

    Evan,

    Is your PC set up to accept and handle DNS requests? If not the Conduit needs to be configured to access a DNS server, whether it is over Cellular or Ethernet.

    Jeff

    #18226
    Evan Wood
    Participant

    Jeff,

    How would I configure the conduit to access the DNS server? Would it be as simple as connecting it to the internet?

    Evan

    #18227
    Peter Ferland
    Blocked

    Yes you need an internet connection.

    #18228
    Evan Wood
    Participant

    When setting up the internet connection, the IP address is the IP address of the conduit and the Gateway address is my routers IP address correct? Along with the DNS of my router? Also would I have to switch from LAN to WAN? Every time I attempt to input the gateway address of my router it says that the gateway is invalid.

    #18232
    Jeff Hatch
    Keymaster

    Evan,

    Is the IP address of the Conduit on the same subnet as the router?

    Jeff

    #18246
    Evan Wood
    Participant

    Jeff,

    The IP address on the conduit was not the same subnet as the router, but after changing the IP address of the conduit I was unable to access the Multitech portal with the new IP address. Any suggestions?

    Evan

    #18264
    Evan Wood
    Participant

    I was able to connect the Multitech conduit to my internet, and was able to run the following npm.
    npm install -g node-red-contrib-azure-iot-hub
    The npm installed and everything looked correct within the Putty, and so I saved and restarted my device, but the new nodes were not in my conduits Node-Red app. Is there anything that needs to be done after installing the npm to make the nodes appear on the Multitechs Node-Red app?
    Thanks,
    Evan

    #18519
    Dev 1
    Participant

    Is it possible to install Azure IoT Hub on Conduit AEP Node-Red properly?

    npm install -g node-red-contrib-azure-iot-hub

    Is there any Step by Step Documentation on

    1) Configuring Conduit to install above (DNS, Internet, etc.)
    2) SSH Putty and navigate to the correct folder to install Azure, AWS, ..
    3) Install azure iot hub or whatever else like AWS

    According to this blog: https://www.leverege.com/blogpost/lorawan-node-red-deployment-tips-part-ii

    You can install the node, but it breaks everything and you can only use IBM Bluemix to connect to Azure or use REST API. Is that accurate?

    Alternatives to installing Azure IoT hub:

    – I tried MQTT Output in the flow but it remains “disconnected” no matter what setting i use. I shared Internet with Conduit via ethernet connection. Didn’t work.

    This is a major requirement for connecting Conduit to a Cloud and take advantage of Node-Red. Some documentation on this would be nice and appreciated. Currently, seems like a hack job.

    • This reply was modified 6 years, 11 months ago by Dev 1.
    • This reply was modified 6 years, 11 months ago by Dev 1.
    • This reply was modified 5 years ago by Jason Reiss.
    #18892
    Peter Ferland
    Blocked

    That blog’s installation instructions are correct, but the node red flow you create needs to have a “protocol” entry in the inject node’s payload. For whatever reason the azureiothub node’s protocol GUI entry gets wiped out if you set any other properties.

    ie, the inject node’s payload for the Azure IoT Hub should be:

    {
         "protocol": "mqtt", 
         "deviceId": "<your device id>", 
         "key":"<your key>", 
         "data":"<your json data>"
    }
    #23625

    I’m working with a Multitech conduit whit module LoRa, I haven’t the same problem than you, but I do reload the same firware version and that works

    imagemultitech firware

    azure ihut

    Now I Update the Node-red version

    node-red-update

    #27489

    Hi!
    I’m working with a Multitech conduit AEP (MTCAP-868-001A) with module LoRa too and I want to add in Node-RED the node azure-iot-hub. I’m following the steps explained by Fabian,but when I try update the Node-RED version (npm install -g –unsafe-perm node-red) I get the next error:

    `admin@mtcap:/# npm install -g –unsafe-perm node-red
    npm WARN engine node-red@0.20.3: wanted: {“node”:”>=8″} (current: {“node”:”0.10. 48″,”npm”:”2.15.1″})
    npm WARN engine node-red-node-email@1.3.0: wanted: {“node”:”>=8.0.0″} (current: {“node”:”0.10.48″,”npm”:”2.15.1″})
    npm WARN engine fs-extra@7.0.1: wanted: {“node”:”>=6 <7 || >=8″} (current: {“nod e”:”0.10.48″,”npm”:”2.15.1″})
    npm WARN engine bcrypt@2.0.1: wanted: {“node”:”>= 4.0.0″} (current: {“node”:”0.1 0.48″,”npm”:”2.15.1″})
    npm WARN engine sentiment@2.1.0: wanted: {“node”:”>=4.0″} (current: {“node”:”0.1 0.48″,”npm”:”2.15.1″})
    npm WARN engine request@2.88.0: wanted: {“node”:”>= 4″} (current: {“node”:”0.10. 48″,”npm”:”2.15.1″})
    npm WARN engine feedparser@2.2.9: wanted: {“node”:”>= 4.2.0″} (current: {“node”: “0.10.48”,”npm”:”2.15.1″})
    npm WARN engine tail@2.0.2: wanted: {“node”:”>= 6.0.0″} (current: {“node”:”0.10. 48″,”npm”:”2.15.1″})
    npm WARN engine jsonata@1.6.4: wanted: {“node”:”>= 6″} (current: {“node”:”0.10.4 8″,”npm”:”2.15.1″})
    npm WARN engine nodemailer@4.7.0: wanted: {“node”:”>=6.0.0″} (current: {“node”:” 0.10.48″,”npm”:”2.15.1″})
    npm WARN engine request@2.88.0: wanted: {“node”:”>= 4″} (current: {“node”:”0.10. 48″,”npm”:”2.15.1″})
    npm WARN engine mri@1.1.4: wanted: {“node”:”>=4″} (current: {“node”:”0.10.48″,”n pm”:”2.15.1″})
    npm WARN engine mime@2.4.0: wanted: {“node”:”>=4.0.0″} (current: {“node”:”0.10.4 8″,”npm”:”2.15.1″})
    npm WARN engine universalify@0.1.2: wanted: {“node”:”>= 4.0.0″} (current: {“node “:”0.10.48″,”npm”:”2.15.1″})
    npm WARN engine form-data@2.3.3: wanted: {“node”:”>= 0.12″} (current: {“node”:”0 .10.48″,”npm”:”2.15.1″})
    npm WARN engine har-validator@5.1.3: wanted: {“node”:”>=6″} (current: {“node”:”0 .10.48″,”npm”:”2.15.1″})
    npm WARN engine form-data@2.3.3: wanted: {“node”:”>= 0.12″} (current: {“node”:”0 .10.48″,”npm”:”2.15.1″})
    npm WARN engine har-validator@5.1.3: wanted: {“node”:”>=6″} (current: {“node”:”0 .10.48″,”npm”:”2.15.1″})
    npm WARN engine har-schema@2.0.0: wanted: {“node”:”>=4″} (current: {“node”:”0.10 .48″,”npm”:”2.15.1″})
    npm WARN engine har-schema@2.0.0: wanted: {“node”:”>=4″} (current: {“node”:”0.10 .48″,”npm”:”2.15.1″})
    npm WARN engine mime@1.6.0: wanted: {“node”:”>=4″} (current: {“node”:”0.10.48″,” npm”:”2.15.1″})
    npm WARN engine https-proxy-agent@2.2.1: wanted: {“node”:”>= 4.5.0″} (current: { “node”:”0.10.48″,”npm”:”2.15.1″})
    npm WARN engine mqtt@2.18.8: wanted: {“node”:”>=4.0.0″} (current: {“node”:”0.10. 48″,”npm”:”2.15.1″})
    npm WARN engine request@2.88.0: wanted: {“node”:”>= 4″} (current: {“node”:”0.10. 48″,”npm”:”2.15.1″})
    npm WARN engine agent-base@4.2.1: wanted: {“node”:”>= 4.0.0″} (current: {“node”: “0.10.48”,”npm”:”2.15.1″})
    npm WARN engine xmlbuilder@9.0.7: wanted: {“node”:”>=4.0″} (current: {“node”:”0. 10.48″,”npm”:”2.15.1″})
    npm WARN engine form-data@2.3.3: wanted: {“node”:”>= 0.12″} (current: {“node”:”0 .10.48″,”npm”:”2.15.1″})
    npm WARN engine har-validator@5.1.3: wanted: {“node”:”>=6″} (current: {“node”:”0 .10.48″,”npm”:”2.15.1″})
    npm WARN engine readable-stream@3.2.0: wanted: {“node”:”>= 6″} (current: {“node” :”0.10.48″,”npm”:”2.15.1″})
    npm WARN engine har-schema@2.0.0: wanted: {“node”:”>=4″} (current: {“node”:”0.10 .48″,”npm”:”2.15.1″})
    npm WARN engine esprima@4.0.1: wanted: {“node”:”>=4″} (current: {“node”:”0.10.48 “,”npm”:”2.15.1″})
    npm WARN engine punycode@2.1.1: wanted: {“node”:”>=6″} (current: {“node”:”0.10.4 8″,”npm”:”2.15.1″})
    npm WARN engine punycode@2.1.1: wanted: {“node”:”>=6″} (current: {“node”:”0.10.4 8″,”npm”:”2.15.1″})
    npm WARN engine punycode@2.1.1: wanted: {“node”:”>=6″} (current: {“node”:”0.10.4 8″,”npm”:”2.15.1″})

    > bcrypt@2.0.1 install /usr/lib/node_modules/node-red/node_modules/bcrypt
    > node-pre-gyp install –fallback-to-build

    /usr/lib/node_modules/node-red/node_modules/bcrypt/node_modules/tar/lib/create.j s:4
    const hlo = require(‘./high-level-opt.js’)
    ^^^^^
    node-pre-gyp ERR! UNCAUGHT EXCEPTION
    node-pre-gyp ERR! stack SyntaxError: Use of const in strict mode.
    node-pre-gyp ERR! stack at Module._compile (module.js:439:25)
    node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:474:10)
    node-pre-gyp ERR! stack at Module.load (module.js:356:32)
    node-pre-gyp ERR! stack at Function.Module._load (module.js:312:12)
    node-pre-gyp ERR! stack at Module.require (module.js:364:17)
    node-pre-gyp ERR! stack at require (module.js:380:17)
    node-pre-gyp ERR! stack at Object.<anonymous> (/usr/lib/node_modules/node-re d/node_modules/bcrypt/node_modules/tar/index.js:4:30)
    node-pre-gyp ERR! stack at Module._compile (module.js:456:26)
    node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:474:10)
    node-pre-gyp ERR! stack at Module.load (module.js:356:32)
    node-pre-gyp ERR! System Linux 3.12.70
    node-pre-gyp ERR! command “node” “/usr/lib/node_modules/node-red/node_modules/bc rypt/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build”
    node-pre-gyp ERR! cwd /usr/lib/node_modules/node-red/node_modules/bcrypt
    node-pre-gyp ERR! node -v v0.10.48
    node-pre-gyp ERR! node-pre-gyp -v v0.9.1
    node-pre-gyp ERR! This is a bug in node-pre-gyp.
    node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not he lp:
    node-pre-gyp ERR! <https://github.com/mapbox/node-pre-gyp/issues&gt;
    npm WARN optional dep failed, continuing bcrypt@2.0.1
    /usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi
    /usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
    node-red@0.20.3 /usr/lib/node_modules/node-red
    ├── node-red-node-rbe@0.2.4
    ├── semver@5.6.0
    ├── node-red-node-tail@0.0.2 (tail@2.0.2)
    ├── basic-auth@2.0.1 (safe-buffer@5.1.2)
    ├── nopt@4.0.1 (abbrev@1.1.1, osenv@0.1.5)
    ├── node-red-node-sentiment@0.1.3 (sentiment@2.1.0)
    ├── bcryptjs@2.4.3
    ├── fs-extra@7.0.1 (universalify@0.1.2, jsonfile@4.0.0, graceful-fs@4.1.15)
    ├── express@4.16.4 (escape-html@1.0.3, array-flatten@1.1.1, setprototypeof@1.1.0 , cookie-signature@1.0.6, merge-descriptors@1.0.1, methods@1.1.2, utils-merge@1. 0.1, path-to-regexp@0.1.7, encodeurl@1.0.2, range-parser@1.2.0, fresh@0.5.2, var y@1.1.2, parseurl@1.3.2, content-type@1.0.4, etag@1.8.1, statuses@1.4.0, cookie@ 0.3.1, content-disposition@0.5.2, serve-static@1.13.2, safe-buffer@5.1.2, depd@1 .1.2, on-finished@2.3.0, finalhandler@1.1.1, proxy-addr@2.0.4, qs@6.5.2, debug@2 .6.9, send@0.16.2, accepts@1.3.5, type-is@1.6.16, body-parser@1.18.3)
    ├── node-red-node-email@1.3.0 (poplib@0.1.7, nodemailer@4.7.0, mailparser-mit@1. 0.0, imap@0.8.19)
    ├── @node-red/util@0.20.3 (clone@2.1.2, json-stringify-safe@5.0.1, i18next@14.1. 1, jsonata@1.6.4, when@3.7.8)
    ├── @node-red/runtime@0.20.3 (clone@2.1.2, json-stringify-safe@5.0.1, when@3.7.8 , @node-red/registry@0.20.3)
    ├── node-red-node-feedparser@0.1.14 (feedparser@2.2.9, request@2.88.0)
    ├── node-red-node-twitter@1.1.4 (twitter-ng@0.6.2, request@2.88.0)
    ├── @node-red/editor-api@0.20.3 (clone@2.1.2, passport-oauth2-client-password@0. 1.2, passport-http-bearer@1.0.1, cors@2.8.5, mime@2.4.0, mustache@3.0.1, passpor t@0.4.0, memorystore@1.6.1, ws@6.2.0, express-session@1.15.6, oauth2orize@1.11.0 , body-parser@1.18.3, when@3.7.8, @node-red/editor-client@0.20.3)
    └── @node-red/nodes@0.20.3 (is-utf8@0.2.1, on-headers@1.0.2, media-typer@1.0.1, cookie@0.3.1, hash-sum@1.0.2, denque@1.4.0, cookie-parser@1.4.4, cors@2.8.5, mus tache@3.0.1, fs.notify@0.0.4, ws@6.2.0, xml2js@0.4.19, iconv-lite@0.4.24, raw-bo dy@2.3.3, body-parser@1.18.3, https-proxy-agent@2.2.1, cheerio@0.22.0, js-yaml@3 .12.2, request@2.88.0, multer@1.4.1, ajv@6.10.0, mqtt@2.18.8, cron@1.7.0)`

    I suppose that the problem is the version of node.js, so to solve the trouble, I tried to update its with the next commands:

    npm cache clean -f
    npm install -g n
    n stable
    node --version
    node app.js

    And I have this errors:

    admin@mtcap:/# npm cache clean -f
    npm WARN using --force I sure hope you know what you are doing.
    admin@mtcap:/# npm install -g n
    /usr/bin/n -> /usr/lib/node_modules/n/bin/n
    n@2.1.12 /usr/lib/node_modules/n
    admin@mtcap:/# n stable
    
         install : node-v11.12.0
    
      Error: invalid version 11.12.0

    I tried with older versions but all of them has the same problem.
    Any idea about how to solve these problems?

    #27491
    Jason Reiss
    Keymaster

    That looks like a lot of dependencies for installing an MQTT or HTTPS wrapper.

    What is the issue using the provided MQTT or HTTPS nodes?

    node-red and node.js versions cannot be updated, beyond what is already provided, on current Conduit hardware.

    https://www.leverege.com/blogpost/lorawan-node-red-deployment-tips-part-ii

    Even better, use fewer resources by using C/C++.
    https://github.com/Azure/azure-iot-device-ecosystem/blob/master/get_started/mlinux-multiconnect-conduit-c.md

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.