pigpio icon indicating copy to clipboard operation
pigpio copied to clipboard

Python pigpio use 100% of CPU if pigpiod daemon stops

Open cescobaz opened this issue 2 years ago • 0 comments

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:

  1. start the daemon on your raspberry
sudo systemctl start pigpiod
  1. 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
  1. stop the daemon in your raspberry
sudo systemctl stop pigpiod
  1. look at the python process on your PC should be a 100% of CPU and there it remains 20230219_13h28m17s_grim

If you do pi.stop() the CPU come back to normal, but how can I prevent this behavior?

cescobaz avatar Feb 19 '23 12:02 cescobaz