I have recently attempted to update to node red 1.0 on pi 3b+ . I used the bash script to upgrade. After complete I tried to open the the gui and editor, but It wont load. I noticed that IP adress of the nodered is dofferent from the rpi.
I have set static dhcp lease for rpi on my router.
Mqtt and grafana are working, I just cant get to Nodered, because it changed the IP adress.
Once Node-RED has started, point a browser at http://192.168.1.200:1880
On Pi Node-RED works better with the Firefox or Chrome browser
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
To find more nodes and example flows - go to http://flows.nodered.org
Starting as a systemd service.
Error loading settings file: /home/pi/.node-red/settings.js
Error: The module '/home/pi/.node-red/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1208:18)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at bindings (/home/pi/.node-red/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/home/pi/.node-red/node_modules/i2c-bus/i2c-bus.js:4:32)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
nodered.service: Succeeded.
IP adress of the PI is 192.168.1.100 and nodered was on this adress on the port 1883, but after updating nodered the IP of rpi is the same, but I can see that Nodered changed its IP to the xxx.200
I can see other problems in the log, could it be the problem?
You have both wifi and an ethernet connection enabled, so the device has two ip addresses, 192.168.1.240 on the wired connection and 192.168.1.105 on the wifi connection. That is nothing to do with node-red. You can use either to connect to the pi, so even though the log suggests one the other should work equally well. To avoid confusion you might be best to unplug the cable or disable the wifi, though there is no harm in having both active.
As for the problem with i2c node I suspect the problem is that you have upgraded to nodejs 12.x and that node is not compatible with nodejs 12. It would have been better if you had posted the complete startup log so we could have seen this. Either look there or run node -v
to check.
You can see the issues raised against the node in the link below. Unfortunately it appears that the node is no longer supported.
Thanks for detailed answer.
I dont need i2c node anymore, so I will delete it.
Any ideas how to do it from the terminal.
As for original problem, the problem is that when node red is started: Once Node-RED has started, point a browser at http://192.168.1.240:1880
it pointed to http://192.168.1.105:1880, before the update.
Now I cant access it from any of the above IPs.
Any other suggestions?
Im lucky that I made a backup of SD card recently and exported the flows, so If I need I will reimage the sd card.
I just wonder if this is gonna happen again?
Thanks again, I had hopes but I get many more error messages when I try to uninstall the i2c node, which I dont think its worth posting
I will revert to my backupand deleted the nodes before I make an update to nodered, which I probably the best solution.
Don't revert, that is only postponing the issue. Post the errors. We are used to seeing lots of error messages.
Also half the time they are only warnings.
I reverted against you suggestions and I made another loop, so Im back to the start of this topic.
I manually deleted all unused nodes from the pallete, and started the update again...and again I cant access the node red on any IP. Im sure something broke the setting of the nodered adress, as it has changed from 105 to 240. I have checked and I indeed could access both IPs before the update...
Here is the log after I used the terminal to uninstall the i2c node, if you can help
nce Node-RED has started, point a browser at http://192.168.1.240:1880
On Pi Node-RED works better with the Firefox or Chrome browser
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
To find more nodes and example flows - go to http://flows.nodered.org
Starting as a systemd service.
Error loading settings file: /home/pi/.node-red/settings.js
Error: The module '/home/pi/.node-red/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1208:18)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at bindings (/home/pi/.node-red/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/home/pi/.node-red/node_modules/i2c-bus/i2c-bus.js:4:32)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
nodered.service: Succeeded.
For some reason removing the contrib node has not removed the i2c-bus module, which would have been pulled in by the contrib node. Go into the .node-red folder and remove that too npm remove i2c-bus
I also checked the log before revert and it really did start a server on xxx.240 ip address even before revert
Starting as a systemd service.
Error loading settings file: /home/pi/.node-red/settings.js
nodered.service: Succeeded.
This is the settings.js>
/**
* Originale latest version: https://raw.githubusercontent.com/node-red/node-red/master/settings.js
**/
var fs = require("fs");
var i2c = require("i2c-bus");
var mySettings;
try {
mySettings = require("/home/pi/.node-red/redvars.js");
} catch(err) {
mySettings = {};
}
module.exports = {
uiPort: process.env.PORT || 1880,
mqttReconnectTime: 15000,
serialReconnectTime: 15000,
debugMaxLength: 1000,
flowFile: 'flows.json',
flowFilePretty: true,
httpStatic: '/home/pi/.node-red/public',
functionGlobalContext: {
os:require('os'),
moment:require('moment'),
fs:require('fs'),
i2c:require('i2c-bus'),
mySettings:mySettings
},
logging: {
console: {
level: "info",
metrics: false,
audit: false
}
},
adminAuth: { type: "credentials", users: [{ username: "x", password: "x", permissions: "*" }] },
httpNodeAuth: {user:"x", pass:"x"},
editorTheme: { projects: { enabled: false }
}
// By default, credentials are encrypted in storage using a generated key. To
// specify your own secret, set the following property.
// If you want to disable encryption of credentials, set this property to false.
// Note: once you set this property, do not change it - doing so will prevent
// node-red from being able to decrypt your existing credentials and they will be
// lost.
//credentialSecret: "a-secret-key",
//https: {
// key: fs.readFileSync('privatekey.pem'),
// cert: fs.readFileSync('certificate.pem')
//},
//requireHttps: true
}