krauskopf / node-red-contrib-car-bmw

Node-RED nodes for BMW ConnectedDrive
Other
11 stars 8 forks source link

Error: Server http statusCode 403 #15

Closed Blodstrupmo1 closed 1 year ago

Blodstrupmo1 commented 2 years ago

I started receiving "Error: Server http statusCode 403" when i try to update node "BMW list" version 0.4.1.

OABsoftware commented 2 years ago

Same here. The https://cocoapi.bmwgroup.com/eadrax-vcs/v1/vehicles returns a 403 error.

Miki433 commented 2 years ago

Same Problem since 2 days... 28.5.2022, 12:05:03node: BMW X1 Hybridmsg : error "Error: Server http statusCode 403"

OABsoftware commented 2 years ago

Please update row 290 of bmw.js to: 'x-user-agent': 'android(SP1A.210812.016.C1);bmw;2.5.2(14945);row',

Miki433 commented 2 years ago

Please update row 290 of bmw.js to: 'x-user-agent': 'android(SP1A.210812.016.C1);bmw;2.5.2(14945);row',

worked great, thanks!

Blodstrupmo1 commented 2 years ago

Please update row 290 of bmw.js to:

      'x-user-agent': 'android(SP1A.210812.016.C1);bmw;2.5.2(14945);row',

Worked here also. Thanks 😃

krauskopf commented 2 years ago

Made a release (v4.0.3), based on the contributions from @OABsoftware and @dzett. Thanks! Please give it a try.

Donni1966 commented 2 years ago

hmm works not for me: "Error: Server http statusCode 503"

OABsoftware commented 2 years ago

I found out that the "row" part at the end of the user agent string is the abbreviation of "rest of world". If your region is North America, "row" should be replaced by "na". It it is China, it should be "cn". So the last part of the user agent string needs to be made region dependant.

Donni1966 commented 2 years ago

hi ... are here solutions on the way. or not and i can deinstall the nodes? While i get only loading statistic and specifications. The List not brings me up a empty array. no details of the mini se

oemich commented 2 years ago

Hi @Donni1966, at least for BMW it is working with the list node. I selected in the List node as Output "as multiple messages, one per car" and receive two messages for my cars. In the message.payload I find most of the needed information in the "properties" Object (e.g. door status, fuel level and combined rangem) and "status" object (e.g. currentMileage).

I cross checked with bimmer_connected and it seems that the user agent 'x-user-agent': 'android(SP1A.210812.016.C1);bmw;2.5.2(14945)', also contains the info of which brand app is requesting data (bmw or mini) maybe there is a check on the API for it?

Donni1966 commented 2 years ago

that's the problem - I get with list and empty array.

no info inside

I cross checked with bimmer_connected and it seems that the user agent 'x-user-agent': 'android(SP1A.210812.016.C1);bmw;2.5.2(14945)', also contains the info of which brand app is requesting data (bmw or mini) maybe there is a check on the API for it?

sorry do not understand this

oemich commented 2 years ago

Hi @Donni1966 ,

can you check if my modification helps? You would need to install the module out of my forked and modified repository: https://github.com/oemich/node-red-contrib-car-bmw if you report that it works, I could incorporate it also here.

I cannot verify it by my own as I have no mini to test.

Donni1966 commented 2 years ago

@oemich i installed via palette the version 0.4.4 and i try a List request -> result: Empty array :-/ or is there a way to install your fork? Do not know exactly how to do this

oemich commented 2 years ago

@Donni1966 you would need to install it differently:

  1. Uninstall todays node
  2. Got to your nodered installation folder in the terminal and perfom npm install https://github.com/oemich/node-red-contrib-car-bmw (https://nodered.org/docs/user-guide/runtime/adding-nodes#installing-with-npm)
  3. Restart nodered to see the newly installed node

Now you can try it ... the node is named the same way as from the original repository here.

Donni1966 commented 2 years ago

puh that's mean I have to delete alle nodes with this config, deinstall and reinstall and configure again. For this I need more time as I have in the moment. it is possible to stop node-red install in the folder and start again?

oemich commented 2 years ago

I just tried it, and yes this would also work.

Don't forget to install the original package after the test ... same steps as above just replace the npm install step with npm install node-red-contrib-car-bmw

If you confirm that it works with the change, I will create a Pull Request with a configurable option for the manufacturer.

Donni1966 commented 2 years ago

thanx @oemich for the instruction - but no changes. Still and empty array :-/ so, looks like only bmw cars are listed. so i finally switch to Home Assistant and read the data from there to put in on the dashboard. The switches like Horn, Climatic on off ans lock system works fine. the charging statistic also. for me at the moment works fine. Thanx for helping and trying