-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT publishing hangs after a while #10
Comments
Ran this with a subscribe in the background, ended up stopped after 20 hours:
The socket is then dead:
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() ) |
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. |
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? |
What did you change it to? |
The BASE_URL in pycarwings.py from:
to
But I suspect it's regional... Getting you version numbers but the RPi is actually down at the moment. Which is odd. |
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:
I'll add a note to the readme for for the UK users to use this version. |
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. |
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. |
Not sure what is happening here, but running on an RPi with Jessie running the base leaf-python-mqtt works fine but after some hours (never measure fully) MQTT publication stops to a remote broker - an emonpi in this case.
The symptoms are that the process continues to log data acquisition from Nissan and publish to MQTT but the broker receives nothing. This is evidenced by local mosquitto_pub/sub working to the same remote broker from the command line and netstat showing a CLOSE_WAIT connection to the broker with one byte in the receive queue.
Not being a python expert but trying to read the paho docs I think there should be some more error checking somewhere and maybe an on_disconnect callback defined. But I am guessing.
The text was updated successfully, but these errors were encountered: