Comments (11)
I've change only one Line to check status < 0 :
}
if ($json->status !== 200) {
- if (($json->status == 401 || $json->status == 404 || $json->status == 408) && $this->shouldRetry) {
+ if (($json->status == 401 || $json->status == 404 || $json->status == 408 || $json->status < 0) && $this->shouldRetry) {
$this->debug("Request for '$path' failed. Response received: " . json_encode($json) . " Will retry.");
$this->shouldRetry = FALSE; // Don't loop infinitely!
$this->config->customSessionID = NULL;
now it works.
from nissan-connect-php.
Thanks @Lizzard44 ; I committed this change in both master and new-api branches.
from nissan-connect-php.
I actually have this issue since August 8th. (Canada)...
from nissan-connect-php.
I am also having problems again, the new API worked for a day and now since I guess a week things have stopped working with a similar error as above.
from nissan-connect-php.
Mine started failing some time in late June, but as I've been away all summer, I didn't take a look at it until now.
After pulling the latest changes, I was then getting:
Response received: {"status":408}
I've since then removed the file /tmp/.nissan-connect-storage-.json, to get a new session, and now it works again.
Sorry if this isn't related to any of the issues you're having, but I wanted it documented somewhere in case someone else gets the 408 status.
from nissan-connect-php.
Things started working again for me today out of the blue.
from nissan-connect-php.
And it stopped again.
from nissan-connect-php.
Same for me. I got it to work yesterday, but apparently that was just a one-off.
Now, I get this:
[2019-08-20 11:22:21] [NissanConnect] Request: POST https://gdcportalgw.its-mo.com/api_v190426_NE/gdc/UserLoginRequest.php {"UserId":"WITHHELD","Password":"WITHHELD","custom_sessionid":"","initial_app_str":"9s5rfKVuMrT03RtzajWNcA","RegionCode":"NE","lg":"en-US","DCMID":"","VIN":"","tz":"Europe/Stockholm"}
[2019-08-20 11:22:23] [NissanConnect] Found resultKey in response:
2019-08-20 11:22:23 Exception caught: Request for 'UserLoginRequest.php' failed. Response received: {"status":"-2010","message":"INVALID PARAMS","resultKey":""}
from nissan-connect-php.
Looking at my logs, I see that I had one successful update today at 09:21 Central European time. It then managed to authenticate and get a battery status (I've got it running on a schedule).
So it looks like it's broken most of the time, but occasionally works. If I put back the latest working json file in /tmp, then I get an error from BatteryStatusRecordsRequest.php instead of UserLoginRequest.php.
Since it's intermittent, I'm guessing there's a problem at the Nissan end, but this thing is so flaky it's hard to tell. Sometimes I wonder if they remove and put back old versions of the API.
From what I've heard from those who use the official Nissan app, that's also quite unreliable, and for some cars, Nissan have never been able to make it work at all.
from nissan-connect-php.
Quick update: It seems to fairly consistently work, for a little while, if I first remove the temp file (session storage). So, if the session info is never kept, then maybe it'll work consistently.
From what I've seen, the login request is fast compared to the rest of the process (12 seconds to log in, 40 seconds to get an update), so maybe caching this info is not necessary.
Another solution might be to reset the session only if the status requests fail. I'll have a play with this when/if I've got the time, but for now, I've just set up a cron job to remove the session temp file once an hour :-)
from nissan-connect-php.
@Lizzard44 That change worked immediately!
Thanks!
from nissan-connect-php.
Related Issues (20)
- "status":"-2010","message":"INVALID PARAMS" HOT 2
- Find my car function HOT 9
- get-leaf-location example not working HOT 1
- Base URL Changed Again? HOT 3
- Issue with last Commit HOT 6
- Issue with new API -- No battery info? HOT 4
- Receiving INVALID PARAMS response HOT 1
- does not work since mid-December 2018 .... HOT 8
- Leaf Gen2 HOT 8
- Nissan changed api again HOT 8
- New Leaf 2019 Protocol HOT 15
- New Response since Nov 21st? HOT 2
- Response Authentication error HOT 7
- New fix does not work when changing request source. HOT 2
- API error, NoRecordInDatabase HOT 3
- BlahBlah?? HOT 10
- The return of the BlahBlah code :( HOT 4
- Here we go again! :) HOT 4
- Still getting Unauthorized response after last update HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nissan-connect-php.