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

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2011, 03:54 PM   #1
kakapo
The Night Parrot
kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.
 
kakapo's Avatar
 
Posts: 22
Karma: 105390
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
Question usbNetwork connection hangs after 30 seconds

I've installed Yifan Lu's jailbreak (update_jailbreak_0.5.1_k3w_install.bin) and the usbNetwork update (update_usbnetwork_0.35.N_k3w_install.bin) on my Wifi Kindle 3. After unmounting the kindle from usb drive mode, i connect to it with this command:
Code:
sudo ifconfig usb0 192.168.2.1 && telnet 192.168.2.2
After about 30 seconds (regardless of whether i'm typing or not), the connection hangs and i have to run "sudo ifconfig usb0 down" and bring it back up to get in. I'm running Ubuntu 11.04 on my PC.

Does anyone have any ideas about what is wrong?

(My kindle isn't registered and Wifi is off, if that makes a difference.)
kakapo is offline   Reply With Quote
Old 11-21-2011, 03:56 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,905
Karma: 4492229
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
Connect over ssh instead of telnet (or stop/tweak the power management stuff).
NiLuJe is offline   Reply With Quote
Old 11-21-2011, 04:01 PM   #3
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,069
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
@kakapo: My usbnet connections do that too after about 30 seconds, and sometimes again after 5 or 10 minutes.

I think it is mentioned elsewhere in this forum (or in a hack readme file) that there are a couple of background daemon processes that need to be killed in the kindle to stop these usbnet disconnects.

For now, I keep a second window open and run my 'mntusb' script to resume the usbnet connections for all of my usb-attached kindles. That script can be downloaded here:
http://www.mobileread.com/forums/sho...3&postcount=29

Can anybody list which processes should be killed to prevent this? They should probably be killed in the usbnet startup script...

@NiLuge: You beat me! I was composing my answer before yours arrived. For some reason, my DXG is *extrememly* slow connecting with SSH, but instant with telnet, so when I am in a hurry I just telnet in...

;-)

Last edited by geekmaster; 11-21-2011 at 04:04 PM.
geekmaster is offline   Reply With Quote
Old 11-21-2011, 05:43 PM   #4
ryran
Connoisseur
ryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with others
 
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
I've always used ssh over usb and I've never had the problems you describe geekmaster. I can't imagine what processes you're talking about. Speaking for me and my K3G, it never goes into sleep when connected to usb. (I've never had usb or ssh disconnect.)
ryran is offline   Reply With Quote
Old 11-21-2011, 05:52 PM   #5
kakapo
The Night Parrot
kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.
 
kakapo's Avatar
 
Posts: 22
Karma: 105390
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
@NiLuJe: connecting via ssh does the same thing.

@geekmaster: i tried killing both the powerd and pmon processes but it's still hanging. I could post the output of ps if that would help.
kakapo is offline   Reply With Quote
Old 11-21-2011, 07:21 PM   #6
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,069
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
@kakapo: I have the same problem. I was wondering if the problem is on the host computer side, because the connection still shows in ifconfig, but reverts to the default values for IPv4 and HWaddr.

I keep multiple kindles connected so I can test my code on different models. I have had to reassign their IPv4 and HWaddr so many times I decided to write the 'mntusb' script mentioned earlier (and posted in the "Hacks / Mods" sticky forum).

One possible clue -- some kindles disconnect more frequently than others. Perhaps there is a problem with the periodic "Plug&Play" usb device polling messing up the usbnet connection...

Last edited by geekmaster; 11-22-2011 at 10:07 AM.
geekmaster is offline   Reply With Quote
Old 11-21-2011, 11:02 PM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,905
Karma: 4492229
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@kakapo: it shouldn't (over USB, at least. There might indeed be some trickery needed over WiFi). You might want to check dmesg & co, and/or check that the issue isn't on your host's side (putting the hub in low-power/suspend mode, or that kind of crap. Might want to try a vanilla kernel to make sure it's not doing something funny with the USB stack (but that might just be my inner gentoo nerd sneering over ubuntu ^^).

@geekmaster: Yes, the key exchange process suffers from some performance problems in dropbear since the latest version when libtommath was updated. It's already slightly annoying on a K3, so it must be worse on the slower CPU of the DXG . I might end up trying a full OpenSSH setup, since I'm already building it for the sftp server, and we aren't really *that* concerned over storage/memory usage anyway.

Last edited by NiLuJe; 11-21-2011 at 11:18 PM.
NiLuJe is offline   Reply With Quote
Old 11-22-2011, 05:40 AM   #8
idollar
Junior Member
idollar can extract oil from cheeseidollar can extract oil from cheeseidollar can extract oil from cheeseidollar can extract oil from cheeseidollar can extract oil from cheeseidollar can extract oil from cheeseidollar can extract oil from cheeseidollar can extract oil from cheeseidollar can extract oil from cheese
 
Posts: 4
Karma: 1126
Join Date: Nov 2011
Device: kindle
check the DHCP in your computer (not the kindle)

Hello,

I had the same problem when connecting from my ubuntu.

I was trying to connect with GNOME launched. The network application recognises the USB0 net interface and tries to resolve the IP address using DHCP. As the kindle does not have a DHCP server, the discovery fails and the
interface in the computer is set to the defaut IP address.

Try the following sequence to confirm that you are suffering from a similar problem:

1.- Connect the kindle and launch usbnet hack
2.- Set the ip address in your computer (as you did)
3.- @ the computer, start a session pinging the kindle
4.- Telnet (as you did)
5.- Wait for the system to drop the connection -- wait 30 sec
You will see the ping failing
you may check that you lost the computer IP address by typing
ifconfig usb0
and checking the output
6.- Set the ip address once more as in step 2.- above
The ping shall work again
Your telnet session will be recovered (if you were fast enough with
the step 6)

If the cause for the failure is confirmed, you may change the step 2.- with a permanent configuration in the network manager of your computer.

I hope that this helps.

Cheers

i$
idollar is offline   Reply With Quote
Old 11-22-2011, 10:14 AM   #9
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,069
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by idollar View Post
...
If the cause for the failure is confirmed, you may change the step 2.- with a permanent configuration in the network manager of your computer.
$
I keep multiple kindles plugged in to my Ubuntu box, for software testing.

How can I make a "permanent configuration" when all kindles start out with the same HWaddr, even if it is already in use by another kindle?

I think that this would be best fixed by changing usbnet to provide a DHCP address to the host. The kindle DHCP "server" only needs to serve one address (the host IP defined in /mnt/us/usbnet/etc/config).

Adding a DHCP server to usbnet may be complicated by a possible problem when running dropbear on a DHCP server: http://groups.google.com/group/linux...611eb43e53b6b2

Last edited by geekmaster; 11-22-2011 at 10:20 AM.
geekmaster is offline   Reply With Quote
Old 11-22-2011, 02:37 PM   #10
ryran
Connoisseur
ryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with others
 
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
Lightbulb

idollar's got a good point. If you're using a distro with NM, you DEFINITELY need to give IT some love before you go messing around with ifconfig. I'm surprised more people haven't posted about this issue, actually... For normal people with one kindle, all you have to do is configure the kindle in NetworkManager to have a static address. As a plus, then you won't have to mess with ifconfig anymore.

For geekmaster:
When you initially plug one of the kindles into your ubuntu box (without using your special script), nm-applet starts flashing or morphing or rotating (in this case, showing that it's trying to negotiate dhcp), right? If so, the following might come in handy for you.. you could add it to the little script you've got going on. It tells NM to stop managing that interface and then you'll be free to do your own magic with ip or ifconfig or whatever.

Code:
for USB in $(nmcli dev | awk '/usb.*connecting/{print$1}'); do
    nmcli dev disconnect iface $USB
done
PS: Don't need to be root for that.
PPS: To be clear, nmcli dev disconnect only tells NM to stop messing with your if.. until the next time the device is unplugged and plugged back in.

Last edited by ryran; 11-22-2011 at 02:44 PM. Reason: Made code simpler
ryran is offline   Reply With Quote
Old 11-22-2011, 04:20 PM   #11
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,069
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
I did not notice an NM icon.

When the usbnet drops, I noticed that the IPv4 address goes away, and the HWaddress last octet changes to 09.

Thanks for the nmcli tip -- I will probably add that to my 'mntusb' script at some point.

@NiLuje: Here is a little script I use, that you may want to stick in the usbnet hack bin folder:
-----
#!/bin/sh
### toor - find root password
echo fiona$(grep Serial /proc/cpuinfo|cut -b 12-27|md5sum|cut -b 8-10)
-----

Last edited by geekmaster; 03-13-2013 at 08:33 PM.
geekmaster is offline   Reply With Quote
Old 11-22-2011, 07:42 PM   #12
kakapo
The Night Parrot
kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.kakapo shapes the world with his or her thoughts.
 
kakapo's Avatar
 
Posts: 22
Karma: 105390
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
@idollar: That is exactly what is causing my problems. Thanks enormously!

@ryran: The Wifi "searching" icon did appear briefly in my panel, but i didn't realise that it was meaning the USB network.

For anyone else having problems with their usbNetwork crashing, hanging, locking up, etc and is running Ubuntu or another GNOME based Linux distro, the solution is to configure it via Network Manager instead of ifconfig. Set for manual configuration (instead of DHCP), the address to 192.168.2.1, netmask to 255.255.255.0 and gateway to 0.0.0.0. Leave the DNS settings blank.
kakapo is offline   Reply With Quote
Old 11-22-2011, 08:33 PM   #13
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,069
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by ryran View Post
"...you could add it to the little script you've got going on. It tells NM to stop managing that interface and then you'll be free to do your own magic with ip or ifconfig or whatever."
Done:
http://www.mobileread.com/forums/sho...3&postcount=29 (link fixed 2011 Nov 23)

Thanks ryran.

Last edited by geekmaster; 11-23-2011 at 12:11 PM.
geekmaster is offline   Reply With Quote
Old 11-23-2011, 11:54 AM   #14
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,069
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
One of my kindles has been "usbnet" connected for many hours without a glitch since I added ryran's code snippet to my 'mntusb' script. Now I only need to run mntusb when I connect another kindle. Adding a kindle does not mess with existing usbnet connections for other kindles. I no longer need to keep an extra terminal window open just to run mntusb whenever the usbnet connections drop. This is one less annoyance to deal with. Thanks...

Last edited by geekmaster; 11-23-2011 at 12:00 PM.
geekmaster is offline   Reply With Quote
Old 11-24-2011, 06:45 AM   #15
ryran
Connoisseur
ryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with others
 
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
You're welcome!
ryran 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
usbNetwork to teather active Wifi connection? CaelThunderwing Kindle Developer's Corner 2 08-25-2011 02:17 AM
3.1 usbNetwork: Connection Refused ahonamous Kindle Developer's Corner 5 05-21-2011 02:24 AM
Waterstones sells an ebook every 90 seconds! sibelhodge News 12 12-23-2009 03:27 AM
Wireless internet connection frustrating IDS connection Socrates iRex 8 10-21-2009 12:46 PM
Search 5 seconds... pilotbob Feedback 4 04-10-2008 03:27 PM


All times are GMT -4. The time now is 02:16 AM.


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