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

initTopology() not yet called - new symptom #182

Closed
JeffGoldner opened this issue Aug 16, 2021 · 30 comments
Closed

initTopology() not yet called - new symptom #182

JeffGoldner opened this issue Aug 16, 2021 · 30 comments
Labels

Comments

@JeffGoldner
Copy link

Issue

Recent error message, initTopology()

Log Messages

[8/16/2021, 11:33:50 AM] [Sonos] error: SyntaxError: initTopology() not yet called
at ZpClient.checkInitTopology (/homebridge/node_modules/homebridge-zp/lib/ZpClient.js:527:13)
at ZpClient.get bootSeq [as bootSeq] (/homebridge/node_modules/homebridge-zp/lib/ZpClient.js:593:10)
at ZpPlatform.heartbeat (/homebridge/node_modules/homebridge-zp/lib/ZpPlatform.js:150:40)
at ZpPlatform.emit (events.js:400:28)
at ZpPlatform.emit (/homebridge/node_modules/homebridge-zp/node_modules/homebridge-lib/lib/Delegate.js:174:13)
at ZpPlatform._heartbeat (/homebridge/node_modules/homebridge-zp/node_modules/homebridge-lib/lib/Platform.js:303:10)
at ZpPlatform._beat (/homebridge/node_modules/homebridge-zp/node_modules/homebridge-lib/lib/Platform.js:291:42)
at Timeout._onTimeout (/homebridge/node_modules/homebridge-zp/node_modules/homebridge-lib/lib/Platform.js:281:12)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)

Debug Files

@ebaauw
Copy link
Owner

ebaauw commented Aug 16, 2021

Please capture and attach a debug log file.

New symptom since when, since what change? Does the message appear shortly after starting Homebridge or after a longer time? Did you power-on or reboot a zone player just before the message appeared?

I don't think this is impacting any functionality? I suppose the message could appear when a new zone player is discovered and still being probed, when the timer to check whether the zone player is still online fires (once every five minutes).

@adavison007
Copy link

I have the same issue since the last update... reverting to the previous version does not resolve....

Screenshot 2021-08-22 at 21 13 20

@adavison007
Copy link

Just updated node too to try to resolve and am getting this issue...

Screenshot 2021-08-22 at 21 26 20

@adavison007
Copy link

I removed the plugin and reinstalled, 'i don't see how to add the speakers again, how doi clean the cache without removing all the accessories from other plugins

@adavison007
Copy link

I removed the plugin and reinstalled, 'i don't see how to add the speakers again, how doi clean the cache without removing all the accessories from other plugins

@ebaauw OK, found how to delete the previous speakers in the homebridge settings... reinstall of your app and re adding speakers worked fine!

@ebaauw
Copy link
Owner

ebaauw commented Aug 23, 2021

I still have the same questions as before. Without those answers, I cannot analyse what’s happening.

@adavison007
Copy link

adavison007 commented Aug 23, 2021

@ebaauw Sorry for missing your question. The speakers in homekit became "Unresponsive" and could no longer be used. The switches were able to be used. This is why I had to delete all and start again. The switches remained functional. I still do not understand why I have a switch and a speaker tile... why not just speaker, or is this a miss understanding of the setup?

@ebaauw
Copy link
Owner

ebaauw commented Aug 24, 2021

The speakers in homekit became "Unresponsive" and could no longer be used. The switches were able to be used. This is why I had to delete all and start again.

I don't think it is, actually. Nine out of ten times, accessories showing No Response are caused by a failed network connection between your iDevice and the accessory. This is usually resolved by switching off and back on WiFi on your iPhone or iPad. Note that the switches are bridged whereas the speakers are standalone accessories, that need to be paired to HomeKit individually.

why not just speaker,

The speakers only show in Home, not in other HomeKit apps. And Home doesn't support all of HomeKit, so you want to use Eve or another HomeKit to use the full features of Homebridge ZP (and many other Homebridge plugins).

@adavison007
Copy link

