Issues Installing Nodes on a Raspberry Pi 4 with 2 IP Addresses

Hi everyone,

I've been stuck on this for a while now... A few threads exist, but none of the solutions seem to work for me.

I've installed Node-Red on a Raspberry Pi 4 using current best practices. Everything installed as expected.

My Raspberry Pi is using two IP addresses: Static (192.168.1.42) over Eth0 (RJ45 cable) and DHCP (currently 10.0.0.148) over Wlan0.

The issue I'm having is adding Nodes into Node-Red. The error I get is as follows:

I suspect that it's not able to get to Internet. However, I can ping google.com from the Raspberry Pi and I can ping both IP addresses (static / DHCP) from my PC.

Any ideas / suggestions on how to resolve this?

Hi @VRomanov and welcome to node-RED community, I am not sure, but when you installed node-RED on Rpi, did you use Eth0 or Wlan0? or both at the same time? what happend if you disconnect Eth0, and try to install your nodes only with Wlan0?

Although you can ping both addresses from your PC (which is surprising), it sounds like you only have access to the internet over wlan0.

Jeff Geerling discusses a similar issue (USB rather than wlan) and how to change priority so that internet traffic is routed away from eth0.

Which best practice is that? Some might consider that using Docker is best practice.

What happens if you run, in a terminal
wget https://registry.npmjs....
Using the URL that it says it's not reachable.

They changed the way the Raspberry Pi OS is installed from what the process was previously. The new "recommended" way is through a launcher - current best practice.

The Node-Red install was through a long command that was also the recommended way for installing it onto the Pi.

I've played around with the networks and believe that the root cause is the way both network addresses are setup. I can download the libraries if I remove the Eth0 connection. It's not ideal, but works for now I guess... I'll read the RPi documentation a little more and see how I can configure it better.

It is nothing to do with node-red.
Please show us what the wget command returns, as requested. Also show us what
ip addr
says.

So which one did you use? They will give different results The way recommended by the node red community is using the method in Running on Raspberry Pi : Node-RED

This is a networking problem not Node-RED... so what does the route command output when both connections are active ?
That should show the default way it will route packets to which addresses.
We can then fix it from there.

Did you try changing the metrics in /etc/dhcpcd.conf as documented in the link I posted? What was the result?

Add to /etc/dhcpcd.conf

interface eth0
metric 400

Are you sure that is a good idea before we understand what is happening? Assuming both links have internet access then it should not matter which is used.

If it works when ethernet is disconnected I conclude that ethernet does not have internet access. RPiOS prioritises ethernet.
Might be wrong.
Of course I do not know why @VRomanov has different IP networks on the two interfaces. It's possible that changing the metric will interfere with something other than updating.

@VRomanov do you expect to have internet access via the routers on both the eth0 and wifi connections? Presumably they are connected to different routers.

The internet connection is only on one side. The idea is that the Raspberry Pi lies between a private and public networks and is used as a funnel for data generated by production equipment that isn't connected to the internet and translates those packets into MQTT messages on the wireless side.

I'll get command responses tomorrow morning on this. thank you all for helping! Will report back on this thread tomorrow.

In that case you need the the one with internet connection to be the higher priority. Assuming that the WiFi is the one with internet then @jbudd's suggestion is probably the one to try.

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