• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Android » Android forum » Power button on beagleboard with Android 2.3.4
Share
Android
  • Forum
Options
  • Subscribe via RSS

Power button on beagleboard with Android 2.3.4

Power button on beagleboard with Android 2.3.4

This question is not answered
steve won86774
Posted by steve won86774
on Mar 13 2012 04:59 AM
Prodigy150 points

Hi,

I would like to generate a keyboard event on Android 2.3.4 and Beagleboard, especialy the power button. I have tried to emulate this with adb, with this command:

adb shell input keyevent 26

Here it is the list of the different events:

http://www.kandroid.org/online-pdk/guide/keymaps_keyboard_input.html

It does not work for me, I have this log:

D/AndroidRuntime( 1951):
D/AndroidRuntime( 1951): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 1951): CheckJNI is ON
D/dalvikvm( 1951): creating instr width table
D/AndroidRuntime( 1951): Calling main entry com.android.commands.input.Input
I/SendKeyEvent( 1951): 26
D/AndroidRuntime( 1951): Shutting down VM
D/dalvikvm( 1951): GC_CONCURRENT freed 98K, 72% free 289K/1024K, external 0K/0K, paused 0ms+1ms
I/AndroidRuntime( 1951): NOTE: attach of thread 'Binder Thread #2' failed
D/jdwp ( 1951): adbd disconnected
However, I have the event enabled in the file android_rootfs/system/usr/keylayout/qwerty.kl:
key 115   VOLUME_UP         WAKE
key 114 VOLUME_DOWN WAKE
key 116 POWER WAKE
Nevertheless, events like VOLUME_UP or VOLUME_DOWN  works well.
I have tested this command with an Android emulator and it works.
Do someone have already done this before and could help me how can I do this? 
BR,
Steve.
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Satish Patel
    Posted by Satish Patel
    on Mar 13 2012 08:32 AM
    Expert4350 points

    Hi Steve,

    This might help you.

    http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides#How_to_designate_a_POWER_key

     

    BR,

    satish

    Kindly click the verify answer button on this post if it answer your question.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • steve won86774
    Posted by steve won86774
    on Mar 15 2012 03:51 AM
    Prodigy150 points

    Hi,

    I've followed instructions from here:

    http://e2e.ti.com/support/embedded/android/f/509/t/171383.aspx

     

    I've modified the struct  gpio_buttons in the file kernel/arch/arm/mach-omap2/board-omap3beagle.c to add the right code event (116=KEY_POWER), also change the gpio because there is an error into this struct, on beagleboard xm the user button is wired to gpio_4 and not gpio_7.

    So now when I do a "long press", about 2/3 seconds, a menu appears with different items, like silent mode, airplane mode and power off. 

    If I launch a getevent on the shell, I have it:

    # getevent
    getevent
    add device 1: /dev/input/event3
    name: "DELL Dell USB Entry Keyboard"
    add device 2: /dev/input/event2
    name: "Logitech USB Optical Mouse"
    could not get driver version for /dev/input/mouse0, Not a typewriter
    could not get driver version for /dev/input/mice, Not a typewriter
    add device 3: /dev/input/event0
    name: "gpio-keys"
    add device 4: /dev/input/event1
    name: "twl4030_pwrbutton"
    /dev/input/event0: 0001 0074 00000001
    /dev/input/event0: 0000 0000 00000000
    /dev/input/event0: 0001 0074 00000000
    /dev/input/event0: 0000 0000 00000000

    Ok so the event is well send by the kernel, with 0074 = 116 = KEY_POWER.

    But on the Android side I have this log:

    W/KeyCharacterMap( 1088): Can't open keycharmap file
    W/KeyCharacterMap( 1088): Error loading keycharmap file '/system/usr/keychars/gpio-keys.kcm.bin'. hw
    .keyboards.65538.devname='gpio-keys'
    W/KeyCharacterMap( 1088): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
    
    

    This file is not present, but the default qwerty works for this event.

    Ok, so it works, but it miss something!

    In deed, my concern is not this behaviour but more putting the screen off. If I do a short push on this button, the screen should go off, but there is nothing that happend...

    The event is however well sent by the kernel but it seems that the Android layer drop this event. I don't know the Android framework, there's should be somewhere a method that count the time between the press button event and release button event.

    Someone could help me to find how to put the screen off when I press this button?

    BR,

    Steve.


    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • RajeeSankar
    Posted by RajeeSankar
    on Apr 18 2012 05:31 AM
    Prodigy240 points

    Hi Steve,

    We are also facing the same issue.

    Long press is powering off the system.We need short press to dim LCD.

    Any help?

    Regards,

    RajeeSankar

    am3517 gingerbread LCD power button
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Arun Joseph
    Posted by Arun Joseph
    on Apr 18 2012 07:49 AM
    Intellectual2260 points

    Hi Steve/RajeeSankar,

    Now you have your gpio key sending KEY_POWER and android recognizes the event from qwerty.kl, so it works well.

    Now to enable suspend-resume we need to enable power management via

    1. Replace the line "setprop hw.nopm true" with "setprop hw.nopm false" init.rc.
    2. Uncheck  Settings-> Applications-> Development-> Stay awake

    There are some more steps to be done from kernel to support suspend-resume for Beagleboard. Please pick the relevant patches from http://groups.google.com/group/rowboat/browse_thread/thread/1a950d7ae3b1f339#

    We will push these patches to gitorious.org/rowboat soon.

    Regards,

    Arun

    If this post answers your query, consider clicking the Verify Answer button.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use