I have a running OpenHAB instance running on a Windows 8.1 client at the moment. This is working fine, but it’d be easier to manage on Linux, so I’m trying to move it to a Debian VirtualBox VM on the same machine.
This generally works - but I’m having some issues with the Wemo binding. It’s refusing to do any discovery and errors out with: Could not start wemo device discovery java.net.BindException: Address already in use
I’m using the same bindings and configs as the Windows box. The VM is running with a bridged network, so it has an IP address on the same subnet as the host. I’m at a bit of a loss? Any suggestions?
2015-08-21 13:10:48.999 [ERROR] [.o.b.wemo.internal.WemoBinding] - Could not start wemo device discovery
java.net.BindException: Address already in use
at java.net.PlainDatagramSocketImpl.bind0(Native Method) ~[na:1.7.0_79]
at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:96) ~[na:1.7.0_79]
at java.net.DatagramSocket.bind(DatagramSocket.java:396) ~[na:1.7.0_79]
at org.openhab.binding.wemo.internal.WemoBinding.wemoDiscovery(WemoBinding.java:179) [bundlefile:na]
at org.openhab.binding.wemo.internal.WemoBinding.wemoCall(WemoBinding.java:295) [bundlefile:na]
at org.openhab.binding.wemo.internal.WemoBinding.sendCommand(WemoBinding.java:253) [bundlefile:na]
at org.openhab.binding.wemo.internal.WemoBinding.internalReceiveCommand(WemoBinding.java:135) [bundlefile:na]
at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:96) [org.openhab.core_1.7.1.jar:na]
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:42) [org.openhab.core_1.7.1.jar:na]
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.openhab.core.internal.events.EventPublisherImpl.sendCommand(EventPublisherImpl.java:56) [org.openhab.core_1.7.1.jar:na]
at org.openhab.model.script.actions.BusEvent.sendCommand(BusEvent.java:84) [org.openhab.model.script_1.7.1.jar:na]
at org.openhab.model.script.actions.BusEvent.sendCommand(BusEvent.java:51) [org.openhab.model.script_1.7.1.jar:na]
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
On the Windows 8.1 machine:
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) Client VM (build 25.51-b03, mixed mode)
So, slightly different I guess, but not fatally so I wouldn’t expect.
I did a netstat on the VM but couldn’t find anything that looked out of the ordinary (output below).
Since my post I’ve also tried updating the WEMO binding to the 1.8 snapshot. The code looked to be significantly improved so I thought it worth a shot. Using it I no longer get the error, but it also never discovers devices.
I’m wondering whether it’s a network routing issue? Something to do with SSDP packets (UPnP) traversing the bridge network of the VM? It’s a little beyond my knowledge though, so I’m not sure how to confirm this?
As a test I was going to package the same VM and get it running in VirtualBox on my mac. If this works, it’s not the VM, but the host. If it continues to fail, maybe Virtualbox related or the VM setup?
Interestingly, I tried doing a UPnP browse with the command line tool gssdp-discover -i eth1 --timeout=3 and I get no response from the Belkin devices. If I visit them directly (eg. http://192.168.2.196:49153/setup.xml) I get the correct xml file - but they don’t seem to be responding to discovery requests.
Unfortuately, I don’t know enough to be sure if I’m barking up the wrong tree (or not). Anyone have any thoughts?
Hi,
just checked with my firmware, it’s the same.
Within your first post you wrote that it was running fine under Win8, just your VM’s are causing problems?
Did you try the same on your MAC ?
It could probably be the VM, you are using VirtualBox ? Could you try VMware ?
My IDE is running in a VMware VM with XUbuntu on my Windows7 machine and I am not seeing any problem.
How is your VMs network configured ? Sharing IP with host or bridged to get an individual IP. I use bridged mode for my VM’s.
Ok good to know you’re using it successfully on a vm. I’m using virtualbox, with bridged networking, so the vm guest has an ip address on the same subnet as the host. So the only difference between us seems to be vmware / virtualbox.
I had setup this VM using Vagrant, which by default doesn’t set a default route for networking. So while I could connect fine to the server, it wasn’t able to route broadcast messages (and discovery).
Now that I’ve added a default gateway in networking, it’s working fine.