@ebaauw Thanks for the update. I am not technical, just to confirm, the issues occurred after I rebooted home bridge following the update of your plugin. The speakers showed as non responsive in my home app on my mac book (wifi), my iMac (wired ethernet) and also my iPhone (wifi). Hope this helps.

@ebaauw
Copy link
Owner

ebaauw commented Aug 24, 2021

I really need a debug logfile, from starting Homebridge, leading up to the error.

@JeffGoldner
Copy link
Author

homebridge.log.txt

Hope this helps. I updated node this AM, then your latest plug-in version, then restarted the docker container.

@ebaauw
Copy link
Owner

ebaauw commented Aug 24, 2021

Yeah, I think this got the info I need, thanks. It definitely has some fun ingredients: a Sonos Boost, several zone players with a new IP address. I need to see if I can re-construct what happened. There's actually another error in your log as well.

@JeffGoldner do you also have a Boost, by chance?

@adavison007
Copy link

@ebaauw No boost for me... I would send a log, but have no idea how to get it for you and how long it saves the info for?

@JeffGoldner
Copy link
Author

Yeah, I think this got the info I need, thanks. It definitely has some fun ingredients: a Sonos Boost, several zone players with a new IP address. I need to see if I can re-construct what happened. There's actually another error in your log as well.

@JeffGoldner do you also have a Boost, by chance?

Yes, I do have a Boost. I also have one Play:5 second gen in the garage that has native Airplay 2, since it looks like that one might be an issue? All the other Sonoses are not Airplay.

@ebaauw
Copy link
Owner

ebaauw commented Aug 24, 2021

I do have some zone players with native Airplay2, they should work fine. I don’t have a Boost, though, and it did cause some unexpected (by me, at least) issues in the past.

@adavison007
Copy link

@ebaauw I've just rebooted my homebridge and the speakers are no longer responsive again... before I remove and re add again, did you want me to get a log, if so how do I do this?

@ebaauw
Copy link
Owner

ebaauw commented Aug 24, 2021

Could you check with the Discovery app (on iOS or macOS, see http://www.tildesoft.com), if the TV accessories are advertising themselves over Bonjour? They should appear under _hap._tcp, next to the Homebridge bridge accessory.

Are you using Docker? Make sure the persist directory is indeed persisted between reboots.

If you search for new accessories, do the TV accessories show up (probably with the different four-character suffix)?

@adavison007
Copy link

I run homebrige on PI, no docker. I run sonos zp as a child bridge, see screen shots.... let me know what to do next? I've click add new accessory and they do not show...

Screenshot 2021-08-24 at 20 42 03

Screenshot 2021-08-24 at 20 42 36

@ebaauw
Copy link
Owner

ebaauw commented Aug 24, 2021

I think that is the advertisement for the child bridge? I don't see any for the TV accessories? Did you see messages in the log that the external accessories were started, and you needed to pair them manually?

@adavison007
Copy link

I think that is the advertisement for the child bridge? I don't see any for the TV accessories? Did you see messages in the log that the external accessories were started, and you needed to pair them manually?

No, didn't see anything, sorry. I am now deleting the plugin, deleting the child bridge and starting again

@adavison007
Copy link

So after reinstall they appear.... Bedroom, Patio, BBQ etc etc

Screenshot 2021-08-24 at 22 03 18

@adavison007
Copy link

@ebaauw and they still work after a reboot :)

@ebaauw
Copy link
Owner

ebaauw commented Aug 26, 2021

