michaelwoods/onstar2mqtt

400 error

Closed this issue · 13 comments

skyw33 commented

I've tried the "gibby" fork and same thing happens there. I also tried changing the device ID, but that didn't do anything. I've confirmed that the app works and the pin/password is correct.

<tr><td>2023-01-29T16:33:56.083060540Z</td><td>stderr</td><td>error: Main function error. {"error":{"message":"Request Failed with status 400 - Bad Request","request":{"_contentLength":null,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"POST /api/v1/oauth/token HTTP/1.1\r\nAccept: application/json\r\nContent-Type: text/plain\r\nAccept-Language: en\r\nHost: api.gm.com\r\nConnection: keep-alive\r\nAccept-Encoding: br, gzip, deflate\r\nUser-Agent: Mozilla/5.0 (Linux; U; Android 9; en-US; Google Pixel 2 Build/PI)\r\nContent-Length: 455\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"https://api.gm.com/api/v1/oauth/token","_ended":true,"_ending":true,"_events":{},"_eventsCount":2,"_options":{"agents":{},"headers":{"Accept":"application/json","Accept-Encoding":"br, gzip, deflate","Accept-Language":"en","Connection":"keep-alive","Content-Length":455,"Content-Type":"text/plain","Host":"api.gm.com","User-Agent":"Mozilla/5.0 (Linux; U; Android 9; en-US; Google Pixel 2 Build/PI)"},"hostname":"api.gm.com","maxBodyLength":10485760,"maxRedirects":21,"method":"POST","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PRI","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"fifo","sockets":{},"totalSocketCount":0},"maxHeaderSize":8192},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":["api.gm.com:443::::::::::::::::::"],"map":{"api.gm.com:443::::::::::::::::::":{"data":

Are you running a recent version? This looks old.

I'm getting a very similar error message, just set it up tonight & pulled the latest docker image.

is the api down? noticed mobile app not updating as well

stuck on "requesting diagnostics" loop since this night. Would be nice to have an available topic or something that publish when it's not working

Confirmed on my side as well... getting timeout when requesting diagnostics.

My instance is currently functioning fine.

It seems to be back

still not working for me, i've tried 1.5.0, 1.5.1, 1.5.2 and latest/main/1.5.3 with same error message on each. is there some ENV needed or something to adjust on the chevy side for the initial connection?

Have you checked that the official app works for you? There was a EULA agreement recently that seemed to block.

Just used the app (on android) earlier tonight to remote start the car, granted, I don't think I've ever seen the app prompt me for a PIN, so I'm not sure which functions need that. (just got the car on saturday, so not sure if there's something weird on onstar's backend that only gets batch processed every once in a while for new purchases)
edit: it may prompted once, but it prompts for biometrics each time now, so i think that replaces the PIN?

ok, i bodged something together in VSCode to use the OnStarJS library to send commands to my car, and those worked, so now to figure out what is different with onstar2mqtt.
edit: and the inputs/variable assignments i copied/pasted directly from the ENV variables i am using for the container, so it shouldn't be typos for deviceID/vin/etc

Closing as a configuration/API issue. The API is flaky but is currently working.

my underlying issue seemed to be wrong system time, once that was fixed up, it started working.