I am using openHAB 2.5.11 on a Raspberry 4 with raspbian OS. I ran into an error when installing some software that requires port 1900 UDP (unifi controller) and found out that openHAB is using that port. I am not able to find out, what binding is causing this.
The bindings I use are: mqtt,astro,exec,fritzboxtr0641,kodi,weather1,wol1,network,systeminfo,tcp1
I have configured the tcp1 binding to listen on UDP 40001 and nothing else.
My research showed that UPNP uses UDP 1900 - is this an OH thing or is some binding using it? What logs could I enable to find out more?
I did the following:
netstat -tulpn | grep 1900
udp 0 0 0.0.0.0:1900 0.0.0.0:* 4849/deCONZ
udp6 0 0 :::1900 :::* 1481/java
for my instance.
As far as I understand https://github.com/openhab/openhab-addons/issues/698 OH itself plus a subset of bindings require this port to join UPNP.
I did the same and that’s how I found that OH is listening on that port. The question for me is what is causing this, do I need this and could I prevent it.
I have started poking around with a blank docker openhab image and it seems the issue is with hue & deconz binding. Setting the following in runtime.cfg did not help though
You can use e.g. nmap to get information about the UPNP service behind port 1900 by running
nmap -sU -p 1900 --script=upnp-info YourServerHere
In case of deCONZ the reply will look like:
PORT STATE SERVICE
1900/udp open upnp
| Server: Linux/3.14.0 UPnP/1.0 IpBridge/1.26.0
|_ Location: http://192.168.0.26:8090/description.xml
MAC Address: 22:DD:55:00:EE:68 (Unknown)
In case you disabled e.g. deconz, hue and the port is still in use I would expect to get a different content then.
Are we talking about the same things or did I get something wrong? I know that openHab is listening on 1900 UDP, but would like to find out which binding. I already found out that a fresh openHAB does not listen on the port, but as soon as I add hue or deconz it does. Wouldn’t nmap output always look the same when openHAB is listening?
Nonetheless, here is the output I am getting from your command:
Starting Nmap 7.70 ( https://nmap.org ) at 2020-12-20 16:49 CET
Nmap scan report for localhost (127.0.0.1)
Host is up.
PORT STATE SERVICE
1900/udp open|filtered upnp
Nmap done: 1 IP address (1 host up) scanned in 8.04 seconds
Hue binding for example uses openHABs UPnP implementation, therefore you will only find openHAB listed in nmap.
There are some bindings using UPnP.
OK, so there seems no way to find out which binding is using upnp besides trial&error. Also it seems that not all bindings regard the
discovery.BINDING:background=false setting - I assume it is not mandatory or should I file an issue with the bindings?
Probably I can ignore this now, since I moved my installation to docker without host-networking so that I can decide to not forward port 1900/udp.