I think we're dealing with two different issues:

  1. The Boost might not report the topology, or it might not be listed in the topology, causing the UnhandledPromiseRejectionWarning: SyntaxError: initTopology() not yet called when Homebridge ZP tries to list the topology, and the error: SyntaxError: initTopology() not yet called every 10 minutes, when Homebridge ZP reports when it's last seen each zone player.
    @JeffGoldner @adavison007 to confirm, could you please run zp -H x.x.x.x eventlog, substituting the IP address of the Boost, and list the ZoneGroupTopology event(s).
    @adavison007 I think the UnhandledPromiseRejection causes the TV accessories not to be exposed.
  2. When a zone player receives a new IP address while Homebridge ZP is down, on startup Homebridge ZP tries to initialise the zone player using the old IP address (from cachedAccessories). This, of course, fails. Homebridge ZP does pick up the new IP address from the UPnP advertisements and/or the topology events from other zone players, but it doesn't re-try the init after updating the new address. This causes the Sonos_xxxxxxxxxxxxxxxxx: error: SyntaxError: init() not yet called messages.
    @adavison007 Did you use a new username for the child bridge on re-install? Or did you remove the Homebridge ZP accessories from cachedAccessories? Did you still see the init() not yet called messages on your last reboot (after which the TV accessories still work)? Did the Boost get a new IP address? This would cause it not to be initialised, so the UnhandledPromiseRejection never occurs? What topology is listed in the log from your last reboot?

ebaauw added a commit that referenced this issue Aug 26, 2021
Bug fixes, see #182:
- `ZpClient` wasn't initialised when zone player got a new IP address while Homebridge ZP was down, see #182.
- Guard each individual zone player with `try`/`catch` when listing topology, creating accessory delegates, and listing last seen.
- Log "probing done" message with address instead of name (which isn't available when zone player is unreachable under given address).
@adavison007
Copy link

@ebaauw Many thanks for spending the time looking into this. Again I'm not a tech, so I'll do my best to answer.

  1. I do not use a boost on my system, so this would not affect my set up

  2. I did reboot my router the same day I had the issues.... I also rebooted the homebridge a few times as I was making various config changes.. so maybe the IP issue is relevant due to my devices being dished out new ip address's from the router?

All is working fine now... in fact, I have not added the bridge to homekit this time... I simply added the speakers only (wasn't sure if this is ok) but all works perfectly.

@ebaauw
Copy link
Owner

ebaauw commented Aug 26, 2021

I do not use a boost on my system

You were using it, according to your log file:

[8/24/2021, 10:36:03 AM] [Sonos] RINCON_7828CA73966C01400 [192.168.1.3]: Boost: Sonos Boost (BR200) v11.2.10, reached over local address 192.168.1.61

Did you unplug it from power, after you captured the log file? That would explain the TV accessories now continue to work after the reboot.

I simply added the speakers only (wasn't sure if this is ok) but all works perfectly.

That's OK if you only use Home.

@adavison007
Copy link

@ebaauw Thanks for the update. I think you may have me confused with the other guy... I didn't supply a log file. I've never owned a boost and also the IP range you reference is not the range I use :)

@ebaauw
Copy link
Owner

ebaauw commented Aug 26, 2021

Indeed, I have. I'm so sorry, my bad.

That means that the lack of initialisation actually caused the TV accessories not to be exposed. That does seem to make more sense to me. The switches might have appeared to be working (not show No Response), but I doubt they did work. The bridged HomeKit accessories are restored from cache, but the delegates handling the logic how to react to changes made from HomeKit probably weren't created.

Rebooting a router would cause it to lose the administration of what IP addresses it handed out to which device, so that would cause your zone players to get new IP addresses. With my commit above, Homebridge ZP should handle that correctly. If you want, I can release a beta version for you to test. I also understand if you don't want to mess with your now working setup.

@adavison007
Copy link

@ebaauw happy to try a beta if you wish me to, I have just installed you update just now to 1.4.2

@ebaauw
Copy link
Owner

ebaauw commented Aug 28, 2021

After running for a day I saw no weird side-effects, so I published a regular release. That should handle the changing IP addresses.

@ebaauw ebaauw added the bug label Aug 29, 2021
@JeffGoldner
Copy link
Author

@ebaauw I update the plugin just now and no longer see the reported problem. The Boost is showing up in the log as seen - not that there is much to do with it.
Closing the issue! Many thanks.

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

No branches or pull requests

3 participants