Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hostname not correct, when Thing added via discovery #5

Open
thjunge11 opened this issue Sep 26, 2017 · 11 comments
Open

Hostname not correct, when Thing added via discovery #5

thjunge11 opened this issue Sep 26, 2017 · 11 comments

Comments

@thjunge11
Copy link

thjunge11 commented Sep 26, 2017

Environment:

  • Openhab 2.1 running on Pine64/openhabian
  • Volumio running on Raspberry PI 3

Precondition:

  • volumio device (named "VolumioSZ" in volumio settings) is automatically discovered and appears in PaperUI inbox

Action:

  • Add device from inbox

Actual result:

  • The thing has status offline
  • The hostname for this device is shown with "VolumioSZ.local."
  • When changing the hostname to the correct ip address, it appears as online
  • After next restart of openhab service, the hostname is set back to "VolumioSZ.local." automatically and thing is offline again
@thjunge11
Copy link
Author

thjunge11 commented Oct 4, 2017

I guess changing
properties.put("hostname", service.getServer());
to
something like
properties.put("hostname", service.getHostaddress());
would do the trick, but then of course you get the IP which is static from there one, right?

@patrickse
Copy link
Owner

I need to check my environment. I guess I am using the config file and not the discovery stuff. That´s maybe the reason why I do not stumble upon this behaviour.

@patrickse
Copy link
Owner

patrickse commented Oct 19, 2017

@thjunge11
I´ve done some tests... and finally decided to stay with service.getServer() as it should always be possible to use the mdns name of a device. For whatever reason I could not connect to a host by its mdns name.

I´ve done a little change but I still need to test... If you´re keen enough please build the 0.0.11 branch and give it a try. ;)

But there´s still the question, why the IP is changed to hostname inside the thing configuration...

patrickse added a commit that referenced this issue Oct 19, 2017
@patrickse
Copy link
Owner

@thjunge11 I´ve tested the changes with some vms... it looks like it´s working now. The auto-discovery is just the initial value and can be overridden by custom values. These values will not be changed by the binding after the restart of openhab.

So I guess it´s working.. Maybe you can give me some feedback. If it´s working I will merge the 0.0.11 branch.

@patrickse patrickse mentioned this issue Oct 19, 2017
@thjunge11
Copy link
Author

thjunge11 commented Oct 20, 2017

@patrickse, i will try to test it today or tomorrow and will give you feedback.

thjunge11 added a commit to thjunge11/org.openhab.binding.volumio2 that referenced this issue Oct 21, 2017
thjunge11 added a commit to thjunge11/org.openhab.binding.volumio2 that referenced this issue Oct 21, 2017
@thjunge11
Copy link
Author

thjunge11 commented Oct 21, 2017

Here are my test results, with latest commit

Unfortunately, same as before.

Discovery works smoothly:

10:33:45.701 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - Service Device: [ServiceInfoImpl@31507647 name: 'VolumioSZ._rvlci4lzbme3._sub._Volumio._tcp.local.' address: '/192.168.178.26:3000 ' status: 'DNS: JmDNS-IP-1 [/192.168.178.77] state: probing 1 task: null' is persistent, has data
	volumioName: VolumioSZ
	UUID: e0fc5403-7e35-4b5c-9c35-59c4416d5ee9]
10:33:45.716 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - PropertyName: volumioName
10:33:45.719 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - PropertyName: UUID
10:33:45.722 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - return new ThingUID(volumio2:player, e0fc5403-7e35-4b5c-9c35-59c4416d5ee9-VolumioSZ);
10:33:45.727 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - Thing UID: volumio2:player:e0fc5403-7e35-4b5c-9c35-59c4416d5ee9-VolumioSZ
10:33:45.730 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - DiscoveryResult: DiscoveryResult [thingUID=volumio2:player:e0fc5403-7e35-4b5c-9c35-59c4416d5ee9-VolumioSZ, properties={hostname=VolumioSZ.local., protocol=http, port=3000}, flag=NEW, label=VolumioSZ, bridgeUID=null, ttl=-1, timestamp=1508574825729]
10:33:45.738 [INFO ] [smarthome.event.InboxAddedEvent     ] - Discovery Result with UID 'volumio2:player:e0fc5403-7e35-4b5c-9c35-59c4416d5ee9-VolumioSZ' has been added.
10:33:45.738 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'volumio2:player:e0fc5403-7e35-4b5c-9c35-59c4416d5ee9-VolumioSZ' to inbox.
10:33:45.740 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - Service Device: [ServiceInfoImpl@31410331 name: 'volumiowz._rvlci4lzbme3._sub._Volumio._tcp.local.' address: '/192.168.178.97:3000 ' status: 'DNS: JmDNS-IP-1 [/192.168.178.77] state: probing 1 task: null' is persistent, has data
	volumioName: Volumiowz
	UUID: 2ba79d91-4a16-4dde-aae5-0b3261a28430]
10:33:45.741 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - PropertyName: volumioName
10:33:45.742 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - PropertyName: UUID
10:33:45.743 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - return new ThingUID(volumio2:player, 2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz);
10:33:45.745 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - Thing UID: volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz
10:33:45.746 [DEBUG] [scovery.Volumio2DiscoveryParticipant] - DiscoveryResult: DiscoveryResult [thingUID=volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz, properties={hostname=volumiowz.local., protocol=http, port=3000}, flag=NEW, label=Volumiowz, bridgeUID=null, ttl=-1, timestamp=1508574825746]
10:33:45.752 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz' to inbox.
10:33:45.753 [INFO ] [smarthome.event.InboxAddedEvent     ] - Discovery Result with UID 'volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz' has been added.

Thats what happens when adding a volumio thing from inbox

10:37:42.461 [INFO ] [smarthome.event.InboxRemovedEvent   ] - Discovery Result with UID 'volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz' has been removed.
10:37:42.468 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz' has been added.
10:37:42.485 [DEBUG] [ing.volumio2.handler.Volumio2Handler] - Trying to connect to Volumio2 on http://volumiowz.local.:3000
10:37:42.486 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz' changed from UNINITIALIZED to INITIALIZING
10:37:43.535 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'volumio2:player:2ba79d91-4a16-4dde-aae5-0b3261a28430-Volumiowz' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): volumiowz.local.: Name or service not known

Might be an mdns issue, not sure how to debug this.

@patrickse
Copy link
Owner

Indeed looks like mdns problem. Which operating system are you using?

@thjunge11
Copy link
Author

Sorry for answering that late, had some vacation :)

I am running openhab on a PINE64 with openhabian and volumio2 on a raspberry PI 3

@GHJosh
Copy link

GHJosh commented Dec 21, 2017

I also have the problem, that the 'Volumio 2 Player' Thing is shown as offline in OpenHab2.
I am running OpenHab 2 and Volumio 2 in parallel on a Raspberry Pi 3. I tried it with Volumio's local IP address (192.168.1.60), the volumio.local as well as 127.0.0.1. It always returns

13:43:36.122 [ERROR] [ng.volumio2.internal.Volumio2Service] - Could not connect to Volumio on 192.168.1.60

Any suggestions ?

@patrickse
Copy link
Owner

Hm.... so it tells you that it cannot connect to 192.168.1.60? So it´s not a resolution problem but a connection problem?

I will need to invest some time to reproduce the problem.

@GHJosh
Copy link

GHJosh commented Dec 29, 2017

So it seems. Please tell me if you need any further information.
I'd be very happy if I could use your binding to control Volumio via OpenHab :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants