10-12-2013, 10:19 AM | #1 |
Connoisseur
Posts: 87
Karma: 2975
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
|
Automatic USB networking
WARNING: Not compatible with Recent Firmwares!!!!!!!!
Hello everyone, after some trial and error I put together a set of scripts for automatic USB networking. What is does: It installs a udev rule that starts up usb networking, a dhcp-daemon (included in busybox) and dropbear (from sergeys KoboLauncher) when you connect USB to a PC. The DHCP seems to be a bit flaky on Win7, so you might have to "repair" you connection if it doesn't give you an IP (range is 192.168.142.x) If you dismiss the connection dialog, USBnet stays connected. If you decide to go the mass storage way, it will shut off the usb networking and load the usb mass storage, just like normal. For this to work I had to patch the "usb"-script in /usr/local/Kobo/udev. This is the only really critical step in the automatic setup process, because it might break usb mass storage functionality if the patch goes wrong. Remedy #1 is to rename/remove /etc/udev/rules.d/usbnet.rules which basically disables the whole shebang. Remedy #2 is to ssh into the kobo and fix /usr/local/Kobo/udev/usb Remedy #3 is to do a factory reset If you disconnect the USB it will unload the network modules and stop dropbear and the dhcp-daemon so there shouldn't be any performance impact once disconnected. For SFTP access the binary is located in /usr/sbin To install, unpack KoboRoot.tgz from autousbnet.tar and copy it to .kobo as usual. Download from dropbox In theory this should work for all recent kobos (Mini/Touch (new and old)/Glo/Aura/AuraHD) but I could only test it with my KT N905B. As Always: This could potentially brick your device. If you're not ready to do a factory reset, don't use this!!! Confirmed working on: Touch (N905B) AuraHD Glo Regards Aydan PS: I forgot to mention that the IP of the Kobo is 192.168.142.1 Edit: Added dropbox folder for downloads Edit: v2 with alternate busybox binary for firmwares without native udhcpd support Last edited by Aydan; 06-09-2015 at 02:45 AM. |
10-12-2013, 12:40 PM | #2 |
ebook fan
Posts: 735
Karma: 2528718
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
|
Thanks!
I'll try it on Monday. |
10-12-2013, 01:32 PM | #3 | |
Connoisseur
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
|
Quote:
Thanks a lot, this is really usefull. I had to use this to install the driver under Windows 7 and had to force an IP on the interface, then it worked pretty well. Thanks again. P.S. The initial connection is a bit slow, so don't give up too soon :-) EDIT: Looks like my busybox doesn't have udhcpd applet, just udhcpc... I'am using an AuraHD with the latest firmware (2.8.1 15/07/2013) Last edited by met67; 10-12-2013 at 01:38 PM. |
|
10-12-2013, 01:35 PM | #4 | |
Connoisseur
Posts: 87
Karma: 2975
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
|
Quote:
|
|
10-12-2013, 01:53 PM | #5 |
Connoisseur
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
|
An AuraHD with latest firmware.
|
10-12-2013, 01:57 PM | #6 |
Connoisseur
Posts: 87
Karma: 2975
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
|
|
10-12-2013, 04:54 PM | #7 |
Connoisseur
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
|
|
10-12-2013, 04:58 PM | #8 |
Connoisseur
Posts: 87
Karma: 2975
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
|
It might be possible to get around the dchp problem by replacing the busybox. But for that I'd need to know the version and ABI (armhf or armel) and I'd have to make it device or version specific.
|
10-13-2013, 03:09 AM | #9 |
Connoisseur
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
|
I'm thinking of replacing the link from udhcpd to busybox with a copy of busybox from an old firmware; which version of firmware do you use?
EDIT: I managed to make it work by using the busybox that came with fw 2.5.1. I copied it in /bin as busyboxold, than made a link from udhcpd to busyboxold and it worked fine! Last edited by met67; 10-13-2013 at 04:35 AM. |
10-13-2013, 05:01 AM | #10 |
Connoisseur
Posts: 87
Karma: 2975
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
|
I'm using FW2.5.2.
could you give me the output of Code:
busybox | grep udhcpd Code:
busybox | grep -c udhcpd If that is so I can make use of the old binary conditional. Regards Aydan |
10-13-2013, 05:40 AM | #11 | |
Connoisseur
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
|
Quote:
AW I don't think it is worth the effort using a conditional: udhcpd is gone in 2.6.1, and in 2.8.1 and probably will never be back in future firmwares, and by using an old binary with a known working udhcpd you don't risk any problem with other functionalities and still have to waste space for the old binary. |
|
10-13-2013, 06:46 AM | #12 |
Connoisseur
Posts: 87
Karma: 2975
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
|
I went ahead and added the alternate binary to version 2. the binary will be removed if the original busybox supports udhcpd
Last edited by Aydan; 10-13-2013 at 08:03 AM. Reason: typo |
10-13-2013, 09:38 AM | #13 |
Connoisseur
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
|
|
10-13-2013, 11:51 AM | #14 |
Connoisseur
Posts: 87
Karma: 2975
Join Date: Jan 2012
Location: Germany
Device: Kobo Touch
|
I'm removing the binary with udhcpd, not the one that came with the firmware.
In fact I'm not touching anything that came with the firmware. So there shouldn't be any problems with upgrading. If you mean that an upgrade might remove udhcpd from the busybox that comes with the firmware, then you'll have to reinstall the autousbnet hack afterwards. I just want to keep the memory usage as little as possible, and running two busybox binaries when one would be enough just uses memory without need. Last edited by Aydan; 10-13-2013 at 11:54 AM. |
10-13-2013, 12:16 PM | #15 |
Connoisseur
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I enable usb networking? | wallacemckart | Kindle Developer's Corner | 15 | 11-01-2013 06:38 AM |
Internet over USB networking | fry@pocketbook | Kindle Developer's Corner | 19 | 05-28-2013 10:31 PM |
Setup USB Networking K3 | nathansuchy | Kindle Developer's Corner | 3 | 11-14-2012 03:37 PM |
USB Networking on Mac OS? | DairyKnight | Kindle Developer's Corner | 19 | 07-02-2012 04:19 PM |
Firmware Update USB networking for 2.5? | dd_engi | Amazon Kindle | 9 | 05-09-2010 06:45 AM |