jsiegenthaler / homebridge-eosstb

A homebridge plugin for the EOS set-top box as used by Sunrise, Telenet, Ziggo, Virgin Media and maybe more in various countries on the Horizon Go (HGO) platform
https://github.com/jsiegenthaler/homebridge-eosstb
32 stars 4 forks source link

Control of Settop Box no longer possible since ca 10 January 2024 #112

Open jsiegenthaler opened 6 months ago

jsiegenthaler commented 6 months ago

In Switzerland and the UK the settop box can no longer be controlled as of ca 10 Jan 2024

It looks like the MQTT session is no longer connecting

UPDATE 25 Jan 2024: Solved for many countries, please use the latest v2.3.0 (or greater). Still working on the issue for GB

jsiegenthaler commented 6 months ago

Working on it...

jsiegenthaler commented 6 months ago

Issue may also impact other countries, I need user feedback to find out

Flatsphere commented 6 months ago

Might be related - but I’m in the UK and also unable to connect and control set top box but logs indicate 401 error:

Failed to create session - Step 3 of 7:
Unable to login: 401 Unauthorized

I have checked credentials, they work. Account has no biometrics attached. Worked Dec last year (2023).

Sholofly commented 6 months ago

Hi @jsiegenthaler, Can you keep me up-to-date about your findings?

jsiegenthaler commented 6 months ago

@Sholofly fixed in v2.2.15-beta.2, MQTT endpoint changed for CH, not sure about other countries yet

jsiegenthaler commented 6 months ago

Fixed in v2.2.15, released 14.01.2024

jsiegenthaler commented 6 months ago

@Sholofly I'll send you an email.

absreda commented 6 months ago

@jsiegenthaler Same issue in GB. v2.2.15 has not fixed this here. Let me know if you need any more details.

jsiegenthaler commented 6 months ago

Hi @absreda and @Flatsphere I am working on a new version v2.3.0 and will release a beta today for testing. I would love to have some GB and IE users provide some test feedback. v2.3.0 contains adaptations that should fix the changed endpoints for all countries, but I need confirmation of the authentication sequence

jsiegenthaler commented 6 months ago

Hi @absreda and @Flatsphere I just published 2.3.0-beta.1 with fixes for the endpoints. Please test. If the authentication fails, please send me a full debug log with eosstb plugin debugging enabled at level 9 (ensure "debugLevel": 9 exists in the eosstb config). Send the logs to me by email. My email is my github username with a b between j and s, at that well known email service starting with g

Flatsphere commented 6 months ago

@jsiegenthaler - no problem. I’ll be able to test in a couple of hours and will let you know. Many thanks.

Flatsphere commented 6 months ago

@jsiegenthaler - sorry for the delay. The latest beta has solved the connection issue, but not if I use Method C (GB), only Method A works.

Unfortunately I then get the following error: [1/15/2024, 9:03:40 PM] [Virgin Media] refreshMasterChannelList: Master channel list refreshed with 421 channels, val id until 1/15/2024, 9:33:40 PM [1/15/2024, 9:03:40 PM] [Virgin Media] Discovering devices... [1/15/2024, 9:03:40 PM] [Virgin Media] Failed to discover devices - No devices found. The backend systems may be down , or you have no supported devices on y our customer account [1/15/2024, 9:03:40 PM] [Virgin Media] sessionWatchdog (1): Exiting sessionWatchdog

jsiegenthaler commented 6 months ago

@Flatsphere that's great news! Can you send me the log showing the connection occurring? I'd like to see it with full debugging turned on, as @absreda cannot connect. Send the logs to me by email. My email is my github username with a b between j and s, at that well known email service starting with g

Flatsphere commented 6 months ago

@jsiegenthaler - will do. I might not be able to email the log tonight, but will send them asap,

Sholofly commented 6 months ago

@jsiegenthaler Where do i find the changed code? Don't see it in your repo...

jsiegenthaler commented 6 months ago

