Code Monkey home page Code Monkey logo

onstarjs's People

Contributors

bigthundersr avatar dependabot[bot] avatar fieryflames avatar joelvandal avatar michaelwoods avatar nilathedragon avatar samrum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onstarjs's Issues

401 Unauthorized response on initial attempt

Hi, I've just begun experimenting with the module; version 2.3.21 installed from npm.

I'm consistently seeing 401 Unauthorized responses when trying to perform API calls. My initial request was:

import OnStar from "onstarjs";
import {v4} from 'uuid';

const onstar = OnStar.create({
    deviceId: v4(),
    onStarPin: PIN,
    username: ID,
    password: PW,
    vin: VIN
});

async function main() {
    try {
        const diag = await onstar.getAccountVehicles();
        console.log(diag.status)
    } catch (e) {
        console.log(e);
        console.error('failed');
    }
}
main();

The error I'm getting back: RequestError: Request Failed with status 401 - Unauthorized

The request URL is a POST against 'https://api.gm.com/api/v1/oauth/token', but I haven't tried decoding the payload.

My initial thought was that 2FA might be affecting things; my GM account is protected with a TOTP authenticator. But I tried disabling 2FA, and am still seeing the same issue.

Any idea on how to best troubleshoot? I'm using my gm.com credentials; as I never setup anything explicitly for OnStar. Would I need to have set something specifically up for that?

Alert Function Does Not Work

Sorry if this is a duplicate as I wasn't sure where this issue needs to be opened.

From: michaelwoods/onstar2mqtt#218

Thanks again for the great work on this!

Everything works for me except for the Alert function. It fails on both my cars. I get the following error whenever I try to run the alert command.

Command Sent:

2022-10-18 20:50:07 info: Command sent {"command":"alert"}

Error from command:

