Networking not working

I am a long-time debian developer (since 2001) (arm ports) and embedded linux person so I have a reasonable idea what I am doing but I know almost nothing about openhab or the rpi series for that matter.

I installed it on an SD card and booted a PI4, (and once I worked out that you get nothing on the serial port and need to go find a microHD ->HDMI adaptor, I got stuff on the screen. It booted up but the firstboot script all failed due to being at work with an unauthorised MAC address so it had no network access.
Took it home and rebooted an the firstboot script ran OK and I got a prompt.
But the suggested ‘go to openhabian:8080’ got no connection.
Investigation (ip a) showed that no IP address was allocated.

What I really want to know is what network tools should I be using. I’m old fashioned so default to /etc/network/interfaces and ifupdown, but recognise that thee days it’s usually NetworkManager or connman or systemd-networkd at least ip rather than ifconfig, and maybe iwd or just wpa_supplicant. KNowing which tools to examine would help.
weirdly doing ifup eth0 says ‘unknonw interface’ but ip a shows:
lo (configured, as expected), eth0 and wlan0. both in state DOWN.
sudo ip link set eth0 up
gives no output, but ip a still says ‘state DOWN’. And in fact I have
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> …
But both LEDs come on when the cable is plugged in and I get an LED on the switch, so that means there is a carrier doesn’t it?

The docs: at openHABian | openHAB
say " When your openHABian box does not get Internet connectivity through either Ethernet or WI-Fi (if configured), openHABian will launch a Hotspot."
but I can’t connect to that either. Is there a command-line way to check if it thinks it is in this state. I see mention of a wifi dongle, does that mean that the Pi4 does not have wifi built-in so this only applies with an add-on board?

I can probably get to the bottom of this eventually, but clues welcome.

The board did connect to my router earlier (yesterday) - there was an IP address assigned. But now there isn’t. So this looks a bit like my ethernet port is bust, but it was working, so I suspect something else is up. But without knowing something about which tools are installed and how things are supposed to work it’s a litte hard to debug.

Welcome to openHAB!

As a first thing I would retry, that is:

  • reflash the image (best option is Pi Imager, please be aware that Pi Imager has the openHABian Image in the list of available Images and will donwload the image itself).
  • hook up the Pi with Micro SD-Card (for now without power) to Ethernet (WLAN is not recommended)
  • don’t connect any other hardware to the Pi (no keyboard, no mouse, no monitor
  • switch power on
  • wait :slight_smile:

As openHABian is doing its job, get information about the current ip address via router, but be patient :wink:

The openHABian Image is built from Raspberry Pi OS lite (still bullseye for now), there are only some additional scripts which take care to download and install openHAB and additional software via Internet.

If the Pi still doesn’t get Ethernet, try another image (best option pure Raspberry Pi OS lite)

On a fast internet connection (so this is not the bottleneck), openHABian should setup openHAB within 15 to 20 minutes. So at least wait this amount of time before doing anything to the Pi.

Very first boot will only expand the image to the SD-Card, then reboot, then start openhabian-config unattended which will install all the stuff.
Finally, openHAB should be reachable via http://openhabian:8080/ and https://openhabian:8443/, there should be frontail available at http://openhabian:9001/ and of course ssh via openhabian:22 should working as well as a samba share \openhabian\ (user openhabian, password openhabian). But maybe you have to use the ip address directly

One of the key takeaways from @Udo_Hartmann’s excellent advice is that openHABian is, for all intents and purposes, Raspberry Pi OS bullseye. So to answer a lot of your questions looking into what that OS does is going to be what openHABian uses.

The RPi 4 does have built in WiFi but configuring openHABian to work with WiFi on that first boot can be troublesome.

I believe the networking tools changed between bullseye and bookworm but beyond that my knowledge is limited.

what does dmesg tell you ? Any error ?

OK. I did this (clean card, flash image again, and boot, just leaving it to install) (but couldn’t resist leaving the monitor plugged in so I could see what was happening). Watching the DHCP on the router it did get an IPv4 and IPv6 address, so the ethernet hardware does work.

The install completed OK with the net working this time. That suggests that there is some sort of bug so that if the ‘first install’ script is run first with no internet, and then run again with access, something breaks in the networking config so you end up with neither the normal networking nor the local hotspot running.

Interestingly, whilst the install appears to work, the other issue I noticed (with the missing icon fonts in firefox: Deb package 4.1.1 not displaying icons in web interface on locahost with firefox - almost unusable) is now happening on this install even with a remote browser. I’ll try to narrow that down further in that thread.

I guess this will have to be filed at one-off weirdness unless I can be bothered to reproduce with a new install to show that it is repeatable. Still, I’m glad that my ethernet does actually work and I now have what appears to be a viable homeserver. Now I can do what I actually started this all for, which is monitor one-wire temps.