TeslaSwift
TeslaSwift copied to clipboard
Streaming/Socket broken
After receiving the control:hello
response on the socket/stream and we send the data:subscribe_oauth
message, the socket disconnects with error 1009
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?
@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
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
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.
Is there another way to subscribe car events like open/close doors, driving location, without polling?
my car is able to send one data event but then it closes the stream after that