glynhudson / leaf-python-mqtt

Extract data from Nissan Leaf API and post to mqtt
Apache License 2.0
24 stars 7 forks source link

"404 not found" despite using updated pycarwings2 #12

Closed tarcus69 closed 5 years ago

tarcus69 commented 5 years ago

I suspect there may have been another API change recently, there was an update on some third party apps yesterday stating they were updated for the "new Nissan API".

I followed the install instructions and installed fresh today.

Error message here:

INFO:root:Startup leaf-python-MQTT: 2018-12-21 19:52:48
INFO:root:Loaded config file /home/ianr/leaf/leaf-python-mqtt/config.ini
INFO:root:updating data from API every 15min
INFO:root:Prepare Session
INFO:root:Login...
INFO:root:Connected to MQTT host openhab with result code 0
INFO:root:Start update time: 2018-12-21 19:52:48
INFO:root:Suscribing to leaf control topic: leaf/control
DEBUG:pycarwings2.pycarwings2:invoking carwings API: https://gdcportalgw.its-mo.com/api_v180117_NE/gdc/InitialApp.php
INFO:root:Publishing to leaf status topic: leaf/status
DEBUG:pycarwings2.pycarwings2:params: {
   "RegionCode": "NE",
   "custom_sessionid": "",
   "initial_app_strings": "geORNtsZe5I4lRGjG9GZiA",
   "lg": "en-US"
}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): gdcportalgw.its-mo.com:443
DEBUG:urllib3.connectionpool:https://gdcportalgw.its-mo.com:443 "POST /api_v180117_NE/gdc/InitialApp.php HTTP/1.1" 404 231
DEBUG:pycarwings2.pycarwings2:Response HTTP Status Code: 404
DEBUG:pycarwings2.pycarwings2:Response HTTP Response Body: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api_v180117_NE/gdc/InitialApp.php was not found on this server.</p>
</body></html>

ERROR:root:CarWings API error
tarcus69 commented 5 years ago

Yep looks like an API change, here's a tweet from Nissan (who I'm surprised can work a computer well enough to tweet something): https://twitter.com/NissanEV_UK/status/1076200864044515328?s=15

glynhudson commented 5 years ago

Yes API has changed at least for UK users. See here for the new Nissan API URL: https://github.com/jdhorne/pycarwings2/issues/35

Hopefully this fix will be merged into pycarwings lib soon. As this is an issue with pycarwings rather than leaf-python-mqtt I will close this issue, please follow the issue on pycarwings.