04-27-2010, 07:36 PM | #1 |
Connoisseur
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! Last edited by GregorRichards; 04-29-2010 at 07:58 AM. Reason: USB vs 3G |
04-27-2010, 07:38 PM | #2 |
Connoisseur
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.
|
Advert | |
|
04-27-2010, 08:49 PM | #3 |
Connoisseur
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 >_> |
04-27-2010, 09:13 PM | #4 |
Connoisseur
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 |
04-28-2010, 02:54 AM | #5 |
Connoisseur
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. |
Advert | |
|
04-28-2010, 05:14 AM | #6 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
I have the urge to say you this is really great!!!
I'll test this afternoon on my DR800S. Thanks for your work. |
04-28-2010, 05:35 AM | #7 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
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?
|
04-28-2010, 05:38 AM | #8 |
Lazy Git
Posts: 124
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.
|
04-28-2010, 06:40 AM | #9 | |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
You don't need any special hardware to make it run, except iRex USB cable (micro USB). |
|
04-28-2010, 09:33 AM | #10 |
Connoisseur
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. |
04-28-2010, 09:47 AM | #11 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
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.
|
04-28-2010, 09:52 AM | #12 |
Connoisseur
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) |
04-28-2010, 10:17 AM | #13 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
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. |
04-28-2010, 10:28 AM | #14 |
Connoisseur
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)
|
04-28-2010, 11:17 AM | #15 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
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 |
|
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 |