Ethernet and WiFi Setting

Tags: #<Tag:0x00007efeb734d688> #<Tag:0x00007efeb734d570>

I started my very first openHab setup last night on a RPI3 and its all going well, slowly getting to grips with it all, which is a bit of a learning curve as I have extremely limited knowledge of Linux code.

I have initially had my OH running on WiFi while I set it up but now I want to install it in its permanent home, where I would like it to use Ethernet. I thought that as I had connected it to Ethernet whilst setting it up which was working before entering the WiFi settings it would be as straight forward as saving the WiFi settings in the config tool as blank but this did not work. I also tried to set a static IP for eth0 in the dhcpcd file but again got no joy.

Am I missing something?

Also, if it is possible to set the Ethernet as default would it be possible to use the Wifi as a backup in case my Ethernet hub goes down?

1 Like

what do you mean with “saving Wifi Settings in config tool”? which config tool, what’s your Problem exactly. please add more info

you were asked for that information, but you deleted it - so please fill in now:

* Platform information:
  * Hardware: _CPUArchitecture/RAM/storage_
  * OS: _what OS is used and which version_
  * Java Runtime Environment: _which java platform is used and what version_
  * openHAB version:
* Issue of the topic: please be detailed explaining your issue
* 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:
1 Like

Apologies about the missing info, I didn’t realise it was required

  • Platform information:
    • Hardware: RPI3 Model B Rev 1.2 with 16GB SD Card
    • OS: OpenHABian 2.2.0-1
    • Java Runtime Environment: Not sure, default one that was installed with the OpenHABian disk image
    • openHAB version: 2.2.0-1
  • Issue of the topic:

After I first booted the OH I entered ‘sudo openhabian-config’ from the command line then in the Systems Settings Menu, selected Wifi Setup and entered my Wifi SSID and Password. This allowed me to access the the OH over my Wifi Network. When I plug the the RPI3 in its permanent location in my house it will be adjacent to Ethernet hub so I would prefer to use Ethernet comms instead of Wifi comms. How do I change the settings to Ethernet instead of Wifi? I have tried removing the Wifi SSID and Password in the OpenHABian Configuration Tool by leaving both SSID and Password blank and selecting OK, this removed the Wifi settings but I could not access the OH over Ethernet comms. I also tried to edit the /ect/dhcpcd.conf file and entered the following static IP settings like I have done on previous RPI projects but this did not work -

interface eth0

static ip_address=192.168.0.XX/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

What am I missing?

Hope that helps

  • 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:

thanks, now we have a better overview of your system and your situation.

first of all: openHAB will look for network interfaces and use one (I figured, it will use WiFi before Ethernet, but that one could be of the lower IP address of my WiFi).
So, what you basically did is to configure the underlying network configuration of your Pi. So, that’s not openHAB related, but siply Linux/Raspbian configuration. Normally raspbian (and openHABian is built on it) will work with DHCP, meaning the Pi will get its IP address from your router. What you did is to mess with this and add static IP configuration - it should work also, but this one depends on your router and your overall network configuration.

So, please make sure:

  1. the Network connection, you connected your Pi on is active (meaning it’s patched through to your router)
    I know, sounds basic, but sometimes you’re connected to a dead one.
  2. deactivate the static configuration you changed and revert to dynamic DHCP
  3. just plug Ethernet back in

Raspbian (and openHABian) works out-of-the-box with DHCP ethernet.

Your /etc/dhcpcf.conf file looks fine (except I would add more dns servers, but that´s just me). Are you sure your setting for eth0 in /etc/network/interfaces is

iface eth0 inet manual

and not

iface eth0 inet dhcp

Thanks Guys, I have actually put everything back to DHCP and got it all working on Ethernet now, I have also decided to reserve the IP address on my router instead of assigning the OH with a static IP

1 Like

Hi, I had a similar problem and can’tfind a thread about it. Last weekend (March 18) I tried to setup WiFi on my RPI3 with openhabian which essentially worked. Then I went about configuring further componants and I updated openhabian in the configuration command line console. After that it was nor possible to change the network (wifi) settings from this console anymore and I was not able to bring back the ethernet cable connection either. I had to physically setup keyboard and screen on the RPi to access it again.

After looking around a bit I found this article which helped me, I believe something about the newest versions of components in the update are not working well for network settings:
https://www.raspberrypi.org/forums/viewtopic.php?t=191678

To get my system back I had to split the dhcp configuration into multiple files in the subdirectory /etc/network/interfaces.d

I have no clue what stretch, dhcpcd, interfaces.d are but with the split configuration my system works again.

1 Like

That’s probably the way to do it with domestic routers.
When I get a new device I first let them connect to the network with DHCP.
I then log in the router config and reserve that IP for that device.
I then go back to the device and configure static IP.
Last thing is I add this to a list in a “cheat” file where I keep the IPs the different ports that the OH server uses etc…

I have a similar issue. I did not try to set a static address but I’m not able anymore to connect on WIFI. Currently I need to connect a monitor on the HDMI port and a mouse-keyboard on the USB port to get access to RPI 3. I’m working on latest update of Openhabian.

@arober02, you talked about splitting DHCP configuration in subdirectory /etc/network/interfaces.d
On my setup, this directory is empty? Is that normal or the cause of my problem?

Hi, the folder was empty on my pi and I took the dhcp configuration, removed each line (block of lines) that concerned one IP “device” like the wifi, eth0, etc and created a separate file in that subdirectory for that individual device configuration. Then my ethernet worked again.

It looks to me like there is a new way of configuring ip acquisition by dhcp in the updated packages.

Excuse me, but this does not work for the latest raspbian version that uses openhabian, stretch

Today in my new RPPi 3B+ with openhab runing I configured the wifi without problem, but I lost the ethernet lan conecction.
Solution:
Create a new plain file in /etc/network/interfaces.d folder. Inside of the new file (does not the matter the name) I define the lost interface:
auto eth0
iface eth0 inet dhcp

reboot
and thats all

Step by step, what I did:

  1. ssh openhabian@openhabianpi
  2. sudo nano /etc/network/interfaces.d/ethnew
  3. write two lines:
    auto eth0
    iface eth0 inet dhcp
  4. save file (ctr + o), exit file (ctr +x)
  5. sudo shutdown now -r
7 Likes

amazing ! you save me ! i don’t know why i lose me eth0… i look many tricks…but only your help me ! thanks

thanks, it helped.
OpenHABian 3. Fresh install, just after openhabian-config. Some strange behaviour after wifi and other settings. RPi4b 4GB