The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Debugging/debouncing GPIO buttons... (false triggers)
#1
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 Big Grin .
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 cases
  • GPIO enabled and all buttons enabled in moodeUI - it happens
  • GPIO enabled, disable just the "mpc toggle" button in moodeUI - it still happens  Angry
  • GPIO enabled in moodeUI, wires UNplugged - it doesn't happen
  • GPIO DISabled in moodeUI, wires plugged - it doesn't happen
I still can't explain why it toggles even when disabling the mpd toggle button. 
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
Code:
Nov 15 10:55:10  INFO [src/bin.rs:420] Capture finished
Nov 15 10:55:10  INFO [src/bin.rs:410] Playback finished
auth.log at the same time, the only line
Code:
Nov 15 10:55:10  moode sudo: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=33)
sys.log
Code:
Nov 15 10:55:10 moode kernel: [   47.723601] bcm2835_audio bcm2835_audio: failed to close VCHI service connection (status=1)
moode log shows nothing.
Am I missing other logs?

WIRING

GPIO -> momentary tactile switch -> ground
Buttons otherwise works fine.
  • 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?
thanks.
Pi4 1gb - Moode 8.3.9 / 9.1.4
Suptronics X6000 7.1ch HDMI hat
Reply


Messages In This Thread
Debugging/debouncing GPIO buttons... (false triggers) - by challenge - 11-15-2022, 01:56 PM

Forum Jump: