gpio-shutdown device tree overlay

edited January 14 in General

Hi
The gpio-shutdown overlay is included in the Emteria distribution but when enabled via config.txt it doesn't seem to work. Your help would be appreciated.
Best,
Manuel

Comments

  • How is it supposed to work? I don't think Android provides default handlers for RPi-specific events. If it can generate HID keys, you will probably need an own key layout file: https://source.android.com/devices/input/key-layout-files

  • How should I know what is supposed to work and what not? There is no documentation and I think it is rather normal to assume that the things that are included in a commercial distribution should also work...
    Anyway, I'm now using the gpio-key overlay. The kernel module this overlay depends on unfortunately doesn't get loaded automatically but is part of the distribution (to be found in /boot/modules/), so it can be inserted and afterwards the key events appear.

  • edited February 2018

    I didn't say you have to know what is working in emteria.OS and what is not. I was asking you about which functionality you expect from this overlay, since our platform may implement it in another (Android-specific, rather than Linux-specific) way. And if it doesn't yet, we will be glad to add it in our future releases.

    You can add your own shell script to load the module at boot time to /data/init.d. Take a look at existing scripts in that folder, the official documentation is coming soon.

  • Sorry, the intended functionality is as described in the documentation of the overlay: https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README

  • Hello kalkov. First i want to thank you and your Team for making Android on rpi3b possible.

    Will my experimental androided raspi shutdown automatically if i include the gpio-shutdown.dtbo with correct parameters into config.txt? My expectation is to shutdown emteria automatically by a fallijng Signal on a gpio pin.

    If Not: what to do to implement this?

    Thank you in advance for an answer!

  • As already mentioned just enabling the overlay won't do. You'll need to load the gpio-keys kernel module (to be found in /boot/modules/). As you can see in the dto it will simply send a KEY_POWER event. The keylayouts present on Emteria will map this to Android's KEYCODE_POWER. That's the very same event as generated by the power button of your android phone. So you'll also get the exactly same functionality: Short press will turn on/off the display while long press shows you the shutdown/reboot menu.

  • Hello Manuel,

    thank you for your Answer, very nice. Could you explain to me how to load the kernel module?

    Is there any Chance to replace KEYCODE_POWER by a direct shutdown command?

    I need a little bit of jump-start here. Would be very nice if you could do me this favor.

  • Could you explain to me how to load the kernel module?

    use insmod

    replace KEYCODE_POWER by a direct shutdown command

    I don't think this overlay is designed for doing something else than sending key codes. Did you think about writing your own module for that purpose? May be faster and easier than trying to adapt the existing one to something it wasn't originally designed for.

    I need a little bit of jump-start here.

    https://sites.google.com/a/mtu.edu/max-jin-home-page/hints/buildandloadakernelmoduleinandroidsystem/build-and-load-a-kernel-module-in-android-system

  • Thanks for providing this info, very helpful.
Sign In or Register to comment.