View Single Post
Old 06-26-2012, 03:37 PM   #1
tonyv
Member
tonyv began at the beginning.
 
Posts: 12
Karma: 20
Join Date: Oct 2009
Device: elonex eb600
Hacking Kobo Touch suspend usb network eink driver

Hi
Usb networking i have got it to work at boot using 19.16 and 19.17
having it work at boot will mean you can't have it in usb mass storage mode
prob workaround hacking /usr/local/Kobo/udev/usb which seems to be invoked by nickel
when you press connect on popup
Howto
get wifi telnet access using this guide
http://wiki.mobileread.com/wiki/Kobo_Touch_Hacking

manually on kobo
before plugging in
>killall nickel
can restart with http://pastebin.com/gEuQpaU5
>/bin/busybox insmod /drivers/ntx508/usb/gadget/arcotg_udc.ko
>/bin/busybox insmod /drivers/ntx508/usb/gadget/g_ether.ko
plugin don't connect through nickel (main app)
>ifconfig usb0 192.168.2.2
on pc
>lsusb
should get Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget
if so then
>ifconfig usb0 192.168.2.1
>telnet 192.168.2.2

Automatic at boot:

on kobo ( prob easiest to edit on pc and ftp back to kobo i use Gftp on ubuntu)
>killall nickel
can restart with http://pastebin.com/gEuQpaU5
put these command at end of /etc/init.d/
/bin/busybox insmod /drivers/ntx508/usb/gadget/arcotg_udc.ko
/bin/busybox insmod /drivers/ntx508/usb/gadget/g_ether.ko

put these at end of /usr/local/Kobo/udev/ac and /usr/local/Kobo/udev/plug
ifconfig usb0 192.168.2.2
prob don't need to put in both but i'm to lazy to check
>reboot
after main gui Ithink it doesn't matter) plug into pc
ignore popup
On pc
>ifconfig usb0 192.168.2.1


I think i have worked out suspend
echo 1 > /sys/power/state-extended //turns of neonode touchscreen
echo mem > /sys/power/
then after resume
echo 0 /sys/power/state-extended
found this file after looking at strace of nickel
open("/sys/power/state-extended", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
dup2(3, 1) //copy filehandle
write(1, "1\n", 2) = 2
execve("/bin/sh", ["sh", "-c", "echo mem > /sys/power/state"]

from kobolabs source /KoboLabs/hw/imx508/cls/linux-2.6.35.3/kernel/power/main.c

static ssize_t state_extended_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t n)
{
if ( buf[0] == '1' )
{
if(!g_sys_full_suspend_state)
{
neonode_activate(0); disable_irq_wake(get_homekey_irq());

g_sys_full_suspend_state=1;
}
}else if(g_sys_full_suspend_state)
{
neonode_activate(1);
enable_irq_wake(get_homekey_irq());
g_sys_full_suspend_state=0;
}

I have tried the above with wifi off and unplugged it seems to work but have not fully tested by looking at battery level after awhile.
Eink stuff next post.
Cheers
Tony

Last edited by tonyv; 06-29-2012 at 11:47 AM.
tonyv is offline   Reply With Quote