How does one re-enable the wired Ethernet port on a Pi 4

  • Platform information:
    • Hardware: Raspbery Pi 4B/4GB/SD Card
    • OS: Raspbian 10
    • Java Runtime Environment: whatever came with the distro
    • openHAB version: 2.5.5-I
  • Issue of the topic: Total noob here. Wired Ethernet has ceased functioning. Had tried to enable wireless via openhabian-config, which did not connect to my router, wired connection also quit. Tried disabling wireless hoping that would return the wired interface. It did not. Can not figure out how to re-enable it manually. Did find the “ip link show” command which seems to indicate there is an eth0 interface, but ifup says "unknown interface. I’m lost.
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

That is not an openHAB question. Please ask on a Raspberry Pi forum.

Excuse me, but as it seems to have been an openHAB utility that killed it, why wouldn’t it be appropriate here?

This is an openHAB support forum. We are not experts in the raspberry Pi. That only one of many platforms supported by Java

Copy. Still, one would think that maybe someone else on this forum has experienced something similar and might have “words of wisdom” helpful to a newbie on this stuff. Hopefully the Pi forum won’t treat my issue similarly and tell me it belongs in an openHAB forum since that’s the platform that did this…

I was in the same situation with my RPi3+. Changing back to wired was by reinstall from scratch OpenHAB without editing boot to connect to WiFi. Did not find other solution unfortunately then.

I am not a Linux expert, but perhaps you can find hints in here:

What commands have you entered?

You may check this thread https://github.com/raspberrypi/linux/issues/3034 .
Sounds like to be similar or same issue.

Thanks, but the Pi seems to have no trouble with getting/using an address, it’s the same one every time. (And I have already configured a DHCP reservation, too, not knowing how it determined the address it is using. New to Pi, not networking in general. :grinning:) The port itself seems to not initialize or immediately goes back down on a reboot, I never get a ping reply until I manually bring the interface up. The LEDs on the RJ45 jack illuminate solid until I issue the command above, then I get an activity indication and the port is working.

