# Node red wont load correctly after update - ip problem

**URL:** https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041
**Category:** General
**Created:** [1 April 2020 15:49 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041 "2020-04-01T15:49:36Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)
#### Post date: [1 April 2020 15:49 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/1 "2020-04-01T15:49:36Z")

</div>

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.

```auto
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?

Any ideas?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 April 2020 16:03 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/2 "2020-04-01T16:03:11Z")

</div>

In a terminal type  
`ifconfig`  
or if that is not found  
`ip address`  
and show us what it says.

---

<div class="post-metadata">

### Author: ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)
#### Post date: [1 April 2020 16:10 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/3 "2020-04-01T16:10:06Z")

</div>

```auto
ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:09:fa:f8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.240/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0
       valid_lft 42420sec preferred_lft 37020sec
    inet6 fe80::683d:f5fa:1cc9:f51c/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:5c:af:ad brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.105/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0
       valid_lft 42428sec preferred_lft 37028sec
    inet6 fe80::61d8:42c9:b729:e060/64 scope link 
       valid_lft forever preferred_lft forever

```

wlan0 IP adress was used till now, eth0 is the new nodered IP address ( i didnt wrote correct ip address in first post)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 April 2020 16:23 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/4 "2020-04-01T16:23:38Z")

</div>

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.

> **[nielsnl68/node-red-contrib-i2c](https://github.com/nielsnl68/node-red-contrib-i2c/issues)**
>
> This set of node-red nodes communicate with the Raspberry Pi I2C driver and uses the I2C-bus package. - nielsnl68/node-red-contrib-i2c

---

<div class="post-metadata">

### Author: ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)
#### Post date: [1 April 2020 16:39 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/5 "2020-04-01T16:39:31Z")

</div>

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](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?

```auto
node -v
v12.16.1

```

Thanks

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 April 2020 16:42 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/6 "2020-04-01T16:42:21Z")

</div>

To remove the node

```auto
cd ~/.node-red
npm remove node-red-contrib-i2c

```

As I said, you should be able to access node-red via either address. The reason you can't access it is because it has failed as shown in the log.

---

<div class="post-metadata">

### Author: ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)
#### Post date: [1 April 2020 16:54 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/7 "2020-04-01T16:54:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 April 2020 16:56 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/8 "2020-04-01T16:56:24Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)
#### Post date: [1 April 2020 18:37 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/9 "2020-04-01T18:37:17Z")

</div>

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

```auto
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.

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 April 2020 19:21 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/10 "2020-04-01T19:21:37Z")

</div>

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`

---

<div class="post-metadata">

### Author: ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)
#### Post date: [1 April 2020 20:19 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/11 "2020-04-01T20:19:14Z")

</div>

I removed both and I the error below

I also checked the log before revert and it really did start a server on xxx.240 ip address even before revert

```auto
Starting as a systemd service.
Error loading settings file: /home/pi/.node-red/settings.js
nodered.service: Succeeded.

```

This is the settings.js\>

```auto
/**
 * 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
}

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 April 2020 20:41 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/12 "2020-04-01T20:41:03Z")

</div>

> [@user7](#):
>
> var i2c = require("i2c-bus");

You are trying to load the module you have just removed. Presumably you put that in at some point.

---

<div class="post-metadata">

### Author: ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)
#### Post date: [2 April 2020 06:54 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/13 "2020-04-02T06:54:56Z")

</div>

After deleting the settings file, everything started to work as it should.  
Many thanks for you help!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [1 June 2020 06:54 UTC](https://discourse.nodered.org/t/node-red-wont-load-correctly-after-update-ip-problem/24041/14 "2020-06-01T06:54:56Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
