Shutdown Raspberry via GPIO
I'd like to shut down my Raspberry Pi 3 via a Button connected to a GPIO.
Therefore i connected a button and wrote a script like in the link below (i used the while loop as in listing 2).
This works perfectly as long as i don't connect the printer (megatronic board) to the USB-port. When the printer is connected, the pi shuts down randomly after 0 to 60 sec just like as if the button is pressed. When i stop the python script the printer works fine.
I tried everything i could imagine to fix this. I used different GPIO pins, tried internal and external pullups and i checked the wiring often.
So the button works fine and the printer works fine but i can't use them at the same time.
Is the connection to the printer messing with the GPIOs?
I'm using 0.80.3 and the latest raspbian jessie by the way.