mseminatore / TeslaJS

An Unofficial Tesla API library for NodeJS

Home Page:https://www.teslajs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Something wrong with streaming auth

IMgoRt opened this issue · comments

Having been using startStreating for 6 months without issue, 2 days ago it started returning the error "Error: Basic Auth Disabled"
I was using my username: email and password: options.tokens[0]
I get the same error using simply authToken: CurrentToken (which works in vehicles

Library version
4.7.0,
updated to 4.9.3

Additional context
called within NodeRed

Have you enabled MFA on your account?

Have you enabled MFA on your account?

No sir,
This just randomly started happening when I was out driving, so no code changes, no 2FA enabled.

I have just enabled 2FA and then disabled 2FA, at all times vechiles/vehicle continues with valid responses, but startstreaming continues to return "Error: Basic Auth Disabled", which is passed directly by your code from the Tesla servers.
I've re-authorise with new tokens and still exactly the same

Hmm. The TJS streaming code has not changed recently so something may have changed on the Tesla side. Have you taken a recent FW update? Is your car an M3? I vaguely remember hearing that streaming stopped working on some car models with some FW versions. Since I do not have those combinations I cannot reproduce.

Hmm. The TJS streaming code has not changed recently so something may have changed on the Tesla side. Have you taken a recent FW update? Is your car an M3? I vaguely remember hearing that streaming stopped working on some car models with some FW versions. Since I do not have those combinations I cannot reproduce.

Hi Mark,
I regularly get software updates but not while driving.
I've got an MS from 2016, had the HW3- and MCU2 upgrade at the start of October, I refresh my authtoken on the first of the month (and other times if for some reason a problem gets returned)

Hopefully others will start noticing this issue and then we can get to the bottom of it.
I've tried moving my server from behind my VPN in case that was the issue, but there was no difference so I'm back behind the VPN again.

Thanks
David

I'm seeing this as well. I originally saw this issue with the Ruby API, and saw the same behavior with TeslaJS.

I am also getting this on my android app I wrote, I thought it was something I was doing wrong in WebSockets() but guess it is everybody.
Any luck @IMgoRt finding a wrok around?

Hmm. The TJS streaming code has not changed recently so something may have changed on the Tesla side. Have you taken a recent FW update? Is your car an M3? I vaguely remember hearing that streaming stopped working on some car models with some FW versions. Since I do not have those combinations I cannot reproduce.

This is reputed to be the issue
timdorr/tesla-api#97 (comment)
so line 1841 of teslajs, but also the correct token needs passing

@IMgoRt, I do have an M3. I have just started doing this in the last 3 days so not sure if it ever worked before. I have tried the "data:subscribe_oauth" and it does the same thing for me.

@IMgoRt, I do have an M3. I have just started doing this in the last 3 days so not sure if it ever worked before. I have tried the "data:subscribe_oauth" and it does the same thing for me.

Have you been driving at the time as the timeout seems to be 10s if no draw on the battery

Not driving, at my desk working on the code. I will try the "data:subscribe_oauth" way again, maybe I am missing something on what is passed, what are people referring to when they say use your oauth string instead of oauth token, not sure I have seena way to make an oauth string?

I used the normal "https://owner-api.teslamotors.com/oauth/token" to get token and refresh token, but not aware of any path called "https://owner-api.teslamotors.com/login" that you are referring to. I will keep poking around to see if I can find that login path. Please post up if you find what you are talking about when home, thanks.

@ktoonsez @IMgoRt @cyu I believe I have just pushed the fix for this issue. The streaming API now takes the OAuth token. The sample now works again. LMK if you see some issues. If anyone wants to update the simpleStreaming sample to display more friendly output that would probably be a good PR.

Awesome!

@ktoonsez @IMgoRt @cyu I believe I have just pushed the fix for this issue. The streaming API now takes the OAuth token. The sample now works again. LMK if you see some issues. If anyone wants to update the simpleStreaming sample to display more friendly output that would probably be a good PR.

Thank you Mark for your prompt attention, working fine in the UK