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

Address Collision #30

Closed
MattHanson15 opened this issue Jun 23, 2022 · 6 comments
Closed

Address Collision #30

MattHanson15 opened this issue Jun 23, 2022 · 6 comments

Comments

@MattHanson15
Copy link

I am receiving an address collision error in the Homebridge log. This is the only Homebridge instance I have and I don't use any other remote apps for the TV. I do have the Google Home app on my phone but the TV is not paired with the app and shows up only as a local device. I see the TV and the speaker listed as accessories in Homebridge and I manually added the TV in the Apple Home app.

timeout
192.168.1.74 Remote Connection closed false
Start Remote Connect
192.168.1.74 Remote secureConnect
192.168.1.74 Receive : {"remoteConfigure":{"code1":639,"deviceInfo":{"model":"Smart TV","vendor":"TCL","unknown1":1,"unknown2":"9","packageName":"com.google.android.tv.remote.service","appVersion":"5.1.415324728"}}}
Create Remote {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"Raspberry Pi 3 Model B Plus Rev 1.3","vendor":"Raspberry Pi Foundation","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
Sending {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"Raspberry Pi 3 Model B Plus Rev 1.3","vendor":"Raspberry Pi Foundation","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
[23/06/2022, 13:16:40] [homebridge-androidtv] Discover : {
host: '192.168.1.74',
name: 'Android TV',
paired: true,
pairing: false,
powered: false,
online: true,
started: true,
volume_max: 100,
volume_current: 13,
volume_muted: true,
app_package_current: '',
type: 31
}
[23/06/2022, 13:16:40] [homebridge-androidtv] Android TV Registering device 3b519379-a050-48f5-a9dc-7ea85fb87713
[23/06/2022, 13:16:40] [homebridge-androidtv] Android TV Adding channel France Info 8f75293a-f81e-4706-b891-b406747f5fd1
[23/06/2022, 13:16:40] [homebridge-androidtv] Android TV Adding key Power 70b8dc3b-9772-495a-af49-4df46fd00220
[23/06/2022, 13:16:40] [homebridge-androidtv] Android TV Adding key Volume Down af4b7f7f-c9d1-4a91-b6ab-831b0514a4ac
[23/06/2022, 13:16:40] [homebridge-androidtv] Android TV Adding application Netflix c58f4efc-e96c-4a9c-8042-aeb6620ff5ad
192.168.1.74 Receive : {"remoteSetActive":{}}
Create Remote {"remoteSetActive":{"active":622}}
Sending {"remoteSetActive":{"active":622}}
Error: Accessory Android TV experienced an address collision.
at BridgeService.handlePublishExternalAccessories (/usr/local/lib/node_modules/homebridge/src/bridgeService.ts:419:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

@Neirth
Copy link

Neirth commented Jul 1, 2022

Exactly the same thing happens to me, in fact, my Homebridge instance on Ubuntu Core is sending it to take studs. @louis49, do you know if you put any conditionals to check that the device exists before registering it again?

@louis49
Copy link
Owner

louis49 commented Jul 1, 2022

I check only if the device exist on json config :


I publish this device as an external device, then, it's not saved in homebridge memory : the device is newly created after reboot.
Is this working better after cleaning all homebridge working directories ?

@Neirth
Copy link

Neirth commented Jul 5, 2022

The subject of "After cleaning the Homebridge working directories" I did not fully understand. I guess it will be due to the limitation of English not being a mother tongue on my part.

Ignoring that detail, I understand that you meant after a server restart, in which case it takes time for the problem to appear, but it does. This especially happens with the power modes of commercial Android TV devices, which enter a deep sleep state and disappear from the Network, so this plugin will try to connect without success, destroying the object. When it detects it again, it rebuilds the object, sometimes causing the problem we described.

By the way, there is a detail that has been going around my head these days, and it is the fact why don't you register the devices to the Homebridge memory from the private JSON information that you have, and not instead of waiting for the device is online?

This would avoid having to re-register known devices after server startup, and even if it is not available, automation services such as Apple's own or Node-Red would not be violently unconfigured because they saw that the device was not registered in the Homebridge memory.

In addition to the fact that it would be quite useful to you since you could control that object instance representing the device, even if you are within the network or not, apart from saving you the problem of address collision.

In advance, I apologize that I couldn't read your comment before @louis49.

We stay in touch through this issue to see how we can resolve this. ;D

Greetings.

@louis49
Copy link
Owner

louis49 commented Jul 12, 2022

Hi @Neirth
About your questions and remarks :
Homebridge working directories : look at .homebridge directory in your personal directory
The deep sleep state need to be deactivated because it cause a lot of problems ; the main is that you can't start your device with this current plugin after a deep sleep state
Nevertheless, your lead is serious and interesting. I don't have much time to devote to it at the moment (especially since it should be fixed by disabling deep sleep) but if you want to propose a PR don't hesitate, otherwise I'll take a look at one of these days.

Thank you for your precise and well-explained message ;D

@andycylam
Copy link

andycylam commented Aug 22, 2022

I have the exact same problem which is annoying cause it crashes the homebridge. I am thinking it is in some kind of deep sleep mode as I checked :8182 it says my TV is off. However I looked through all the settings but I can't find anything to disable deep sleep. And the TV somehow keeps switching online and offline which causes this issue.

@andycylam
Copy link

I solved this issue by adding checking on discovery: check if the uuid of the TV exists.

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

4 participants