Parameter setting org.eclipse.smarthome.network

In Paper UI -> Configuration -> System -> Network Settings I can chose my “Primary Address”.
This is a drop down list.

  1. Parameter Description is “A subnet (e.g. 192.168.1.0/24)” which is slightly different from “Primary Address”
  2. The only Value apart from “nothing” is indeed my primary address, but with Masking /24. So it’s neither my primary address nor my subnet, which would end with .0 typically (as in the example)
  3. If choosing this address, openHAB complains about a wrong parameter (which is correct…)
  4. I couldn’t find the corresponding parameter in a configuration file (I would have guessed this parameter would be set in runtime.cfg)

Version is openHAB 2.2 (saw this for a while, don’t know when it emerged exactly)
Any ideas?

I would like to know why this parameter is needed at all?

Well, at least I see no other errors beside the “this parameter has an invalid value” (I don’t remember the exact wording)
But to be honest, My productive system is still OH1.8.0 and OH2.2 is for testing and preparing the upgrade…

You did not understand me (very bad English). I want to know what function this setting performs? Why is this necessary?

correct :slight_smile: The title should be something like: "Primary Subnet Address"
It looks like this “Primary Address” description is coming from the Karaf config property: “primaryAddress”

correct :slight_smile: The Subnet Address should be displayed as “xx.xx.xx.0/24” in the pull-down menu.
A host address would be: “xx.xx.xx.xx/32”

I don’t get any errors when I set it in PaperUI. Do you have any errors logged?

It is saved in /var/lib/openhab2/config/org/eclipse/smarthome/network.config

Here is what I tried after I defined it in Paper UI -> Configuration -> System -> Network Settings:

From the console:

Pid:            org.eclipse.smarthome.network
BundleLocation: null
Properties:
   primaryAddress = 172.16.13.100/24
   service.pid = org.eclipse.smarthome.network

After a service restart, it stays the same (so it is persistent).
I stopped OH2 service, manually changed the network.config file, started OH2 and it worked fine but it doesn’t display anymore on PaperUI

primaryAddress="172.16.13.0/24"
service.pid="org.eclipse.smarthome.network"

from console:

Pid:            org.eclipse.smarthome.network
BundleLocation: null
Properties:
   primaryAddress = 172.16.13.0/24
   service.pid = org.eclipse.smarthome.network

I also tried to set it on: /etc/openhab2/services/runtime.cfg and it also worked fine.

org.eclipse.smarthome.network:primaryAddress = 172.16.13.100/24

It updated the /var/lib/openhab2/config/org/eclipse/smarthome/network.config file contents after a service restart.
When set to the “wrong” value: It shows up also on PaperUI

Running on 2.2.0-Snapshot Build #1096

If I remember well, this is used for cases where you have multiple interfaces and/or IP Subnets on your host running OH2 and it helps some bindings get callbacks from remote hubs etc. Link

Ps: There is also org.eclipse.smarthome.core.net.NetUtil which is using the correct subnet address

Ps2: Maybe we should raise an Issue on ESH for smarthome.network to use getIpv4NetAddress instead of getPrimaryIpv4HostAddress ? or to change the description in PaperUI ? @Kai

this I tried to find out :slight_smile:

Sure :slight_smile:

13:28:02.173 [INFO ] [e.core.internal.i18n.I18nProviderImpl] - Locale set to de_DE, Location set to 49.9111633,8.6605176, Time zone set to Europe/Busingen
13:28:03.012 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:03.022 [INFO ] [i.dashboard.internal.DashboardService] - Started dashboard at http://192.168.10.150:8080
13:28:03.028 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:03.035 [INFO ] [i.dashboard.internal.DashboardService] - Started dashboard at https://192.168.10.150:8443

...

13:28:30.067 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'squeezebox:squeezeboxserver:lms' changed from INITIALIZING to ONLINE
13:28:30.081 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.082 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.082 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.082 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.089 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.136 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.138 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.138 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.138 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.138 [WARN ] [rg.eclipse.smarthome.core.net.NetUtil] - Invalid address '192.168.10.150/24', will use first interface instead.
13:28:30.194 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'squeezebox:squeezeboxplayer:lms:SqueezeTech' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING

I skipped other messages, but I think, this error message will not be very helpful either :wink: should I test it with NetUtil logging set to DEBUG?

After an upgrade to Openhab 2.2, I get issues related to this setting. The lgwebos binding supposedly requires this to be set to some sound value (I have a VPN interface also on my Openhab server), but when I chose the option in the PaperUI (192.168.1.20/24), then the squeezebox binding stopped working - and it did not help the lgwebos binding.

For the moment I have reset the primaryAddress to an empty string in network.config, and squeezebox is at least working

lgwebos worked in Openhab 2.1 (when it was called ‘connectsdk’), but not in OpenHAB 2.2, and I suspect it might be related to what is being seen in this thread.

I am using openhab 2.2 stable in a docker enviroment with host networking. So i have got two interfaces, the docker-one and the host-one.
In paper-ui i can set the right interface but this is not “docker-style”, here it would be better to save the setting in an file like the runtime.cfg etc.

Greetings

I was getting also error when starting the OH under docker swarm with multiple overlay networks. OH choses the wrong network and interface.
The value can not be set through paper ui, as the suggestions are wrong.
Editing /var/lib/openhab2/config/org/eclipse/smarthome/network.config and setting

broadcastAddress="192.168.3.255" --> broadcast address
primaryAddress="192.168.3.0/24"    --> subnet address

removes the warning of multiple address and the right interface is selected.

Running this thread for further findings arroung docker swarm environment:
Deploying OH 2.4.0 to docker swarm