pigpio
pigpio copied to clipboard
Python pigpio use 100% of CPU if pigpiod daemon stops
Hello everyone! I noticed that when a python client is connected to the daemon (via TCP socket) and the daemon stops then the client go to 100% of CPU.
How to reproduce:
- start the daemon on your raspberry
sudo systemctl start pigpiod
- run the following python program on your PC
# proof.py
import time
import pigpio
pi = pigpio.pi("192.168.1.104") # use your raspberry address
pi.set_mode(17, pigpio.OUTPUT)
pi.write(17, 0)
time.sleep(50000)
python proof.py --debug
- stop the daemon in your raspberry
sudo systemctl stop pigpiod
- look at the python process on your PC should be a 100% of CPU and there it remains
If you do pi.stop()
the CPU come back to normal, but how can I prevent this behavior?