Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
Old 04-27-2010, 07:36 PM   #1
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
usbnet (USB networking to make development easier) for DR800

(I think this should be posted here and not in the development forum, as this is a complete, working program ... but then, it's pretty developer-centric, so Idonno)

I wanted to make development easier by enabling myself to SSH into the DR800SG and actually have stdout and stderr, and a console. It took an annoying amount of hackery to make it work, so I packaged it up to make it easier for anyone else. The attached binary includes the g_ether gadget ethernet USB driver, and convenience scripts to run them and an SSH server.

A brief howto:

Extract to your SD card. Connect your DR800 and then "eject" it such that it disconnects from the file storage USB connection. Run the app (Programs/usbnet), and it will load the USB ethernet driver, configure itself as 192.168.200.2, and start up the dropbear SSH server. Configure your host to use any other IP on the 192.168.200 subnet, e.g. 192.168.200.1. More info on how to configure the host (Linux only): http://www.handhelds.org/moin/moin.cgi/UsbNet

To disconnect, exit from the shell presented on the DR800's screen.

In order to SSH in, you will need to configure a root password; by default root has no password, and as such cannot be logged into via SSH, even with keys. You can configure its password on the shell presented on the DR800.

To use scp, you will need to put it in your default $PATH, e.g.:
ln -s /media/mmcblk0p1/Programs/_usbnet/bin/scp /usr/bin/

Before running normal apps, you may need/want to disable the onscreen keyboard which is presented by rxvt. You can do this with erkeyman:
/media/mmcblk0p1/Programs/_usbnet/bin/erkeyman off

A note: USB networking and 3G networking are not friends. I found that I have to reboot the system after connecting to usbnet in order to connect to 3G. This is probably (in fact, almost certainly) a problem I caused, so I'll look into fixing it, but for the moment just keep in mind that you'll have to reboot.

I hope other devs benefit from this. Enjoy!
Attached Files
File Type: zip usbnet-0.1.zip (389.4 KB, 371 views)
File Type: bz2 usbnet-0.1-source.tar.bz2 (6.0 KB, 292 views)

Last edited by GregorRichards; 04-29-2010 at 07:58 AM. Reason: USB vs 3G
GregorRichards is offline   Reply With Quote
Old 04-27-2010, 07:38 PM   #2
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
PS: It would be awesome if anybody could check if this works on the DR800S or DR1000*, or with the pre-2.0 firmware.
GregorRichards is offline   Reply With Quote
Old 04-27-2010, 08:49 PM   #3
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
Another use I discovered for this is to run an X server on the host and connect to it from the iRex. This effectively isolates slowdown from the processing speed from display slowdown, so you can figure out what problems are where. To do this, on the host:

Xephyr :1 -ac -screen 1024x768 -host-cursor

Then on the guest:

DISPLAY=192.168.200.1:1 run-parts /etc/X11/Xsession.d/

It's kinda funny seeing this GUI on my desktop :P. Also, argh, getting screen updates done efficiently and at the right time is really tough >_>
GregorRichards is offline   Reply With Quote
Old 04-27-2010, 09:13 PM   #4
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
*continues epic monologue*

Note however that my X11 forwarding trick will totally baffle the daemon that handles screen refreshes, so the device will be near-unusable after you've done that 'til you reboot it. Still quite worth it, it's not like rebooting the device is the end of the world
GregorRichards is offline   Reply With Quote
Old 04-28-2010, 02:54 AM   #5
kapoira
Connoisseur
kapoira has a complete set of Star Wars action figures.kapoira has a complete set of Star Wars action figures.kapoira has a complete set of Star Wars action figures.
 
Posts: 81
Karma: 292
Join Date: Nov 2006
Device: i62HD + T68
Can you do the reverse way?

to put a aplication of X in the iliad, many thanks in advance.
kapoira is offline   Reply With Quote
Old 04-28-2010, 05:14 AM   #6
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 711
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
I have the urge to say you this is really great!!!
I'll test this afternoon on my DR800S.

Thanks for your work.
Iņigo is offline   Reply With Quote
Old 04-28-2010, 05:35 AM   #7
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
I pretty much have no idea what this is about. But would it be possible to use some kind of a usb hack and browse the Internet this way via midori browser on DR1000S?
owl123 is offline   Reply With Quote
Old 04-28-2010, 05:38 AM   #8
Jumpn Jack Flash
Lazy Git
Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.Jumpn Jack Flash is no ebook tyro.
 
Posts: 125
Karma: 1266
Join Date: Jun 2009
Location: The soggy Emerald Isle
Device: iRex DR800S
Just to be clear ( I ain't had my morning mug of tea yet nd the brain is not up to speed yet ) is this a USB ethernet device pluged into the micro USB port or is a virtual ethetnet device modloaded by the usbnet ko.
Jumpn Jack Flash is offline   Reply With Quote
Old 04-28-2010, 06:40 AM   #9
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 711
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
Quote:
Originally Posted by Jumpn Jack Flash View Post
Just to be clear ( I ain't had my morning mug of tea yet nd the brain is not up to speed yet ) is this a USB ethernet device pluged into the micro USB port or is a virtual ethetnet device modloaded by the usbnet ko.
Roughly (and if I'm not wrong) it's ethernet over USB.
You don't need any special hardware to make it run, except iRex USB cable (micro USB).
Iņigo is offline   Reply With Quote
Old 04-28-2010, 09:33 AM   #10
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
owl123: With further hackery I don't see why not, but it would be awfully pointless since you'd have to be right next to an Internet-enabled computer to do it ...

Jumpn Jack Flash: It turns your DR into a virtual ethernet device, such that you can load the relevant driver on the host and talk to the DR over a network.
GregorRichards is offline   Reply With Quote
Old 04-28-2010, 09:47 AM   #11
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
Quote:
Originally Posted by GregorRichards View Post
owl123: With further hackery I don't see why not, but it would be awfully pointless since you'd have to be right next to an Internet-enabled computer to do it ...
Still it'd be a nice thing to have. Especially for everyone who has a lot to read and a 3m+ long USB cable like me.
owl123 is offline   Reply With Quote
Old 04-28-2010, 09:52 AM   #12
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
Fair enough. Basically what you'd have to do is configure your host to do IP forwarding (honestly I don't know how this is done on any modern system ... ), then on the DR:

route add default gw 192.168.200.1
echo 'nameserver <some nameserver>' > /etc/resolv.conf

You could put those two parts in the usbnet2 script to avoid rewriting them.

(Haven't tested this, YMMV)
GregorRichards is offline   Reply With Quote
Old 04-28-2010, 10:17 AM   #13
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
There are some errors when I run it on my DR1000:

FATAL: Module g_ether not found
killall: NetworkManager: no process killed
killall: nm-system-settings: no process killed
Segmentation fault

Thanks Gregor for help but I guess I'll have to wait for someone who could make it work on DR1000 as I don't have any programming knowledge myself.

Last edited by owl123; 04-28-2010 at 10:19 AM.
owl123 is offline   Reply With Quote
Old 04-28-2010, 10:28 AM   #14
GregorRichards
Connoisseur
GregorRichards doesn't litterGregorRichards doesn't litter
 
Posts: 60
Karma: 151
Join Date: Apr 2010
Device: DR800SG
The first errors are irrelevant. The segmentation fault is ... confusing. Requires further thought, I'll get back to you if I figure something out (which unfortunately is unlikely since I don't have the same device)
GregorRichards is offline   Reply With Quote
Old 04-28-2010, 11:17 AM   #15
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 711
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
Fabulous!!!

It works perfectly with my DR800S.

More info on how to configure the PC part (linux only): http://www.handhelds.org/moin/moin.cgi/UsbNet

Simple instructions to make it work in my Fedora 12 x86_64, as root:
# modprobe usbnet
# ifconfig usb0 192.168.x.y
Iņigo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Networking on Mac OS? DairyKnight Kindle Developer's Corner 19 07-02-2012 04:19 PM
DR800 DR800+ development discussion Iņigo iRex Developer's Corner 78 12-18-2010 07:38 PM
Hacks Kindle 3 USB Networking n10 Amazon Kindle 2 10-11-2010 09:29 PM
DR800 Plugin development for DR800/DR1000 yuri_b iRex Developer's Corner 0 09-18-2010 09:46 AM
Firmware Update USB networking for 2.5? dd_engi Amazon Kindle 9 05-09-2010 06:45 AM


All times are GMT -4. The time now is 07:53 PM.


MobileRead.com is a privately owned, operated and funded community.