11-15-2022, 03:02 PM
(11-15-2022, 01:56 PM)challenge Wrote: Hello, I've got a few momentary switches wired in, to try the GPIO config feature.
I randomly get a false trigger when I switch on my amps. The moment I press the amp switch, moode toggles between pause/play.
Even without dac, nothing connected on the pi apart from GPIOs buttons.
It doesn't happen everytime. But it is 100% caused by switching on the amps (tried 3 amps, A, AB and a class D and all are affected).
I was going crazy to figure it out, and unplugged everything (no dac, no HATs, no IR) but the gpios, and that did it.
Since there are no wires around, the only options are either ghosts or wires are picking it somehow (EMI, mains voltage drop,?).
It happens like one time out of ten.
It happens both when switching on and also when turning the amp off. It's kind of random.
The weird thing is that it randomly happens even from an amp 1.5m away.
Just by turning it on and off a few times it toggles the pi.
Tried to power the pi from a different power plug (as usually it's all plugged to the same powerstrip), and it still happens.
UI settings/wires casesI still can't explain why it toggles even when disabling the mpd toggle button.
- GPIO enabled and all buttons enabled in moodeUI - it happens
- GPIO enabled, disable just the "mpc toggle" button in moodeUI - it still happens
![]()
- GPIO enabled in moodeUI, wires UNplugged - it doesn't happen
- GPIO DISabled in moodeUI, wires plugged - it doesn't happen
I have other buttons configured like next, prev, stop, vol+-, etc but that's all it's doing, toggling even when the toggle is disabled...
either have to unplug the wires or totally disable the GPIO script for it to not happen. (or I am going insane after hundred attemps, very possible)
DEBUG/LOGS
As far as debugging, I also tried pigpio's monitor.py hoping to see which gpio was triggered and nothing shows up when the event happens.
I remember there were other tools, like "scope" something in the name, to debug the gpios, will google more later.
Tried the logs (moode, mpd, system, triggerhappy etc), can't find what's pausing it.
mpd.log
auth.log at the same time, the only lineCode:Nov 15 10:55:10 INFO [src/bin.rs:420] Capture finished
Nov 15 10:55:10 INFO [src/bin.rs:410] Playback finished
sys.logCode:Nov 15 10:55:10 moode sudo: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=33)
moode log shows nothing.Code:Nov 15 10:55:10 moode kernel: [ 47.723601] bcm2835_audio bcm2835_audio: failed to close VCHI service connection (status=1)
Am I missing other logs?
WIRING
GPIO -> momentary tactile switch -> ground
Buttons otherwise works fine.
thanks.
- Do you have any idea about how to proceed debugging this?
- or how to debounce? the debounce setting in the UI seems only for ignoring double clicks, or I am reading the note wrong?
- should I try shielding the wires?
- could I try running the gpio python script from cli and see if it outputs something?
it really looks like a spike... and that being due to the connections between the amps and the pi (the only connection among them that I can possibly think is the signal cables... the rca's...
Can you make another run, with just everything plugged in, but the cables from the DAC (if it is a HAT, I mean) to the AMP disconnected?
I'm by no means en expert, but I see no other path... apart from being caused by a voltage drop; and this could explain why, unplugging everything power-hungy did the trick...
Cheers, Al.