View Single Post
Old 03-13-2012, 08:16 PM   #1
jape
Member
jape began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Feb 2012
Device: none
Debugging the stop responding to touch problem

I decided to see if I could infer anything about the nature of the periodic problem my device has where it stops responding to touch, but still responds to home keypresses, so I wrote a script which would wait for a "long press" on the home key and then dump the results of evtest to a log.

It looks like the fault lies at the device driver layer, or the hardware itself, since evtest doesn't echo any touch events after the problem occurs. This suggests to me that this means that the problem is not in the reader app.

There's nothing interesting i see in dmesg, so unless someone has any other debugging ideas I'm stuck.

The script is below, in case it is useful to someone :
Code:
[root@kobo init.d]# cat watch-button.sh
#!/bin/sh

HOME_BUTTON=0066
BUTTON_PRESS=0001
BUTTON_RELEASE=0000

while [ true ]
do
    # read 16 bytes off the "keyboard" (one event)
    result=`od -x -N 16 /dev/input/event0`
    event=`echo $result | awk '{print $7}'`
    button=`echo $result | awk '{print $8}'`

    if [ $event == $HOME_BUTTON ]
    then
        if [ $button == $BUTTON_PRESS ]
        then
             button_down_time=`date +%s`
             echo "Home button pressed at $button_down_time"
        else
            if [ $button == $BUTTON_RELEASE ]
            then
               now=`date +%s`
               echo "Home button released $now"
               delta=`expr $now - $button_down_time`
               echo "delta is $delta"
               if [ $delta -gt 2 ]
               then
                    echo "Long press detected" > /etc/init.d/one.log
                    dmesg > /etc/init.d/two.dmesg
                    evtest /dev/input/event1 >> /etc/init.d/one.log
               fi
            fi
        fi
    fi

done
jape is offline   Reply With Quote