2022-10-18 20:50:07 error: Command error {"command":"alert","err":{"message":"Request Failed with status 400 - Bad Request","request":{"_closed":true,"_contentLength": 74,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"POST..........................|snip| }

I changed the following code in commands.js from:

async alert({action = [Commands.CONSTANTS.ALERT_ACTION.FLASH],
             delay = 0, duration = 1, override = []}) {
    return this.onstar.alert({
        action,
        delay,
        duration,
       override
    });
}

To:

async alert({action = [Commands.CONSTANTS.ALERT_ACTION.FLASH]}) {
    return this.onstar.alert({action});  
}

Which worked to trigger only the flashing lights.

400 Error

Getting 400 Error today when trying to get vehicle information.

Body json format for post requests

Hi thank you for this awesome project.

Im able to execute commands that doesn't require any options parameters. and im getting response data as expected.
However when try commands with parameter its not returning data

Works:
data= await onStar.getChargingProfile();

doesn't work

data=  await onStar.diagnostics({
            "diagnosticItem": ["ODOMETER","TIRE PRESSURE"]
          });

or 

data=  await onStar.diagnostics({
            diagnosticItem: ["ODOMETER","TIRE PRESSURE"]
          });

response status is success but data is undefined.

Any idea what im doing wrong?
Thanks

Getting RequestError: Command Timeout when requesting diagnostics

Getting RequestError: Command Timeout when requesting diagnostics. Im not sure whats causing the issue as the login credentials are working for app.

dev]# node vehicle.js
RequestError: Command Timeout
at RequestService. (/root/dev/node_modules/onstarjs/dist/index.js:552:35)
at Generator.next ()
at fulfilled (/root/dev/node_modules/onstarjs/dist/index.js:32:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
response: {
status: 200,
statusText: 'OK',
headers: {
server: 'Apache-Coyote/1.1',
'gccx-transactionid': '000001799a4c25fa-39753d',
'cache-control': 'public, max-age=5',
'content-type': 'application/json;charset=UTF-8',
'content-length': '183',
date: 'Tue, 25 May 2021 19:41:01 GMT'
},

vehicle.js is simple script based on example. Passing sensitive info at top, but have following as main part of script:

const onStar = OnStar.create(config);

onStar
.diagnostics({
diagnosticItem: ["ODOMETER", "TIRE PRESSURE"],
})
.catch(e => console.log(e));

Keep awake

Is there a call we can make to keep the onstar unit awake without creating extraneous external events? On my vehicle the onstar unit goes offline after 24 hours without some kind of input. The diagnostics calls do not keep it awake.

Unit Imperial or Metric

Great work! I want to integrate this package. One question I have is that the default unit is Metric. Is there anyway I can set it to Imperial? Thanks.

"Bad Request" Error

Hi, Expert!

I used this library for a while and it works great. Since Feb 21st, suddenly, all calls return this error:
{"error": "Bad Request" , "vin": "XXXXXX"}

Do you know how to fix it?

Thanks.

OnStar Europe

Hello I have an Opel Insignia B 2018, And now here in Europe we have lost access to Onstar, does this platform still work with Onstar inactive? I have my server I can share with you for testing or for the application to work. can anyone help? I can provide my car data to test if it works. Thanks. Please

Not Getting Output

Hello, pretty new to scripting and looking to get this integrated into HA. I’m having an issue running scripts as it says it’s unable to find onstarjs. Where should I be putting the scripts?

Possible issue with tire pressure units/conversion

I'm using onstar2mqtt, not OnStarJS directly, but I think the issue is coming from OnStar. Did they change the units for tire pressure recently? I'm seeing ~260 PSI, and if that were actually ~260 kPA it would be a more reasonable ~38 PSI. I'm not sure where all of the conversions are happening, but is anyone else seeing issues with tire pressure?

Running onstar2mqtt 1.5.5, which I believe is using OnStarJS 2.3.18.

How to derive onStarAppConfig?

Hi there,

First off, amazing project. Thank you for your continuing commitment and it's so neat having this configured with my Home Assistant.

However, I am confused:

"appId": "OMB_CVY_AND_5U0",
"appSecret": "NZbzagcuvTceQScyRTb6tiE78qzfBJVnHV7u",

How was this derived? It looks like it is an Android key, so I'm guessing load the APK in an enumerator and use tcpdump - is the key just in plaintext? Or.... how would one update this key, if the project ceased operations?

Error 500

Hello,

I'm trying to use onstar2mqtt and I'm getting error 500. The owner of the solution told me to post here. I'm from Quebec, Canada and I'm unsure if we're suppose to have a different API or not.

This is what the log file in the docker give me:
https://pastebin.com/pp1S889V

I've checked my pihole server when I open the MyChrevolet App for my bolt and saw it communicate on these domain (if that help anything):
generalmotorscorporation.sc.omtrdc.net
galileo-api.ext.gm.com
na-mobile-api.gm.com
apim.gm.com
www.chevrolet.com
omnibus.gm.com

This is the link to the issue I opened @ onstar2mqtt that sent me here:
michaelwoods/onstar2mqtt#206

Thank you!

Getting 401 Unauthorized

Hello,

starting yesterday or Wednesday, started getting 401 errors. The latest branch does not fix this.

[Request] Examples.js

I love this library and use it daily for smarthome integration. The one thing, no matter how many ways I've tried, dug through the code, or searched - I cannot find a working onStar.start(); example. Everything else has worked flawlessly. Would it be possible to include a simple Eamples.js? I'd love to publish what I have working in an example sheet, all I'm missing is a functional vehicle start.

Regards.

Methods for polling vehicle status, not diagnostics

I'm not sure if this is even possible (And if not, I'm not complaining since OnStar doesn't even provide public APIs to begin with), but is there any way to poll vehicle status? I know it's easy to send commands to the vehicle, but I wonder if it's possible to check the status of the vehicle. For example, can you check if it's locked or unlocked? Can you check how many minutes are remaining on the remote start timer? Feel free to answer if/when you get the chance, thanks so much for the work you've done with this!

getAccountVehicles - Error: Request Failed with status 500 - Internal Server Error

Trying to follow the example. Double checked the credentials and everything is correct. But receiving the error.

Code:

const OnStar = require("onstarjs")

const onStar = OnStar.create({
  deviceId: "...",
  vin: "...",
  username: "[email protected]",
  password: "password",
  onStarPin: "####",
})

async function main() {
  try {
    const vehicles = await onStar.getAccountVehicles()
    console.log(vehicles)

  } catch (err) {
    throw new Error(err)
  }
}

Other commands seem to work fine, such as:

  • await onStar.alert
  • await onStar.start
  • await onStar.cancelStart

Explain 403 Forbidden error

Hi,

Does it possible to get more detail on possible cause of 403 - Forbidden error ? Using OnStarJS 2.3.11.

All commands (diag, status, etc) work except Start, I always get the following error :

UnhandledPromiseRejectionWarning: Error: Request Failed with status 403 - Forbidden

Any idea on how to trobleshoot this issue ?

New API keys?

Hi!

I was poking on my side (on android) and end up finding your git (yeah!).
The clientId seems to have been updated, I now have OMB_CVY_AND_3Q0. (just replace AND with iOS)
Though I don't know if they increased the clientSecret length or if it is different per platform. (Length is 36 on my side),

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.