@Sholofly Sorry, I didn't publish the branch. Here it is: https://github.com/jsiegenthaler/homebridge-eosstb/tree/Add-auto-endpoint-detection

Flatsphere commented 6 months ago

@jsiegenthaler - I have emailed you the logs. Let me know if there is anything else I can do to help.

Sholofly commented 6 months ago

Thanks @jsiegenthaler !

jsiegenthaler commented 6 months ago

To all watching and reading this: the change to the GB logon sequence (and maybe also other countries...) is a change to using OAuth 2.0 with PKCE (Pixie) using a code challenge method of S256. This is an authentication method that I am not familiar with. I thus at the bottom of a very steep learning curve and really need the help of volunteers. If you have experience with use of OAuth and OAuth 2.0 - in any programming language - and are able to help, please get in touch via email. Read the comments above for my email address.

jsiegenthaler commented 6 months ago

Hi All. 2.3.0-beta.3 has been published. Please try new Auth Method D with your valid credentials. Turn off the watchdog to prevent the watchdog from trying to restart the session and thus flooding the logs. Send me the logs by email - for logon fail and success please, remember to remove your real password.

wojtul2323 commented 5 months ago

Hi! For PL it also stopped working. The device is discovered correctly, but sending power key doesn’t turn on set-top box.

jsiegenthaler commented 5 months ago

@wojtul2323 hi. I guess that means it did work in PL. I'll put PL in the confirmed list :) Have you tried the latest beta version? If it doesn't work, please send me logs with max debugging enabled

wojtul2323 commented 5 months ago

Beta version works lile a charm :)

jsiegenthaler commented 5 months ago

@wojtul2323 Good to hear. I'll prepare a release version shortly for all users

Thornton69 commented 5 months ago

I am following this thread as I am struggling to get it working. I have tried all of the above. I just keep getting the following…

Failed to create session - Step 4 of 7: Unable to oauth authorize: 404 Not Found

Any advice would be appreciated.

jsiegenthaler commented 5 months ago

Hi @Thornton69 Can you tell me which country you are in?

Thornton69 commented 5 months ago

@jsiegenthaler I am in the uk.

jsiegenthaler commented 5 months ago

@Thornton69 the GB authentication method changed in the last couple of weeks and I am trying to make the plugin work with the new authentication method. I appreciate all help I can get. Do you have any experience with authentication methods?

Thornton69 commented 5 months ago

@jsiegenthaler i don't I'm afraid. I am a complete novice. I was reading your feed thinking you may have fixed the issue and I was the only one with the problem.

I hope you get to the bottom of it. Your service is one of the best on here. It has worked impeccably for me.

jsiegenthaler commented 5 months ago

@Thornton69 I'll do my best. Not sure if my best will be enough. It's difficult. We'll see.

surreyfull commented 5 months ago

Hello

I am getting this same error. I am also a novice unfortunately.

UK - GB: Virgin Media TV 360

[EOSSTB] Step 4 of 7: Failed to create session - Unable to oauth authorize: 404 Not Found

OrenPo commented 5 months ago

Found the issue - (For GB)

  1. Use new servers - messagebroker-prod-gb.gnp.cloud.dmdsdp.com
  2. In the WebSocket connection request, add the following header: Sec-WebSocket-Protocol: mqtt, mqttv3.1, mqttv3.11
jsiegenthaler commented 5 months ago

Thanks. I'll look at it in a few days. But the core issue is not the MQTT session, but rather the authentication method. So I'm now confused. What authentication method did you use?

Sholofly commented 5 months ago

Found the issue - (For GB)

  1. Use new servers - messagebroker-prod-gb.gnp.cloud.dmdsdp.com
  2. In the WebSocket connection request, add the following header: Sec-WebSocket-Protocol: mqtt, mqttv3.1, mqttv3.11

In my home assistant plugin this comment helped me much. Not for GB but for other countries where they couldn't connect. Thank you @OrenPo

jimbo-l commented 5 months ago

