Problem pigpiod on RPi OS 11 (bullseye) 32bit Desktop with 2-Channel Relays Module **SOLVED**
pierol opened this issue · comments
I'm using pigpio for interfacing with Wiegand reader and a 2-Channel Relays Module. I started this project on Raspberry PI 3 B+ installing RPi OS 10 (buster) 32bit Desktop and pigpio
version 79 and it operated as expected. Yesterday i configured a new Raspberry PI 3 B+ with the last recommended version RPi OS 11 (bullseye) 32bit Desktop, using the official Raspberry Pi Imager. I then installed pigpio version 79 and started at boot time as service pigpiod
(sudo systemctl enable pigpiod
)and the relays switch on and off continusly and i must plug off the power to stop
I have no idea of the problem but maybe more information may help.
What is the hardware revision? 64 or 32 bit OS? Lite or desktop?
Can you run the pigpio tests successfully?
FYI, to stop the service run
sudo systemctl disable pigpiod
followed by a power cycle if needed.
Thank you @guymcswain for your support. Here the information:
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2835
Revision : a020d3
Serial : 000000000e07251a
Model : Raspberry Pi 3 Model B Plus Rev 1.3
The OS is Raspbian 11 (bullseye) 32bit Desktop.
I've never run the pigpio test how can i do that ? Look below, i've done tests suggested by the library site.
At the moment i've reinstalled the RPi OS 10 (buster) 32bit Desktop and all is operated as expected.
I've made some test as reported in the pigpio site.
OS release 32bit:
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Hardware Revision:
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2835
Revision : a020d3
Serial : 00000000a249a97c
Model : Raspberry Pi 3 Model B Plus Rev 1.3
This is sudo ./x_pigpio # check C I/F
Testing pigpio C I/F
pigpio version 79.
Hardware revision 10494163.
Mode/PUD/read/write tests.
TEST 1.1 PASS (set mode, get mode: 0)
TEST 1.2 PASS (set pull up down, read: 1)
TEST 1.3 PASS (set pull up down, read: 0)
TEST 1.4 PASS (write, get mode: 1)
TEST 1.5 PASS (read: 0)
TEST 1.6 PASS (write, read: 1)
PWM dutycycle/range/frequency tests.
TEST 2.1 PASS (set PWM range, set/get PWM frequency: 10)
TEST 2.2 PASS (get PWM dutycycle: 0)
TEST 2.3 PASS (set PWM dutycycle, callback: 0)
TEST 2.4 PASS (get PWM dutycycle: 128)
TEST 2.5 PASS (set PWM dutycycle, callback: 40)
TEST 2.6 PASS (set/get PWM frequency: 100)
TEST 2.7 PASS (callback: 400)
TEST 2.8 PASS (set/get PWM frequency: 1000)
TEST 2.9 PASS (callback: 4000)
TEST 2.10 PASS (get PWM range: 255)
TEST 2.11 PASS (get PWM real range: 200)
TEST 2.12 PASS (set/get PWM range: 2000)
TEST 2.13 PASS (get PWM real range: 200)
PWM/Servo pulse accuracy tests.
TEST 3.1 PASS (get servo pulsewidth: 500)
TEST 3.2 PASS (set servo pulsewidth: 40000)
TEST 3.3 PASS (get servo pulsewidth: 1500)
TEST 3.4 PASS (set servo pulsewidth: 13333)
TEST 3.5 PASS (get servo pulsewidth: 2500)
TEST 3.6 PASS (set servo pulsewidth: 8000)
TEST 3.7 PASS (set/get PWM frequency: 1000)
TEST 3.8 PASS (set PWM range: 200)
TEST 3.9 PASS (get PWM dutycycle: 20)
TEST 3.10 PASS (set PWM dutycycle: 200)
TEST 3.11 PASS (get PWM dutycycle: 40)
TEST 3.12 PASS (set PWM dutycycle: 400)
TEST 3.13 PASS (get PWM dutycycle: 60)
TEST 3.14 PASS (set PWM dutycycle: 600)
TEST 3.15 PASS (get PWM dutycycle: 80)
TEST 3.16 PASS (set PWM dutycycle: 800)
Pipe notification tests.
TEST 4.1 PASS (notify open/begin: 0)
TEST 4.2 PASS (notify pause: 0)
TEST 4.3 PASS (notify close: 0)
TEST 4.4 PASS (sequence numbers ok: 1)
TEST 4.5 PASS (gpio toggled ok: 1)
TEST 4.6 PASS (number of notifications: 80)
Waveforms & serial read/write tests.
TEST 5.1 PASS (callback, set mode, wave clear: 0)
TEST 5.2 PASS (pulse, wave add generic: 4)
TEST 5.3 PASS (wave tx repeat: 9)
TEST 5.4 FAILED got 25 (callback: 50)
TEST 5.5 PASS (wave tx stop: 0)
TEST 5.6 PASS (serial read open: 0)
TEST 5.7 PASS (wave clear, wave add serial: 3405)
TEST 5.8 PASS (wave tx start: 6811)
TEST 5.9 PASS (NOT APPLICABLE: 0)
TEST 5.10 PASS (NOT APPLICABLE: 0)
TEST 5.11 FAILED got 10 (wave tx busy, serial read: 0)
TEST 5.12 PASS (serial read close: 0)
TEST 5.13 PASS (wave get micros: 6158148)
TEST 5.14 PASS (wave get high micros: 6158148)
TEST 5.15 PASS (wave get max micros: 1800000000)
TEST 5.16 PASS (wave get pulses: 3405)
TEST 5.17 PASS (wave get high pulses: 3405)
TEST 5.18 PASS (wave get max pulses: 12000)
TEST 5.19 PASS (wave get cbs: 6810)
TEST 5.20 PASS (wave get high cbs: 6810)
TEST 5.21 PASS (wave get max cbs: 25016)
TEST 5.22 PASS (wave create pad, count==1, wid==: 0)
TEST 5.23 PASS (wave create pad, count==2, wid==: 1)
TEST 5.24 PASS (delete wid==0 success: 0)
TEST 5.25 PASS (No more CBs using wave create: -67)
TEST 5.26 PASS (wave create pad, count==3, wid==: 0)
TEST 5.27 PASS (wave chain [1,0]: 0)
TEST 5.28 PASS (callback count==: 5)
Trigger tests
TEST 6.1 PASS (gpio trigger count: 5)
TEST 6.2 PASS (gpio trigger pulse length: 150)
Watchdog tests.
TEST 7.1 PASS (set watchdog on count: 39)
TEST 7.2 PASS (set watchdog off count: 0)
Bank read/write tests.
TEST 8.1 PASS (read bank 1: 0)
TEST 8.2 PASS (read bank 1: 33554432)
TEST 8.3 PASS (clear bank 1: 0)
TEST 8.4 PASS (set bank 1: 1)
TEST 8.5 PASS (read bank 2: 0)
TEST 8.6 PASS (clear bank 2: 0)
TEST 8.7 PASS (NOT APPLICABLE: 0)
TEST 8.8 PASS (set bank 2: 0)
TEST 8.9 PASS (NOT APPLICABLE: 0)
Script store/run/status/stop/delete tests.
TEST 9.1 PASS (store/run script: 100)
TEST 9.2 PASS (run script/script status: 201)
TEST 9.3 PASS (run/stop script/script status: 110)
TEST 9.4 PASS (delete script: 0)
this is ./x_pigpiod_if2 # check C I/F to daemon
:
Connected to pigpio daemon (0).
Testing pigpiod C I/F 2
pigpio version 79.
Hardware revision 10494163.
Mode/PUD/read/write tests.
TEST 1.1 PASS (set mode, get mode: 0)
TEST 1.2 PASS (set pull up down, read: 1)
TEST 1.3 PASS (set pull up down, read: 0)
TEST 1.4 PASS (write, get mode: 1)
TEST 1.5 PASS (read: 0)
TEST 1.6 PASS (write, read: 1)
TEST 1.7 PASS (pigpio_start with non-default arguments: 31)
PWM dutycycle/range/frequency tests.
TEST 2.1 PASS (set PWM range, set/get PWM frequency: 10)
TEST 2.2 PASS (get PWM dutycycle: 0)
TEST 2.3 PASS (set PWM dutycycle, callback: 0)
TEST 2.4 PASS (get PWM dutycycle: 128)
TEST 2.5 PASS (set PWM dutycycle, callback: 40)
TEST 2.6 PASS (set/get PWM frequency: 100)
TEST 2.7 PASS (callback: 400)
TEST 2.8 PASS (set/get PWM frequency: 1000)
TEST 2.9 PASS (callback: 4000)
TEST 2.10 PASS (get PWM range: 255)
TEST 2.11 PASS (get PWM real range: 200)
TEST 2.12 PASS (set/get PWM range: 2000)
TEST 2.13 PASS (get PWM real range: 200)
PWM/Servo pulse accuracy tests.
TEST 3.1 PASS (get servo pulsewidth: 500)
TEST 3.2 PASS (set servo pulsewidth: 40000)
TEST 3.3 PASS (get servo pulsewidth: 1500)
TEST 3.4 PASS (set servo pulsewidth: 13333)
TEST 3.5 PASS (get servo pulsewidth: 2500)
TEST 3.6 PASS (set servo pulsewidth: 8000)
TEST 3.7 PASS (set/get PWM frequency: 1000)
TEST 3.8 PASS (set PWM range: 200)
TEST 3.9 PASS (get PWM dutycycle: 20)
TEST 3.10 PASS (set PWM dutycycle: 200)
TEST 3.11 PASS (get PWM dutycycle: 40)
TEST 3.12 PASS (set PWM dutycycle: 400)
TEST 3.13 PASS (get PWM dutycycle: 60)
TEST 3.14 PASS (set PWM dutycycle: 600)
TEST 3.15 PASS (get PWM dutycycle: 80)
TEST 3.16 PASS (set PWM dutycycle: 800)
Pipe notification tests.
TEST 4.1 PASS (notify open/begin: 0)
TEST 4.2 PASS (notify pause: 0)
TEST 4.3 PASS (notify close: 0)
TEST 4.4 PASS (sequence numbers ok: 1)
TEST 4.5 PASS (gpio toggled ok: 1)
TEST 4.6 PASS (number of notifications: 80)
Waveforms & serial read/write tests.
TEST 5.1 PASS (callback, set mode, wave clear: 0)
TEST 5.2 PASS (pulse, wave add generic: 4)
TEST 5.3 PASS (wave tx repeat: 9)
TEST 5.4 FAILED got 26 (callback: 50)
TEST 5.5 PASS (wave tx stop: 0)
TEST 5.6 PASS (serial read open: 0)
TEST 5.7 PASS (wave clear, wave add serial: 3405)
TEST 5.8 PASS (wave tx start: 6811)
TEST 5.9 PASS (callback: 0)
TEST 5.10 FAILED got 1740 (wave tx busy, callback: 1702)
TEST 5.11 FAILED got -142 (wave tx busy, serial read: 0)
TEST 5.12 PASS (serial read close: 0)
TEST 5.13 PASS (wave get micros: 6158148)
TEST 5.14 PASS (wave get high micros: 6158148)
TEST 5.15 PASS (wave get max micros: 1800000000)
TEST 5.16 PASS (wave get pulses: 3405)
TEST 5.17 PASS (wave get high pulses: 3405)
TEST 5.18 PASS (wave get max pulses: 12000)
TEST 5.19 PASS (wave get cbs: 6810)
TEST 5.20 PASS (wave get high cbs: 6810)
TEST 5.21 PASS (wave get max cbs: 25016)
TEST 5.22 PASS (wave create pad, count==1, wid==: 0)
TEST 5.23 PASS (wave create pad, count==2, wid==: 1)
TEST 5.24 PASS (delete wid==0 success: 0)
TEST 5.25 PASS (No more CBs using wave create: -67)
TEST 5.26 PASS (wave create pad, count==3, wid==: 0)
TEST 5.27 PASS (wave chain [1,0]: 0)
TEST 5.28 PASS (callback count==: 5)
Trigger tests.
TEST 6.1 PASS (gpio trigger count: 5)
TEST 6.2 PASS (gpio trigger pulse length: 150)
Watchdog tests.
TEST 7.1 PASS (set watchdog on count: 39)
TEST 7.2 PASS (set watchdog off count: 0)
Bank read/write tests.
TEST 8.1 PASS (read bank 1: 0)
TEST 8.2 PASS (read bank 1: 33554432)
TEST 8.3 PASS (clear bank 1: 0)
TEST 8.4 PASS (set bank 1: 1)
TEST 8.5 PASS (read bank 2: 0)
TEST 8.6 PASS (clear bank 2: 0)
TEST 8.7 PASS (clear bank 2: -42)
TEST 8.8 PASS (set bank 2: 0)
TEST 8.9 PASS (set bank 2: -42)
Script store/run/status/stop/delete tests.
TEST 9.1 PASS (store/run script: 100)
TEST 9.2 PASS (run script/script status: 201)
TEST 9.3 PASS (run/stop script/script status: 410)
TEST 9.4 PASS (delete script: 0)
Test ./x_pigpio.py # check Python I/F to daemon
something wrong:
Connected to pigpio daemon.
Testing pigpio Python module 1.78
Python 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]
pigpio version 79.
Hardware revision 10494163.
Mode/PUD/read/write tests.
TEST 1.1 PASS (set mode, get mode: 0)
TEST 1.2 PASS (set pull up down, read: 1)
TEST 1.3 PASS (set pull up down, read: 0)
TEST 1.4 PASS (write, get mode: 1)
TEST 1.5 PASS (read: 0)
TEST 1.6 PASS (write, read: 1)
PWM dutycycle/range/frequency tests.
TEST 2.1 PASS (set PWM range, set/get PWM frequency: 10)
TEST 2.2 PASS (get PWM dutycycle: 0)
TEST 2.3 PASS (set PWM dutycycle, callback: 0)
TEST 2.4 PASS (get PWM dutycycle: 128)
TEST 2.5 PASS (set PWM dutycycle, callback: 40)
TEST 2.6 PASS (set/get PWM frequency: 100)
TEST 2.7 PASS (callback: 400)
TEST 2.8 PASS (set/get PWM frequency: 1000)
TEST 2.9 PASS (callback: 4000)
TEST 2.10 PASS (get PWM range: 255)
TEST 2.11 PASS (get PWM real range: 200)
TEST 2.12 PASS (set/get PWM range: 2000)
TEST 2.13 PASS (get PWM real range: 200)
PWM/Servo pulse accuracy tests.
TEST 3.1 PASS (get servo pulsewidth: 500)
TEST 3.2 PASS (set servo pulsewidth: 40000)
TEST 3.3 PASS (get servo pulsewidth: 1500)
TEST 3.4 PASS (set servo pulsewidth: 13333)
TEST 3.5 PASS (get servo pulsewidth: 2500)
TEST 3.6 PASS (set servo pulsewidth: 8000)
TEST 3.7 PASS (set/get PWM frequency: 1000)
TEST 3.8 PASS (set PWM range: 200)
TEST 3.9 PASS (get PWM dutycycle: 20)
TEST 3.10 PASS (set PWM dutycycle: 200)
TEST 3.11 PASS (get PWM dutycycle: 40)
TEST 3.12 PASS (set PWM dutycycle: 400)
TEST 3.13 PASS (get PWM dutycycle: 60)
TEST 3.14 PASS (set PWM dutycycle: 600)
TEST 3.15 PASS (get PWM dutycycle: 80)
TEST 3.16 PASS (set PWM dutycycle: 800)
Pipe notification tests.
TEST 4.1 PASS (notify open/begin: 0)
TEST 4.2 PASS (notify pause: 0)
TEST 4.3 PASS (notify close: 0)
TEST 4.4 PASS (sequence numbers ok: 1)
TEST 4.5 PASS (gpio toggled ok: 1)
TEST 4.6 PASS (number of notifications: 80)
Waveforms & bit bang serial read/write tests.
TEST 5.1 PASS (callback, set mode, wave clear: 0)
TEST 5.2 PASS (pulse, wave add generic: 4)
TEST 5.3 PASS (wave send repeat: 9)
TEST 5.4 FAILED got 26 (callback: 50)
TEST 5.5 PASS (wave tx stop: 0)
TEST 5.6 PASS (serial read open: 0)
TEST 5.7 PASS (wave clear, wave add serial: 3405)
TEST 5.8 PASS (wave send once: 6811)
TEST 5.9 PASS (callback: 0)
TEST 5.10 FAILED got 1737 (wave tx busy, callback: 1702)
bytearray(b'\x98\x80\xf8\x98\xfe\x9e~\x06\x98\x98\xe6\xf8\x06\x18~\x80\x9ef\x06\x98~\x86\x9e\xf8\x9e`fx\x18\x06\x98\x9ex\x06\x98\x9ef\x86\xf8\x06\x18x\x86\x9e\x1e\xe6\xe0\xe6\x9e\xf8\x9e`fx\xf8\x9e`\x86\x06\xe6\x98\x06\x06xf\x06\x98x\xe0\x9e\xfe\x9e\x18f\x9e\xfe\x9ef\xe6\xf8\x06\x98\xf8f~\xe6\x9e\xe6\x9ef\x86\xf8\x06\x18\xe0f\x06\x18~\x80\x9e\x86\x9e\x1e\x06\x98\xf8f~\xf8\x9e\x00\x98\x9ex\x06\x98x\xe6\x9e\x18\xe6\xe6\xe6~\x98\x80\x06\x86\x9e`\x06\x98\x80\x06\x9e\xe0\x9e\x00\x18~\x80\x9ef\x06\x98\xe0\x06\x9e\xfe\x9ef\x06x\x1e\x06\x18~\x80\x9e\x06\x06~\x00\x18\x9e\xfe\x9ef\x86\xf8\xe6\x18`\x06\x98\xe6\x06\xe6\x9e\xf8\x9e\x00\x98\x9ef\x86\xf8\x06\x18\x9e\xfe\x9ef\xe6\xf8fx\x98\x80\x86\x98\xf8\x9e\x00\x18~\x80\x9ef\x06\x18xffx\x00\x06\x18\xe0\xe6\x9e\x1e\xe6\x9e\xe6\x9e\x00\x98\x9ex\x06\x18~\x80\x9ef\x06\x98\x9e\x1efx\x06\x86\x9e\x00\x18\xe0f~\x18f\x9ef\x06x\xf8\x86\x98\x80\xf8\x98\xfe\x9e~\x06\x98\x80\x86\xf8fx\x00\x98\x9ef\x86\xf8\x06\x18\xe0\x86\xf8\xe6\x9e~\xe6\xf8\x06\x18\xe0\xe6\x9ef\x86\x9e`\x06\x98~\x86\x9e`\x06\x9e\x00\x18~\x86\x9e\x1e\x06~\xfe\x9e\x18f\x9e\xfe\x9ef\xe6\xf8\x06\x98~\x18fx\x06\x06~\x80\x9e\x1e\xe6~\x98\x80\xfe\x98f\x86\xf8\x06\x18\xe0\x86\xf8f~\x86\x9e\x1efx`\x06\x98\x80\x86\xf8f\x9e\x1e\x06\x18\x9ef\x86\x9e~\x06\x98\xe6\x06\x06\x18x\xfe\x9e\x18\x06\x98\x9e\xe6\x9e\xf8\x9eff\x9ef\x86\x9e`\xe6\xf8\xe6~\x98\x80\xfe\x98f\x86\xf8\x06\x98\xf8\x06~f\x86\xf8\x86\x9e\x00\x98\x80\x06\x9e\x06\x86\xf8f~\xe6\x9e\x1e\x06\x98\xe0\x06\x9e\x06\x86\x9e~fx`\x06\x18~\xfe\x9e\x00\x98\x9efx\x18\x86\xf8f\x06\x98\x9efxf\x06~\x86\x9e\xf8\x9e~\xe6\xf8\x06\x86\x98\x80\xfe\x98f\x86\xf8\x06\x18x\x18fx\x06\x06xxf~\xe0\x9e\x00\x98\x9ef\x86\xf8\xe6\xe0\x06\x9ef\xe6\xf8\x06\x18~\xfe\x9e\x00\x18xf\x06\x9e\x86\x9e~\x06\x9e`\x86xf\x06\x9e\x00\x98\x9efx\x06\xe6\xf8f~\x18fx\x1e\x86\x86\x98\x80~\x86\xf8f\x9e\xe6\x9e\xe6\x86xf\x9e\x1ef\xe6xf\x06x\x00\x98~\x06\x86\xf8\x06\x18\x9e\x06\x06~\x80\x9e\x00\x98\xf8f\x9e\xfe\x9e\xfe\x9e`\x06\x9e~\x18x\x00\x18\x9e\x86\x9e\x1e\x06\x98~\x18f\x9e\xf8\x9e\x9e\x9e\xe0\x9ef\x06x\x00\x18x\x18\xe6\x9e\xf8\x9e`\xe6~\x98\x80\x06\x86\x9e`\x06\x18\x9e\xfe\x9e~\x06\x86\x00\x98\x98\x86\x9e\x1e\x06~ff\x06x\x00\x98\x9ex\x06\x98\x9e\xe6\x9ef\x86\x9e`f\x9e\xf8\x9e~\x06\x18\xe0f\x86\xf8\x06xf\x06x\x00\x98\xf8\x06~ffx`\xe6\xf8\x86\x06`f\x9e\x00\x18x\x18f\x9e~\x06\x9e`\x06\x18~\x80\x9ef\x06\x98\xf8\xe6\x9ef\x06\x9e\x1e\x06\x98\x9ex\x06\x18xff\x86\xf8\x86xf\x06\x9e\x00\x98\x80\x06xxfx\x18\xe6\xf8f\x86\xf8f\x9ef\xe6\xf8\x06\x86\x98\x80\x80\x98f\x06\x98\xe0f\x06fx\x18\xe6\xf8\x06\x18\x9e\x86\x9e\xe6\x9e\x18\x06\x9e\x86\x06\x98\x98\x86\x9e\x00\x98\x80\x06\x18\x9e\x06\x06x\x86\xe6\x18\x1e\x06\x98\xe0\x06\x9e\x06f\x9e\x18fx\x18\x86\x06`f\x9e\x00\x18~\x80\x9ef\x06\x18\x9e\x06\xe6\xf8\xe6\xe0f\x9exf\x9e\xfe\x9ef\xe6\xf8\x06\x18\x06\x9eff\xe6\xf8f\x9e\xf8\x9e~\x06\x98\x9ex\x06\x98\x80\x06\x18\x9ef\x06~f\x86\x86\x98\x80') bytearray(b"\nNow is the winter of our discontent\nMade glorious summer by this sun of York;\nAnd all the clouds that lour\'d upon our house\nIn the deep bosom of the ocean buried.\nNow are our brows bound with victorious wreaths;\nOur bruised arms hung up for monuments;\nOur stern alarums changed to merry meetings,\nOur dreadful marches to delightful measures.\nGrim-visaged war hath smooth\'d his wrinkled front;\nAnd now, instead of mounting barded steeds\nTo fright the souls of fearful adversaries,\nHe capers nimbly in a lady\'s chamber\nTo the lascivious pleasing of a lute.\n")
TEST 5.11 FAILED got 0 (wave tx busy, serial read: 1)
TEST 5.12 PASS (serial read close: 0)
TEST 5.13 PASS (wave get micros: 6158148)
TEST 5.14 PASS (NOT APPLICABLE: 0)
TEST 5.15 PASS (wave get max micros: 1800000000)
TEST 5.16 PASS (wave get pulses: 3405)
TEST 5.17 PASS (NOT APPLICABLE: 0)
TEST 5.18 PASS (wave get max pulses: 12000)
TEST 5.19 PASS (wave get cbs: 6810)
TEST 5.20 PASS (NOT APPLICABLE: 0)
TEST 5.21 PASS (wave get max cbs: 25016)
TEST 5.22 PASS (wave clear: 0)
TEST 5.23 PASS (pulse, wave add generic: 4)
TEST 5.24 PASS (wave create: 0)
TEST 5.25 PASS (wave send repeat: 9)
TEST 5.26 FAILED got 26 (callback: 50)
TEST 5.27 PASS (wave tx stop: 0)
TEST 5.28 PASS (wave add serial: 3405)
TEST 5.29 PASS (wave create: 1)
TEST 5.30 PASS (wave send once: 6811)
TEST 5.31 PASS (callback: 0)
TEST 5.32 PASS (wave tx busy, callback: 1702)
TEST 5.33 PASS (wave delete: 0)
TEST 5.34 PASS (wave create and pad, wid==: 0)
TEST 5.35 PASS (wave create and pad, wid==: 1)
TEST 5.36 PASS (delete wid==0 success: 0)
TEST 5.37 PASS (No more CBs using wave create: -67)
TEST 5.38 PASS (wave create pad, count==3, wid==: 0)
TEST 5.39 PASS (wave chain [1,0]: 0)
TEST 5.40 PASS (callback count==: 10)
Trigger tests.
TEST 6.1 PASS (gpio trigger count: 5)
TEST 6.2 PASS (gpio trigger pulse length: 150)
Watchdog tests.
TEST 7.1 PASS (set watchdog on count: 39)
TEST 7.2 PASS (set watchdog off count: 0)
Bank read/write tests.
TEST 8.1 PASS (read bank 1: 0)
TEST 8.2 PASS (read bank 1: 33554432)
TEST 8.3 PASS (clear bank 1: 0)
TEST 8.4 PASS (set bank 1: 1)
TEST 8.5 PASS (read bank 2: 0)
TEST 8.6 PASS (clear bank 2: 0)
TEST 8.7 PASS (clear bank 2: -42)
TEST 8.8 PASS (set bank 2: 0)
TEST 8.9 PASS (set bank 2: -42)
Script store/run/status/stop/delete tests.
TEST 9.1 PASS (store/run script: 100)
TEST 9.2 PASS (run script/script status: 201)
TEST 9.3 PASS (run/stop script/script status: 110)
TEST 9.4 PASS (delete script: 0)
Wavechains & filter tests.
TEST 13.1 PASS (callback, set mode, wave clear: 0)
TEST 13.2 PASS (pulse, wave add generic: 6)
TEST 13.3 PASS (clear glitch filter: 0)
TEST 13.4 PASS (clear noise filter: 0)
TEST 13.5 PASS (wave chain: 0)
TEST 13.6 PASS (wave chain, tally: 2688)
TEST 13.7 FAILED got 2688 (glitch filter, wave chain, tally: 1792)
TEST 13.8 FAILED got 1792 (glitch filter, wave chain, tally: 896)
TEST 13.9 FAILED got 1792 (glitch filter, wave chain, tally: 0)
TEST 13.10 FAILED got 750 (noise filter, wave chain, tally: 1500)
TEST 13.11 PASS (noise filter, wave chain, tally: 750)
TEST 13.12 FAILED got 13 (noise filter, wave chain, tally: 0)
TEST 13.13 PASS (wave delete: 0)
Test ./x_pigs # check pigs I/F to daemon
:
Testing pigpio pigs
pigpio version 79
BC1 ok
BC2 ok
BR1 ok
BR2 ok
BS1 ok
BS2 ok
HELP ok
HWVER ok
MICS ok
MILS ok
MODEG ok
MODES ok
NO(0) ok
NB(0) ok
NP(0) ok
NC(0) ok
PFG-a ok
PFG-b ok
PFS-a ok
PFS-b ok
PRG-a ok
PRG-b ok
PROC(0) ok
PROCR(0) ok
PROCP(0) ok
PROCS(0) ok
PROCD(0) ok
PRRG ok
PRS-a ok
PRS-b ok
PRS-c ok
PRS-d ok
PUD-a ok
PUD-b ok
PUD-c ok
PUD-d ok
PUD-e ok
PWM-a ok
GDC-a ok
PWM-b ok
GDC-b ok
PWM-c ok
GDC-c ok
PWM-d ok
READ-a ok
READ-b ok
READ-c ok
READ-d ok
READ-e ok
SERVO-a ok
GPW-a ok
SERVO-b ok
GPW-b ok
SERVO-c ok
GPW-c ok
SERVO-d ok
SLR-a ok
SLR-b ok
SLR-c ok
SLR-d ok
WVCRE ok
SLR-e ok
SLR-f fail with [23 230 158 134 6 24 158 6 102 158 102 6 152 152 230 248 6 24 230 230 158 6 134 158]
SLR-g ok
TICK ok
TRIG-a ok
TRIG-b ok
TRIG-c ok
TRIG-d ok
WDOG-a ok
WDOG-b ok
WRITE-a ok
WRITE-b ok
WRITE-c ok
WRITE-d ok
WVCLR ok
WVAS ok
WVAG ok
WVCRE ok
WVTX ok
WVBSY-a ok
WVBSY-b ok
WVHLT ok
WVBSY-c ok
WVTXR ok
WVBSY-d ok
WVHLT ok
WVBSY-e ok
WVSC-a ok
WVSC-b ok
WVSC-c ok
WVSM-a ok
WVSM-b ok
WVSM-c ok
WVSP-a okTesting pigpio pipe I/F
pigpio version 79
BC1 ok
BC2 ok
BR1 ok
BR2 ok
BS1 ok
BS2 ok
HELP-a ok
HELP-b ok
HWVER ok
MICS ok
MILS ok
MODEG ok
MODES ok
NO(0) ok
NB(0) ok
NP(0) ok
NC(0) ok
PFG-a ok
PFG-b ok
PFS-a ok
PFS-b ok
PRG-a ok
PRG-b ok
PROC(0) ok
PROCR(0) ok
PROCP(0) ok
PROCS(0) ok
PROCD(0) ok
PRRG ok
PRS-a ok
PRS-b ok
PRS-c ok
PRS-d ok
PUD-a ok
PUD-b ok
PUD-c ok
PUD-d ok
PUD-e ok
PWM-a ok
GDC-a ok
PWM-b ok
GDC-b ok
PWM-c ok
GDC-c ok
PWM-d ok
READ-a ok
READ-b ok
READ-c ok
READ-d ok
READ-e ok
SERVO-a ok
GPW-a ok
SERVO-b ok
GPW-b ok
SERVO-c ok
GPW-c ok
SERVO-d ok
SLR-a ok
SLR-b ok
SLR-c ok
SLR-d ok
WVCRE ok
SLR-e ok
SLR-f fail with (23 230 158 134 6 24 158 6 102 158 102 6 152 152 230 248 6 24 230 230 158 6 134 158)
SLR-g ok
TICK ok
TRIG-a ok
TRIG-b ok
TRIG-c ok
TRIG-d ok
WDOG-a ok
WDOG-b ok
WRITE-a ok
WRITE-b ok
WRITE-c ok
WRITE-d ok
WVCLR ok
WVAS ok
WVAG ok
WVCRE ok
WVTX ok
WVBSY-a ok
WVBSY-b ok
WVHLT ok
WVBSY-c ok
WVTXR ok
WVBSY-d ok
WVHLT ok
WVBSY-e ok
WVSC-a ok
WVSC-b ok
WVSC-c ok
WVSM-a ok
WVSM-b ok
WVSM-c ok
WVSP-a ok
WVSP-b ok
WVSP-c ok
WVSP-b ok
WVSP-c ok
WVCAP-a ok
WVCAP-b ok
WVCAP-c ok
ERROR: No more CBs for waveform
WVCAP-d ok
WVCAP-e ok
Test ./x_pipe # check pipe I/F to daemon
:
Testing pigpio pipe I/F
pigpio version 79
BC1 ok
BC2 ok
BR1 ok
BR2 ok
BS1 ok
BS2 ok
HELP-a ok
HELP-b ok
HWVER ok
MICS ok
MILS ok
MODEG ok
MODES ok
NO(0) ok
NB(0) ok
NP(0) ok
NC(0) ok
PFG-a ok
PFG-b ok
PFS-a ok
PFS-b ok
PRG-a ok
PRG-b ok
PROC(0) ok
PROCR(0) ok
PROCP(0) ok
PROCS(0) ok
PROCD(0) ok
PRRG ok
PRS-a ok
PRS-b ok
PRS-c ok
PRS-d ok
PUD-a ok
PUD-b ok
PUD-c ok
PUD-d ok
PUD-e ok
PWM-a ok
GDC-a ok
PWM-b ok
GDC-b ok
PWM-c ok
GDC-c ok
PWM-d ok
READ-a ok
READ-b ok
READ-c ok
READ-d ok
READ-e ok
SERVO-a ok
GPW-a ok
SERVO-b ok
GPW-b ok
SERVO-c ok
GPW-c ok
SERVO-d ok
SLR-a ok
SLR-b ok
SLR-c ok
SLR-d ok
WVCRE ok
SLR-e ok
SLR-f fail with (23 230 158 134 6 24 158 6 102 158 102 6 152 152 230 248 6 24 230 230 158 6 134 158)
SLR-g ok
TICK ok
TRIG-a ok
TRIG-b ok
TRIG-c ok
TRIG-d ok
WDOG-a ok
WDOG-b ok
WRITE-a ok
WRITE-b ok
WRITE-c ok
WRITE-d ok
WVCLR ok
WVAS ok
WVAG ok
WVCRE ok
WVTX ok
WVBSY-a ok
WVBSY-b ok
WVHLT ok
WVBSY-c ok
WVTXR ok
WVBSY-d ok
WVHLT ok
WVBSY-e ok
WVSC-a ok
WVSC-b ok
WVSC-c ok
WVSM-a ok
WVSM-b ok
WVSM-c ok
WVSP-a ok
WVSP-b ok
WVSP-c ok
Thank you for the test results!
So, it appears that waveforms are broken in this bullseye release. If you could help nail this down further with:
cat /etc/debian_version
and
uname -a
Waveforms is essentially the same as pwm (DMA based control). Can we confirm that your application is using a DMA based control API? That would be nice to know there is consistency between the test failures and your application behavior.
Hi @guymcswain thank you for your support. Here the results.
cat /etc/debian_version
:
11.5
uname -a
:
Linux UC19Domotica 5.15.76-v7+ #1597 SMP Fri Nov 4 12:13:17 GMT 2022 armv7l GNU/Linux
To test the behavior:
- I've enable the pigpiod to start at boot time:
sudo systemctl enable pigpiod
. - Then in
/etc/rc.local
i put this init code for the two GPIO i used:if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi export PYTHONPATH=/home/ingegnosi/sanpietro /usr/bin/python3 /home/ingegnosi/sanpietro/sanpietroInit.py exit 0
- The
sanpietroInit.py
(The relays are LOW level trigger):import RPi.GPIO as GPIO if __name__ == '__main__': # Set each pin as an output and make it low: GPIO.setmode(GPIO.BCM) GPIO.setup(27, GPIO.OUT) GPIO.output(27, GPIO.HIGH) GPIO.setup(22, GPIO.OUT) GPIO.output(22, GPIO.HIGH) ```
- During the boot of the system the relays switch on and off continusly and i must plug off the power to stop or do a
sudo systemctl disable pigpiod
after disconneted the GPIO to the relays module and making a power cicle.
I use the pigpio interface in another python service (for interfacing with Wiegand reader e the Relays Module) i coded but the problems come out just doing the point from 1. to 3. without run this service.
From the above code snippet, it looks like you are only using gpio read and write APIs. Those APIs have nothing to do with the DMA. The basic tests above indicate basic gpio read write are working - Test suite 1.x - so this is inconsistent with your application failures.
It would be good to know if GPIO is using glitch or noise filtering which does rely on DMA samples and would presumably fail since Test suite 13.x shows failures in this area.
Another thing just caught my eye. You say the OS is Raspbian 11 and not Raspberry Pi OS. If that is correct, can you test with the official RPi OS.
I won't be able to run any testing until around mid-January as all my devices are currently "in production".
My misunderstanding, I thought they were separate variants. I would prefer to change the title to RPi OS 11 in this case.
In case of a conflict with audio please try the following:
- Ensure you have remote access (ssh).
- Unplug your HDMI cable from the rpi.
- Re-run the pigpio tests over a remote connection.
Background: Audio may use PWM hardware registers which conflict with pigpio. RPi OS 11 release notes mention: "Modifications to HDMI audio output selection to support the above".
Thank you @guymcswain for your suggestions.
The tests i've reported above has been done in that condiftions:
- via remote access SSH
- HDMI cable unplugged
@pierol , thank you for your patience.
I don't have my hardware freed up yet to do any testing. However, I recently did a search on the raspberrypi.com forums and found an issue that may be related to yours. Here is a link to that thread.
It would be interesting to see if your problem goes away when changing to the Lite OS version of Bulleye. Seeing that you are running your testing remotely perhaps this could be a long term workaround for your situation.
@guymcswain Thank you for your support. Yes it seems to be the same issue.
I've done the same config (RPi OS 11 32 bit Desktop) with a Raspberry Pi 4B 2G and all operate as expected without the problem.
In the forum one says it has the problem even on rpi4 but he has installed a RPi OS 11 64bit Desktop.
Please try the following:
// Create a drop-in file for pigpiod.service:
// note: automatically creates '/etc/systemd/system/pigpiod.service.d/override.conf'
# sudo systemctl edit pigpiod
// Add this content to the file:
[Install]
WantedBy=
WantedBy=default.target
After this it should restart the daemon or it will prompt you to do so.
Sorry @guymcswain I should add this
[Install]
WantedBy=
WantedBy=default.target
or this:
[Install]
WantedBy=default.target
In both versions the problem persist, at boot time le relay flashes continuesly
@pierol , thank you for your patience.
I don't have my hardware freed up yet to do any testing. However, I recently did a search on the raspberrypi.com forums and found an issue that may be related to yours. Here is a link to that thread.
It would be interesting to see if your problem goes away when changing to the Lite OS version of Bulleye. Seeing that you are running your testing remotely perhaps this could be a long term workaround for your situation.
Yes i can confirm that with RPi OS 11 Lite bullseye the problem disappears
You need both statements. The first overrides the existing setting then the second sets the new setting.
I tried with this:
[Install]
WantedBy=
WantedBy=default.target
but the problem persists
I'm got my pi3b+ (a020d3) with a fresh install of RPi OS 32 bit desktop:
cat /etc/debian_version
11.6
I tried to reproduce the experiments on the raspberrypi forum, using an LED on gpio 17, but so far I'm not able to reproduce the flashing behavior. However, I have experienced the system to hang on reboot occasionally. The screen goes blank, and I cannot do any debug at that point.
Do you have any suggestions on how to reproduce the erratic gpio behavior? Which gpio pins are used in your script?
Meanwhile, I'm researching how to make the daemon start later in the boot process.
Ok, I think I understand how to get the pigpiod service to start later in the boot sequence. But first, I should explain why: My theory is that pigpiod service is starting too soon and possibly conflicting with another process that is touching peripheral registers that pigpio also uses.
- Since we previously changed the pigpiod.service on your system, we need to revert back to the original by doing:
sudo systemctl revert pigpiod
- List the service file using
systemctl cat pigpiod
and it should look like this:
# /lib/systemd/system/pigpiod.service
[Unit]
Description=Daemon required to control GPIO pins via pigpio
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
- Create a drop-in override file to modify the pigpiod service.
sudo systemctl edit pigpiod
- Add these lines:
[Unit]
Requires=default.target
After=default.target
sudo systemctl daemon-reload
- Verify the service is still enabled by
sudo systemctl status pigpiod
- If it is not, then enable it by
sudo systemctl enable pigpiod
sudo reboot
Please let me know if your script is now functioning properly. Also, verify that pigpiod.service is running near the end of the boot sequence. To do so, run systemd-analyze blame
(you may need to apt install systemd-analyze
). In the output from this command you should see 'pigpiod.service' listed near the end of the boot sequence. On my system it shows up after 'nfs-config.service'.
After done the steps you suggested the deamon doesn't start at boot time. Here le output of some commands:
systemctl cat pigpiod
:
# /lib/systemd/system/pigpiod.service
[Unit]
Description=Daemon required to control GPIO pins via pigpio
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/pigpiod.service.d/override.conf
[Unit]
Requires=default.target
After=default.target
sudo systemctl status pigpiod
:
● pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/lib/systemd/system/pigpiod.service; enabled; vendor prese>
Drop-In: /etc/systemd/system/pigpiod.service.d
└─override.conf
Active: inactive (dead)
- If i make a
ps -aux | grep pigpiod
the proccess doesn't appear. systemd-analyze blame
the pigpiod doesn't appear
9.191s hciuart.service
3.930s rc-local.service
2.534s dev-mmcblk0p2.device
2.467s fstrim.service
2.082s raspi-config.service
1.678s udisks2.service
1.578s ModemManager.service
1.286s cups.service
1.183s ssh.service
1.133s plymouth-read-write.service
1.118s glamor-test.service
1.045s avahi-daemon.service
998ms rng-tools-debian.service
891ms keyboard-setup.service
842ms networking.service
815ms systemd-timesyncd.service
793ms polkit.service
786ms systemd-logind.service
735ms dphys-swapfile.service
697ms e2scrub_reap.service
686ms gldriver-test.service
656ms lightdm.service
649ms user@1000.service
608ms systemd-udev-trigger.service
490ms dhcpcd.service
485ms systemd-journal-flush.service
472ms systemd-udevd.service
454ms systemd-fsck@dev-disk-by\x2dpartuuid-5c76fb9e\x2d01.service
446ms systemd-fsck-root.service
445ms systemd-journald.service
403ms wpa_supplicant.service
346ms systemd-tmpfiles-setup-dev.service
345ms packagekit.service
343ms modprobe@drm.service
310ms rsyslog.service
237ms rpi-eeprom-update.service
234ms modprobe@fuse.service
213ms bluetooth.service
208ms systemd-remount-fs.service
201ms systemd-modules-load.service
200ms systemd-tmpfiles-setup.service
186ms fake-hwclock.service
185ms systemd-update-utmp.service
162ms dev-mqueue.mount
157ms run-rpc_pipefs.mount
154ms modprobe@configfs.service
151ms sys-kernel-debug.mount
145ms sys-kernel-tracing.mount
133ms systemd-user-sessions.service
124ms kmod-static-nodes.service
121ms systemd-random-seed.service
103ms systemd-sysusers.service
The service is dead. Make sure you reloaded the systemd daemon - step 4. Then do step 7 for good measure.
I did step 4. and step 5.
Something strange between your system and mine: On my system 'rc-local.service' runs late in the sequence. On your system it the second in sequence! Or maybe I don't understand the sequence - maybe its in reverse time? But it seems that rc-local.service should run near the end of the boot sequence.
The times listed are not the sequence but the amount of time taken for the service to execute. My bad.
I can only suggest to power down then check the listing and the status on pigpiod.service.
It seems that making the override break somthing and the deamon doesn't start anymore. If i make a sudo systemctl revert pigpiod
and after sudo systemctl daemon-reload
and sudo systemctl enable pigpiod
the daemon started and the problem appears.
You can edit the complete file skipping the override by doing sudo systemctl edit pigpiod --full
.
Then when you systemctl cat pigpiod
it will only show the service file under /etc/systemd/system (not /lib/systemd/system).
/etc/systemd/system/pigpiod.service should look like this:
[Unit]
Description=Daemon required to control GPIO pins via pigpio
Requires=default.target
After=default.target
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
Or just create a text file name pigpiod.service and copy it into /etc/systemd/system directly yourself.
And finally, sudo systemctl daemon-reload
is important.
There is something wrong with these two line in the file pigpiod.service
inside /etc/systemd/system
:
Requires=default.target
After=default.target
When i remove them the deamon started when i insert them the daemon doesn't started at boot time.
Making the procedure, after modify the file, of
sudo systemctl daemon-reload
sudo systemctl enable pigpiod
I'm got my pi3b+ (a020d3) with a fresh install of RPi OS 32 bit desktop:
cat /etc/debian_version 11.6
I tried to reproduce the experiments on the raspberrypi forum, using an LED on gpio 17, but so far I'm not able to reproduce the flashing behavior. However, I have experienced the system to hang on reboot occasionally. The screen goes blank, and I cannot do any debug at that point.
Do you have any suggestions on how to reproduce the erratic gpio behavior? Which gpio pins are used in your script?
Meanwhile, I'm researching how to make the daemon start later in the boot process.
To reproduce the problem, after enabled the pigpiod deamon at boot time, try to set a GPIO (in my case GPIO 27) even after the boot. When you try to se the GPIO the operate green led of the raspberry pi flashes
Does journalctl -u pigpiod
show any problem?
No, this is when started without that two mentionted lines
-- Boot 8e59563b9f0a49508d75998b0f96cefe --
Jan 22 21:25:06 raspberrypi systemd[1]: Starting Daemon required to control GPIO pins via pigpio...
Jan 22 21:25:06 raspberrypi systemd[1]: Started Daemon required to control GPIO pins via pigpio.
On boot-up, my system occasionally hangs with a black screen (I don't have remote login enabled). When this happens, I have to cycle power to try again to boot. When my system does boot successfully, I can control either gpio 17 or 27 normally. So, it seems I cannot reproduce the behavior of the erratic gpio but I have an unstable system in that it will not boot-up on occasion. I think my system behavior may just be a different manifestation of the same problem - that pigpiod is conflicting with another service during boot-up.
When I include the changes to the pigpiod.service as described above, I have a stable system.
The question is why your system will NOT accept the modified pigpiod.service.
I'm using pigpio for interfacing with Wiegand reader and a 2-Channel Relays Module.
Q1. Do you have this (Wiegand reader ...) running as a service from boot-up? If so please show the content of that service file.
Q2. With the original pigpiod.service file, what is the output from systemd-analyze critical-chain
Q3. With the original pigpiod.service file, what is the output from systemd-analyze critical-chain pigpiod.service
Answer to your question:
- Q1 ? All the tests i've done and i'm doing are on a fresh install without running any of my serivices. All i do is to setup in
/etc/rc.local
the GPIO 27 and GPIO 22 where i run a python3 script that do this initialization:
content of/etc/rc.local
:
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
export PYTHONPATH=/home/pi/sanpietro
/usr/bin/python3 /home/pi/sanpietro/sanpietroInit.py
exit 0
the sanpietroInit.py
do this:
import RPi.GPIO as GPIO
if __name__ == '__main__':
# Set each pin as an output and make it low:
GPIO.setmode(GPIO.BCM)
GPIO.setup(27, GPIO.OUT)
GPIO.output(27, GPIO.HIGH)
GPIO.setup(22, GPIO.OUT)
GPIO.output(22, GPIO.HIGH)
- Q2 ? the output of the command
systemd-analyze critical-chain
graphical.target @12.039s
└─multi-user.target @12.039s
└─getty.target @12.038s
└─getty@tty1.service @12.037s
└─plymouth-quit-wait.service @12.025s +6ms
└─rc-local.service @7.901s +4.118s
└─network.target @7.843s
└─wpa_supplicant.service @7.311s +525ms
└─dbus.service @6.479s
└─basic.target @6.448s
└─sockets.target @6.446s
└─triggerhappy.socket @6.445s
└─sysinit.target @6.410s
└─systemd-timesyncd.service @5.791s +617ms
└─systemd-tmpfiles-setup.service @5.561s +212ms
└─local-fs.target @5.501s
└─run-user-1000-gvfs.mount @15.908s
└─run-user-1000.mount @11.916s
└─local-fs-pre.target @2.726s
└─systemd-tmpfiles-setup-dev.service @2.617s +107ms
└─systemd-sysusers.service @2.532s +79ms
└─systemd-remount-fs.service @2.307s +200ms
└─systemd-fsck-root.service @1.826s +471ms
└─systemd-journald.socket @1.718s
└─-.mount @892ms
└─-.slice @892ms
- Q3 ? the output of the command
systemd-analyze critical-chain pigpiod.service
pigpiod.service +720ms
└─basic.target @6.448s
└─sockets.target @6.446s
└─triggerhappy.socket @6.445s
└─sysinit.target @6.410s
└─systemd-timesyncd.service @5.791s +617ms
└─systemd-tmpfiles-setup.service @5.561s +212ms
└─local-fs.target @5.501s
└─run-user-1000-gvfs.mount @15.908s
└─run-user-1000.mount @11.916s
└─local-fs-pre.target @2.726s
└─systemd-tmpfiles-setup-dev.service @2.617s +107ms
└─systemd-sysusers.service @2.532s +79ms
└─systemd-remount-fs.service @2.307s +200ms
└─systemd-fsck-root.service @1.826s +471ms
└─systemd-journald.socket @1.718s
└─-.mount @892ms
└─-.slice @892ms
I think your rc-local.service has a dependency on pigpiod (via import RPi.GPIO) and is waiting for the socket to open. But when we make pigpiod wait until after default.target (equivalent to graphical.target on desktop) the socket will never open.
rc-local.service runs before the graphical.target. Your script needs to run after graphical.target. I've read on the forums that autostart may be what you need to use. But I would highly recommend just use a systemd service for your script.
I tried this:
- I've deleted the two lines in
/etc/rc.local
so that i do nothing during boot time. - The problem appears anyway: there is only pigpiod started at boot time.
The only way to stop flashing is to disable the pigpiod.service.
You said you could not boot with the modified pigpiod.service I proposed. So now you are saying it boots but doesn't solve the "flashing" issue (after you have disabled your lines in /etc/rc.local)?
You can create a systemd service file similar to this:
[Unit]
Description=Your Python script
After=pigpiod.service
[Service]
ExecStart=/usr/bin/python3 /home/pi/sanpietro/sanpietroInit.py
[Install]
WantedBy=multi-user.target
With the modified pigpiod.service you proposed the service doesn't start. So i'm still with the original pigpiod.service file.
So now you are saying it boots but doesn't solve the "flashing" issue (after you have disabled your lines in /etc/rc.local)?
Yes, it boots with the flashing problem but not all the times: on 4 boots 2 didn't flash, 2 did flashes
If you want i can permit you to make a AnyDesk session on my desktop to see why it doesn't start
No thank you. But I will help you write a systemd service file.
You need to cleanly re-install RPi OS bullseye without adding services. Then make the changes to pigpiod service file. Then tell me if your system is unstable.
One question, when you've installed the RPi OS Desktop bullseye 32 bit on your 3b+ board, you made the updates ? I've always done
I found in the system log this (when i modified the pigpiod.service as you suggested):
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Found ordering cycle on pigpiod.service/start
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Found dependency on graphical.target/start
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Found dependency on multi-user.target/start
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Job pigpiod.service/start deleted to break ordering cycle starting with multi-user.target/start
I did a clean install then tried to reproduce the gpio 'flashing' as described on the rpi forum thread. After I couldn't reproduce it, I upgraded the OS with all the latest. After that I started to see some instability. But I can't say for certain it was due to the upgrade. In either case, after I changed the pigpiod.service I've had stability.
I saw log messages similar to what you mention above but it was after my first iteration of change to the service file. Since my last iteration those messages are no longer in the log.
Just to reiterate, the final version of the service file is:
[Unit]
Description=Daemon required to control GPIO pins via pigpio
Requires=default.target
After=default.target
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
Yes, is the version i'm using now but the service is deleted during the boot time for a cycle dependency.
Jan 23 21:29:14 raspberrypi systemd[1]: multi-user.target: Found ordering cycle on pigpiod.service/start
Jan 23 21:29:14 raspberrypi systemd[1]: multi-user.target: Found dependency on graphical.target/start
Jan 23 21:29:14 raspberrypi systemd[1]: multi-user.target: Found dependency on multi-user.target/start
Jan 23 21:29:14 raspberrypi systemd[1]: multi-user.target: Job pigpiod.service/start deleted to break ordering cycle starting with multi-user.target/start
I've deleted the lines in the rc.local so there is not any python script executed.
Can you try to do a fresh install on your board selecting to update during the installation process ? and then modify the pigpiod.service as you suggested and see if the service started ?
Is this the new install?
Is this the new install?
No, at the moment i've no time to do that. It's the installation i've made yesterday.
sudo systemctl daemon-reload
sudo reboot
#after boot-up
systemctl cat pigpiod
systemd-analyze critical-chain pigpiod.service
systemctl cat pigpiod
[Unit]
Description=Daemon required to control GPIO pins via pigpio
Requires=default.target
After=default.target
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
systemd-analyze critical-chain pigpiod.service
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
└─graphical.target @8.991s
└─multi-user.target @8.991s
└─ModemManager.service @7.758s +1.230s
└─polkit.service @6.642s +1.103s
└─basic.target @6.368s
└─sockets.target @6.368s
└─triggerhappy.socket @6.367s
└─sysinit.target @6.317s
└─systemd-timesyncd.service @5.665s +650ms
└─systemd-tmpfiles-setup.service @5.384s +267ms
└─local-fs.target @5.312s
└─run-user-1000.mount @11.606s
└─local-fs-pre.target @2.762s
└─systemd-tmpfiles-setup-dev.service @2.657s +103ms
└─systemd-sysusers.service @2.549s +102ms
└─systemd-remount-fs.service @2.335s +189ms
└─systemd-fsck-root.service @1.836s +492ms
└─systemd-journald.socket @1.725s
└─system.slice @938ms
└─-.slice @938ms
pigpiod.service is not listed?
do systemctl status pigpiod
then journalctl -u pigpiod --no-pager | tail -20
pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/etc/systemd/system/pigpiod.service; enabled; vendor preset: enabled)
Active: inactive (dead)
-- Boot f3c8f5ea0e274e8780992cb04e292c61 --
Jan 23 20:41:58 raspberrypi systemd[1]: Starting Daemon required to control GPIO pins via pigpio...
Jan 23 20:41:59 raspberrypi systemd[1]: Started Daemon required to control GPIO pins via pigpio.
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Found ordering cycle on graphical.target/stop
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Found dependency on pigpiod.service/stop
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Found dependency on multi-user.target/stop
Jan 23 20:55:22 raspberrypi systemd[1]: multi-user.target: Job graphical.target/stop deleted to break ordering cycle starting with multi-user.target/stop
Jan 23 20:55:22 raspberrypi systemd[1]: Stopping Daemon required to control GPIO pins via pigpio...
Jan 23 20:55:23 raspberrypi systemd[1]: pigpiod.service: Sent signal SIGTERM to control process 1334 (systemctl) on client request.
Jan 23 20:55:23 raspberrypi systemd[1]: pigpiod.service: Sent signal SIGTERM to main process 394 (pigpiod) on client request.
Jan 23 20:55:23 raspberrypi systemd[1]: pigpiod.service: Control process exited, code=killed, status=15/TERM
Jan 23 20:55:23 raspberrypi systemd[1]: pigpiod.service: Main process exited, code=exited, status=255/EXCEPTION
Jan 23 20:55:23 raspberrypi systemd[1]: pigpiod.service: Failed with result 'signal'.
Jan 23 20:55:23 raspberrypi systemd[1]: Stopped Daemon required to control GPIO pins via pigpio.
Jan 23 20:55:23 raspberrypi systemd[1]: pigpiod.service: Consumed 51.560s CPU time.
This makes no sense to me. Something else is conflicting but I don't know how to debug it. I will wait until after you have a clean install.
I have been doing all of my testing from a local console if that makes any difference.
I have been doing all of my testing from a local console if that makes any difference.
I've done all my test via ssh with the hdmi cable pluged off. After a fresh install i always enable SSH interface, and then i do all the configuration via ssh.
I'm plugged in to a monitor with gui but only using terminal. It may be worth trying locally just to see if there is a difference,
It may be worth trying locally just to see if there is a difference,
No any difference the service doens't start
Hi @guymcswain,
i've a new installation with updates applied.
Tell me the steps i should do to configure the pigpiod deamon. At the moment i've done nothing neither sudo systemctl enable pigpiod
. As you know the pigpiod is already installed in this version of the RPi OS 32 bit Desktop bullseye.
The only difference respect to your board is the you installed the updates after the installation of the OS and not during it as i've done.
Ok, let's first confirm somethings:
pigpoid -v
should return "79"
pigs pigpv
should return "socket not connected"
systemctl status pigpiod
should show that pigpiod is not enabled
systemctl cat pigpiod
shows only the unit file under /lib/systemd/system
Can i do all these steps via SSH or locally ?
ssh is ok
Ok, let's first confirm somethings:
pigpoid -v
should return "79"
confirmed
pigs pigpv
should return "socket not connected"
this return "socket connect failed"
systemctl status pigpiod
should show that pigpiod is not enabled
● pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/lib/systemd/system/pigpiod.service; disabled; vendor pres>
Active: inactive (dead)
systemctl cat pigpiod
shows only the unit file under /lib/systemd/system
# /lib/systemd/system/pigpiod.service
[Unit]
Description=Daemon required to control GPIO pins via pigpio
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
HDMI cable unplugged
Good, next we will add the two lines to the pigpiod.service file:
sudo systemctl edit pigpiod
Add these lines in the first section:
[Unit]
Requires=default.target
After=default.target
List the file again using:
systemctl cat pigpiod
It is ok. Just add the lines after "Anything between here and ..."
OK done.
systemctl cat pigpiod
# /lib/systemd/system/pigpiod.service
[Unit]
Description=Daemon required to control GPIO pins via pigpio
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/pigpiod.service.d/override.conf
[Unit]
Requires=default.target
After=default.target
good.
Now we will reload the systemd daemon, enable pigiod and then reboot:
sudo systemctl daemon-reload
sudo systemctl enable pigpiod
sudo reboot
We have different systems somehow. Please show output from journalctl -u pigpiod
my system:
uname -a
Linux raspberrypi 5.15.84-v7+ #1613 SMP Thu Jan 5 11:59:48 GMT 2023 armv7l GNU/Linux
Mine:
uname -a
Linux raspberrypi 5.15.84-v7+ #1613 SMP Thu Jan 5 11:59:48 GMT 2023 armv7l GNU/Linux
I don't understand the difference. I don't know where to go from here.
I did update my system. Can you update yours and see if the results are the same?
The only difference seems to be the i've the ssh deamon started at boot time respect to you.
You should try to reformatted your board and active the SSH interface and make the config via SSH to reproduce the problem.
It seems not to be the right solution to override the serivice file of the pigpiod.
This two lines:
[Unit]
Requires=default.target
After=default.target
are not the solution at all.
Since today, I'm now running with SSH and VNC server enabled. I'm controlling via my win10 pc.
I did update my system. Can you update yours and see if the results are the same?
I did the updates during the installation process. Do you mean i should force the update with:
sudo apt-get update
sudo apt-get upgrade
cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2835
Revision : a020d3
Serial : 00000000b9c5a355
Model : Raspberry Pi 3 Model B Plus Rev 1.3
I had Bluetooth disabled on my system. You?
I had Bluetooth disabled on my system. You?
How can i see if it is enabled ?
Top right side of the desktop gui. My BT symbol is grayed out.
My is on
I did the updates during the installation process. Do you mean i should force the update with:
sudo apt-get update
sudo apt-get upgrade
Yes, I did
sudo apt update
sudo apt upgrade
With BT on, I rebooted and the pigpiod service comes up as expected. So that's not it.
I've reforced the updated and i've disabled the BT but the deamon isn't started
Let's try going back to the beginning:
sudo systemctl revert pigpiod
sudo systemctl daemon-reload
sudo systemctl enable pigpiod
sudo reboot
When I was at this point the system was unstable - sometimes it would hang during boot. But when it did come up the pigpiod service is running but I was not able to see the 'flashing' on gpio pins 17 or 27.
How does your system respond?
How does your system respond?
After made all the command to revert at the reboot the onboard green led flashing meaning that the GPIOs has the 10Hz square pulse. The pigpio deamon is started
Let's exchange systems. How far away do you live from Texas? Joking.
I'm from Italy near Venice don't too far.
Well, I'd like to visit ... I'm on ethernet LAN, not WiFi. I'm grasping at straws.
Me too the rasp is connected via LAN ethernet port on board
After a google search on service cycle dependency, i found this command:
for installing command dot
sudo apt install graphviz
systemd-analyze verify default.target |&
perl -lne 'print $1 if m{Found.*?on\s+([^/]+)}' |
xargs --no-run-if-empty systemd-analyze dot |
dot -Tsvg >cycle.svg
Color legend: black = Requires
dark blue = Requisite
dark grey = Wants
red = Conflicts
green = After
I'm not an expert but the cycle is:
pigpiod.service -> graphical.target -> multi-user-target -> pigpiod.service
Jan 26 13:40:40 raspberrypi systemd[1]: multi-user.target: Found ordering cycle on pigpiod.service/start
Jan 26 13:40:40 raspberrypi systemd[1]: multi-user.target: Found dependency on graphical.target/start
Jan 26 13:40:40 raspberrypi systemd[1]: multi-user.target: Found dependency on multi-user.target/start
Jan 26 13:40:40 raspberrypi systemd[1]: multi-user.target: Job pigpiod.service/start deleted to break ordering cycle starting with multi-user.target/start
So the possible solution is to break the dependency of pigpiod.service from graphical.target. In my system the default.target
is graphical.target
:
systemctl get-default
graphical.target
so the two lines:
[Unit]
Requires=default.target
After=default.target
create the cycle dependency. So i chaged the two lines in this:
[Unit]
Requires=multi-user.target
After=multi-user.target
and EUREKA the pigpio daemon started and the good news is that the led stop flashing (tried 4 power cycles and the problem seems disappeared).
That is good news.
On my system, I did a clean install of RPiOS then performed the changes we discussed yesterday and now my system fails with the dependency problem also.
I did something similar to you but I used default.target as so:
pi@raspberrypi:~ $ systemctl cat pigpiod
# /lib/systemd/system/pigpiod.service
[Unit]
Description=Daemon required to control GPIO pins via pigpio
[Service]
ExecStart=/usr/bin/pigpiod -l
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/pigpiod.service.d/override.conf
[Unit]
Requires=default.target
After=default.target
[Install]
WantedBy=
WantedBy=default.target
I want to use the latest target possible and, according to the systemd-analyze critical-chain, that appears to be graphical.target for desktop OS and multi-user.target for server OS (RPiOS Lite). My understanding - and I'm not systemd expert either - is that default.target equates to the late(st) stage target depending on which OS it is running on. Does that make sense?
Yes, for me that make sense. I will try even with your config to see if any problems.
I can confirm that your solution is working too.