pwnagotchi icon indicating copy to clipboard operation
pwnagotchi copied to clipboard

gpio buttons

Open lazee486 opened this issue 5 years ago • 5 comments

original Tamagotchi had buttons to interact, I'd like to be able to interact more and add features.

using gpio for buttons to run scripts - shutdown sleep (low power eg screen off but still working or slow refresh) run a specific attack like pixie dust. proximity sensor screen off view currently stored messages on screen

lazee486 avatar Oct 29 '19 06:10 lazee486

There's already a GPIO plugin. Have a look at https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/defaults.yml ;-)

lexusburn avatar Oct 29 '19 21:10 lexusburn

found it after i posted, thanks for not yelling rtfm lol, ive been reading nonstop and making progress:)

On Tue, Oct 29, 2019 at 11:12 PM lexusburn [email protected] wrote:

There's already a GPIO plugin. Have a look at https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/defaults.yml ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evilsocket/pwnagotchi/issues/458?email_source=notifications&email_token=AKLEA5DOQOFBLOSIOEHTYH3QRCRNJA5CNFSM4JGD6JOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECSDFOI#issuecomment-547631801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLEA5GFYZAKSSRSDQ3PCUDQRCRNJANCNFSM4JGD6JOA .

-- [image: photo] Michael Moloney Technician, ImplyIT

087 353 6576 | [email protected]

www.ImplyIT.co.za Create your own email signature https://www.wisestamp.com/signature-in-email?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own

lazee486 avatar Oct 30 '19 09:10 lazee486

FYI, https://www.instructables.com/id/Simple-Raspberry-Pi-Shutdown-Button/ works great; header pin 5, in the script use "gpio_pin_number=3" and 4 seconds of push will shut the system down gracefully. if you don't remove power, pushing the button again will restart the system.

Now all we need is a "shutdown" image for the ePaper displays so that we know it's officially on the shutdown path.

akhepcat avatar Nov 07 '19 20:11 akhepcat

@lazee486 can you close this issue?

xenDE avatar Nov 20 '19 20:11 xenDE

Total novice here. So if I got this right I would have to edit this part of the gpio_buttons.py file like this:

` def on_loaded(self): logging.info("GPIO Button plugin loaded.")

    # get list of GPIOs and associated commands
    gpios = {
        X: "command1",    # X = GPIO pin number, "command" = command for the button press
        X: "command2",
        X: "command3",
        X: "command4"
    }`

and then set the "main.plugins.gpio_buttons.enabled = true" in the config.toml file or is it just to simple to be true?

I'm trying to make this work on my Pwnagotchi running on a Pi Zero W with a Waveshare 1.44 LCD Hat SPI Display with 3 buttons and a joystick (https://www.waveshare.com/wiki/1.44inch_LCD_HAT).

scrypthekid avatar Mar 19 '23 02:03 scrypthekid