All the commands I have entered (beyond directory listings and 'cat’ing files) are in the original post. I’m so new I’m afraid to manually edit any of the configuration for fear of totally corrupting it.

Can you do a reboot.
What does the output of the command: dmesg
show.
Can you also upload the content of /var/log/syslog ?
They may contain information about the root cause.

“ifup” is a Debian command belonging to Debians /etc/network/interfaces network setup. The Raspberry foundation decided in their wisdom to use dhcpcd instead (/etc/dhcpcd.conf).
You must choose which one to use…
If you want to use /etc/network/interfaces for one interface it must be excluded from /etc/dhcpcd.conf (“denyinterfaces eth0” in the top of file).
Do not forget to restart the dhcpcd service and take down the interface:

service dhcpcd restart
ip link set eth0 down
ip addr flush dev eth0

Now you can setup the interface in the old and battleproven /etc/network/interfaces :slight_smile:
Edit: No need to reboot or reinstall. Those bad habits sadly inherited from Windos…

Ok, today’s progress. Deleted the DHCP reservation I’d made to get back to the original starting point. Loaded up a brand new SD with the openhabian image, just as before, but this time am avoiding wireless like COVID-19. Plugged her in and let it run. Ethernet came right up, rebooted several times, still works. Put the original SD card in, network is broken, swapped them a few times with the same results. Ergo, my initial impression that the openhabian-config modification to (attempt to) enable wireless is what broke things appears to be confirmed!

<rant>Where the bleeeep is this thing getting it’s IP address since the one it’s using is in the DHCP exclusion range on my Windows domain server, and (fortunately) doesn’t clobber any pre-existing devices? Does it just guess during installation? Is it “canned” and just got lucky it didn’t clobber something else? (If that’s the case, WHERE is THAT configuration, nothing I’ve run across contains that address, as that would probably provide clues?)

Why the bleeeep does it have to be so hard to find the right method (out of what seems like thousands of competing/conflicting/“I’m going to break YOU if you don’t do it MY way!” methods) to configure THIS network setup? Shouldn’t SOMEONE know exactly how the openhabian-config application (script???) works to be able to “nicely” back out of the blown-up wireless configuration? </rant>

So, I did the dmesg command as requested above and the ('grep’ed) results contain nothing about eth0! (The other, working, image has a few lines containing eth0) I have no clue yet how to get a copy of the “/var/log/syslog” to post. I am able to get files written to the non-networkable SD, such as the results of the dmesg or a copy of the syslog, but I am at total loss about how to get those files exposed to windows via samba (which also means that I have no idea what the paths are for the shares I do see in samba or where to find that information for myself!) when I DO get the network up. I tried to use a (two different, actually) USB SD adapter to make the old image file system available to the new image so that I could just copy my existing openhab configuration to the new image with the backup utility and ditch the old image, or at least make them available to Windows for analysis, but I don’t see anything resembling another file system in the 8GB range to try to mount it. (Can that not be done? Are USB SD adapters prone to being troublesome? Again, not totally worthless, just inexperienced…and learning) Info on getting either to work would be helpful. Will continue plodding along–I ain’t gonna let this beat me!

Update: I got what I thought was the backup from the flaky image copied over to the new image using samba and Windows, but the HABpanel is not coming up to the state I left the old image in. Is the openhabian-config method not the correct way to actually backup the configuration?

openHABian just uses unmodified Raspbian image for the part of getting IP address/interfaces configured. It should not do anything to networking if you install it on top of an already setup OS
unless you choose the menu options related to networking.
Just don’t mess with it manually. No system designed to work automated can cope with that.
There’s a debug guide and couple of things in the install docs you can try if it doesn’t work such as to disable IPv6.

Well, the relevant configuration files must then be:

/etc/dhcpcd.conf
/etc/wpa_supplicant/wpa_supplicant.conf

Not much one can do without functioning network…

A short note on this one, even though it may not be related to OH and OP´s discoveries…

Yesterday I did some small changes to my home office. I exchanged my Linksys switch with an Zyxel swicth. (thats all I did). Both swicthes are standard non-administrating gigabit switches (except the Linksys is a PoE, but this has nothing to do with the issue).

After the exchange, my Rpi4 would no longer work for networking… I used a hour dealing with boot errors, thinking something went wrong when I have turned off/on the Rpi4. But after an hour I suddenly noticed the LED port on the Zyxel switch where the Rpi4 was connected acting very strange. (It shoed connected for 2-3 seconds, then non-connected for 2-3 seconds, and then connected again… etc).
According to my Unifi Controller, then Rpi4 has been given its (Static) IP allright and it was “connected”. Everything was good to go. But I could not ping nor communicated with it…

I connected the Linksys switch to the Zyxel switch and then moved the Rpi4 to the Linksys switch. After that, the Rpi4 started to communicate again, and everything is fine again.

This is the first time I have ever seen a product which doesnt work with a standard non-administrated switch. It seem the Rpi4 has some serious problems with some switches (or even routers) on the ethernet port. here are a few threads about the same issue on the internet. Solution seems to be to force the link to 100mbit full duplex, which in my world is a total no-go, even for a Rpi running OH.

So watch out for this issue. It really fooled me :face_with_symbols_over_mouth:

[quote]Well, the relevant configuration files must then be:

/etc/dhcpcd.conf
/etc/wpa_supplicant/wpa_supplicant.conf
[/quote]
No answers there, stock file contents. The same on both images. No mention of the actual IP address it uses, either. I did note, further, that when the attached monitor blanks out momentarily during boot, the good image blank out is shorter in duration, and the bad image comes back with “dhcpcd failed to start”, or something like that. It disappears off the top of the screen pretty quickly and has a red icon of some sort. I’m sure it’s logged somewhere, but I don’t know where to look for it. This OS has many mysterious folders!

So, still no explanation for the networking failure, other than it seems there is a problem with Pi4s in general, though that doesn’t explain why one image works fine and the other doesn’t.

CORRECTION: I was mistaken, the files are different. Restoring the bad image to what the good image looks like…

UPDATE: That wasn’t all. “systemctl status dhcpcd.service” revealed that etc/network/interfaces contained lines that prevented it from starting due to interface settings. Commented all these lines and rebooted:
#allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp

The network is BACK!!!