TeslaSwift icon indicating copy to clipboard operation
TeslaSwift copied to clipboard

Streaming/Socket broken

Open ddaddy opened this issue 3 years ago • 6 comments

After receiving the control:hello response on the socket/stream and we send the data:subscribe_oauth message, the socket disconnects with error 1009

ddaddy avatar Mar 25 '21 15:03 ddaddy

I get this same issue and haven't been able to resolve for over a week. Has anyone else seen or made progress with this error? @jonasman Do you have any ideas about this--did Tesla update their streaming API?

alecdoconnor avatar Apr 20 '21 13:04 alecdoconnor

@jonasman I got the same 1009 error:

tsStream.openStream(vehicle: vehicle) { teslaStreamEvent in
... 
}
Opening Stream to: wss://streaming.vn.teslamotors.com/streaming/
Stream viabilityChanged: true
Stream open headers: ["Strict-Transport-Security": "max-age=15724800; includeSubDomains, max-age=31536000; includeSubDomains", "Upgrade": "websocket", "Date": "Fri, 23 Apr 2021 14:51:51 GMT", "Cache-Control": "no-cache, no-store, private, s-max-age=0", "X-Frame-Options": "DENY", "Sec-WebSocket-Accept": "jaCvi1KK+3ztYhNeDmvcuKZVZ+g=", "Connection": "upgrade", "X-Content-Type-Options": "nosniff"]
Stream data: {"msg_type":"control:hello","connection_timeout":0}
Stream got hello
Stream disconnected 1009:
Stream cancelled

flxschmidt avatar Apr 23 '21 14:04 flxschmidt

This is exactly what I see. @ddaddy Did you find a workaround for this error? I can't seem to get sockets to stay connected. It looks to me like the socket is being created but never upgraded to a full connection. This issue may be related to recent updates the Streaming release in version 7.0.0/7.0.1 ##https://github.com/jonasman/TeslaSwift/releases/tag/7.0.0

alecdoconnor avatar Apr 23 '21 17:04 alecdoconnor

The refactoring did not change the logic.

I will need to debug this. I think streaming never really worked well and dropped before.

Sent from my iPhone

On 23 Apr 2021, at 20:01, alecdoconnor @.***> wrote:



This is exactly what I see. @ddaddyhttps://github.com/ddaddy Did you find a workaround for this error? I can't seem to get sockets to stay connected. It looks to me like the socket is being created but never upgraded to a full connection. This issue may be related to recent updates the Streaming release in version 7.0.0/7.0.1 ##https://github.com/jonasman/TeslaSwift/releases/tag/7.0.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/jonasman/TeslaSwift/issues/78#issuecomment-825791686, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AANOMXT6TH6LJYP6PYKY46DTKGRXPANCNFSM4ZZREXXA.

jonasman avatar Apr 23 '21 17:04 jonasman

Is there another way to subscribe car events like open/close doors, driving location, without polling?

flxschmidt avatar Apr 23 '21 17:04 flxschmidt

my car is able to send one data event but then it closes the stream after that

jonasman avatar Apr 01 '22 21:04 jonasman