Comments (8)
Ran this with a subscribe in the background, ended up stopped after 20 hours:
Jul 17 14:16:15 leaf/status Connecting to MQTT host emonpi
Jul 17 14:16:15 leaf/status MQTT connected
Jul 17 14:16:31 leaf/status/last_updated 2018/07/17 13:58
Jul 17 14:16:32 leaf/status/battery_percent 96.25
Jul 17 14:16:33 leaf/status/charging_status NOT_CHARGING
...
Jul 18 10:51:24 leaf/status/last_updated 2018/07/18 09:58
Jul 18 10:51:25 leaf/status/battery_percent 92.0833333333
Jul 18 10:51:26 leaf/status/charging_status NOT_CHARGING
Jul 18 10:51:27 leaf/status/raw { _[removed for brevity]_ }
Jul 18 10:51:28 leaf/status/connected Yes
The socket is then dead:
pi@pizero:~ $ sudo netstat -anp |grep 1883
tcp 0 0 192.168.234.41:33926 192.168.234.18:1883 ESTABLISHED 435/node-red
tcp 1 0 192.168.234.41:57881 192.168.234.18:1883 CLOSE_WAIT 12447/python
tcp 0 0 192.168.234.41:37194 192.168.234.18:1883 ESTABLISHED 12438/mosquitto_sub
I need to go learn how to turn on debug logging now.
Edit: I have speculatively added an on_disconnect callback handler to see if is catches it (and it calls client.reconnect() )
from leaf-python-mqtt.
More data: Installing on an i7 based ubuntu server (my media server, at home) and all is well once I changed the BASE_URL in the pywings code. No hangs. Something on the RPi/Debian side I guess.
from leaf-python-mqtt.
MM interesting. I also ran this on a RasPi, seemed to work ok but the nissan API was very unreliable. Is there any difference in python version between RasPi and ubuntu?
from leaf-python-mqtt.
I changed the BASE_URL in the pywings code
What did you change it to?
from leaf-python-mqtt.
The BASE_URL in pycarwings.py from:
BASE_URL = "https://gdcportalgw.its-mo.com/gworchest_160803A/gdc/"
to
BASE_URL = "https://gdcportalgw.its-mo.com/api_v180117_NE/gdc/"
But I suspect it's regional...
Getting you version numbers but the RPi is actually down at the moment. Which is odd.
from leaf-python-mqtt.
Ah yes, it looks like since May 18 we have a new API for the UK jdhorne/pycarwings2#35
Best use this version of pycarwings it has the new BASE_URL merged https://github.com/gym22/pycarwings2
This fixed it for me:
pip uninstall pycarwings2
pip install git+https://github.com/gym22/pycarwings2.git
I'll add a note to the readme for for the UK users to use this version.
from leaf-python-mqtt.
FWIW The version running on the ubuntu server also hung (but still logging) it just took longer. Feels like a resource leak and there is more of whatever on the bigger server. It's not memory.
from leaf-python-mqtt.
One more guess here; It seems to hang every time I try to publish into it, namely to request an "update". It sees it, reacts and publishes the request to Nissan and the response to the broker (which I see on another host) but then the TCP socket to the broker goes CLOSE_WAIT. I wonder if this is what happens on the RPi too, as I think I have a timed injection in Node-Red to query the car... More debug this weekend maybe. Paho MQTT seems fragile is used uncarefully.
from leaf-python-mqtt.
Related Issues (10)
- Python 3.6 HOT 1
- "404 not found" despite using updated pycarwings2 HOT 2
- It doesn't seem to work - DEBUG:pycarwings2.pycarwings2:Response HTTP Status Code: 404
- Recent API error?
- Error when starting script HOT 1
- Region hard-code in leaf-python-mqtt.py HOT 1
- Crash if status 404 returned by API
- Crash when receiving update 60s after starting heating... HOT 2
- Issues receiving values for 2015 leaf HOT 2
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 leaf-python-mqtt.