I'm using paho.mqtt.python. I have a client set up in a Python script with ncurses, and I'm using loop_start() because I'm under the impression that handles sending out ping requests.
Everything is working except for one thing. On occasion there's a message printed to the screen:
[Errno 54] Connection reset by peer
I'm assuming this is some kind of TCP socket error. But the program recovers and carries on working.
Looking at the client.py code, I suspect that what I'm seeing is the output of one of the two print statements in the _packet_read() method. What I'm unsure of is how to deal with this. I could use loop() manually and check for the return value, but I don't think this would prevent that text being printed.
Any suggestions? I guess I could always sub-class and overload this method with a version that doesn't print, but that feels like a last resort!