Just a quick 'me too'. Ironically I've just started using my Virgin Media box again in the UK and had enabled the plugin again, as a result. Let me know if I can help with debugging.

jsiegenthaler commented 5 months ago

Hi all. I've been unable to work on this due to illness over the last week. I hope to get back into it towards the middle or end of this week, so by Friday 26 January 2023.

SightAndSound-Roger commented 5 months ago

The Sec-WebSocket-Protocol headers that @OrenPo mentioned seemed to fix things for NL too! Same server still.

jsiegenthaler commented 5 months ago

Cool thanks. I will be able to spend some time on this at the end of the week. I'll post results here.

OrenPo commented 5 months ago

I have a prototype for the GB version, with Challenge-Verifier impl, will post this in the next day or too, after some testing

jsiegenthaler commented 5 months ago

Wow that's fantastic, I really appreciate the help. You can also send your changes me email as well if you wish.

jsiegenthaler commented 5 months ago

@SightAndSound-Roger: how did you set the mqtt wss headers? I've looked and seen no obvious way. Can you share a code snippet?

SightAndSound-Roger commented 5 months ago

@jsiegenthaler I've made a C# implementation of our own which I added it in so I can't say for sure how it'd fit in the node code. My best guess would be like this:

const createWebsocket = createWebsocket((url, websocketSubProtocols, options) => {
    const subProtocols = [
        'mqtt',
        'mqttv3.1',
        'mqttv3.11'
    ];
    return new WebSocket(url, subProtocols)
});

mqttClient = mqtt.connect(mqttUrl, {
    createWebsocket,
    connectTimeout: 10 * 1000, // 10s
    clientId: mqttClientId,
    username: mqttUsername,
    password: mqttPassword
});

In C# I'm using MQTTNet and had to add this to my MqttClientOptionsBuilder.


.WithWebSocketServer(_baseMqttUrl, new MqttClientOptionsBuilderWebSocketParameters()
{
    RequestHeaders = new Dictionary<string, string> { ["Sec-WebSocket-Protocol"] = "mqtt, mqttv3.1, mqttv3.11" }
})```
jsiegenthaler commented 5 months ago

@SightAndSound-Roger thanks. Your code snippet is similar to what can be found here: https://github.com/mqttjs/MQTT.js/tree/main#about-reconnection But in your snippet the const subProtocols is never being used :)

I have tried to add it in but my javascript is still very weak and js complains of a syntax error:

const customWebsocket = createWebsocket(url, websocketSubProtocols, options) => {
    const subProtocols = [
        'mqtt',
        'mqttv3.1',
        'mqttv3.11'
    ]
    return new WebSocket(url, subProtocols);
};

The => is highlighted complaining of "';' expected.ts(1005)"

I'm using CommonJS, not es6. I don't understand - anyone with node commonjs experience that can help?

SightAndSound-Roger commented 5 months ago

@jsiegenthaler I have updated my comment, the code was a bit off indeed.

jsiegenthaler commented 5 months ago

@SightAndSound-Roger : thanks! You solved my syntax issue. And I fixed the use of the const for you :)

OrenPo commented 5 months ago

Jan 23, 2024

Hi ... The Challenge-verifier is easy, But I can't find the replacement URL for 'https://id.virginmedia.com/rest/v40/session/start?protocol=oidc&rememberMe=true' (gives me 401)

:(

jsiegenthaler commented 5 months ago

@OrenPo : I get 200 for the same command. Are you on discord? Let's chat there...

mhary269 commented 5 months ago

Since yesterday, I have had the same problem here in Switzerland as before the update.The box again has no connection to HomeKit. commands are no longer transmitted. thank you for your help.

jsiegenthaler commented 5 months ago

@mhary269 Please try v2.3.0-beta.7. This has fixed it for me.

Thornton69 commented 5 months ago

I'm in the UK. I have tried all methods in the current Beta and I have personally not been able to authenticate. The work you guys are doing is to get it sorted is appreciated. This plugin is one of the best.