SSH into the usb port only works intermittently

My BBB is powered by an external 5V power supply.
It runs the standard Angstrom distro, flashed to the latest version.
The only mods to the standard OS is the following commands:

opkg update

opkg install boost

opkg install gdbserver

My problem is this: The ssh port on the usb0 interface is only usable sometimes. Most of the time after a reboot I am NOT able to ssh into 192.168.2.7 from my PC. But the Linux File-CD Gadget always comes up, and I can always access http://192.168.7.2/Support/bone101/, even when the ssh access does not work.

By connecting a eth cable I can also always access the BBB. But I prefer USB access since the router is very far away :slight_smile:

Any tips on what could be causing this would be appreciated…

ssh’ing in over eth I see the following:

root@beaglebone:~# ifconfig
eth0 Link encap:Ethernet HWaddr C8:A0:30:B9:9E:FF
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::caa0:30ff:feb9:9eff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1801 errors:0 dropped:0 overruns:0 frame:0
TX packets:269 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:471222 (460.1 KiB) TX bytes:55260 (53.9 KiB)
Interrupt:56

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:410 (410.0 B) TX bytes:410 (410.0 B)

usb0 Link encap:Ethernet HWaddr B6:B9:14:D7:ED:55
inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:417 errors:0 dropped:0 overruns:0 frame:0
TX packets:562 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:57627 (56.2 KiB) TX bytes:220752 (215.5 KiB)

On the PC I see this:

user@laptop:~$ ifconfig

eth1 Link encap:Ethernet HWaddr c8:a0:30:b9:9f:81
inet addr:192.168.7.1 Bcast:192.168.7.3 Mask:255.255.255.252
inet6 addr: fe80::caa0:30ff:feb9:9f81/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:749 errors:0 dropped:0 overruns:0 frame:0
TX packets:529 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:221900 (221.9 KB) TX bytes:95607 (95.6 KB)

user@laptop:~$ wget http://192.168.7.2/Support/bone101/
–2013-10-12 17:22:34-- http://192.168.7.2/Support/bone101/
Connecting to 192.168.7.2:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 23300 (23K) [text/html]
Saving to: ‘index.html’

100%[============================================================================================================================>] 23 300 --.-K/s in 0,008s

2013-10-12 17:22:35 (2,95 MB/s) - ‘index.html’ saved [23300/23300]

user@laptop:~$ ssh root@192.168.2.7
ssh: connect to host 192.168.2.7 port 22: Connection timed out
user@laptop:~$

user@laptop:~$ wget http://192.168.7.2/Support/bone101/

user@laptop:~$ ssh root@192.168.2.7
ssh: connect to host 192.168.2.7 port 22: Connection timed out
user@laptop:~$

It helps to use the real ip..

Regards,

:slight_smile: Oops, stupid typo. Actually I have a /etc/hosts entry with the correct ip address, but I didn’t post that as that would mean nothing to you guys… However, the problem is still very real (intermittently) with the correct ip.

Mmmm I thought maybe I should explain the intermittent part a bit, since that’s what’s bugging me the most.

About 50-70% of the time, when I power up the board after not having worked with it for a while, I get the problem. I can’t connect over ssh on the usb line. I then normally press the reset button on the board, and when it boots the second time it usually works. Once or twice I have needed a second reset before it works. I usually try the ssh connection a little while after having seen the Linux File-CD Gadget popping up. Waiting a looong time after boot doesn’t seem to help when it’s not working.

I’ve got an absolutely same problem, after booting usb0 is configured but in down state. Works only after Reset/Power buttons. I just need to login with keyboard/monitor and make ifconfig usb0 up. But I can’t insert this command to the shell script started with systemd service (got SIOCGIFFLAGS error). Any suggestions on this case?

I am having a similar problem. The strange thing is it worked flawlessly for a long time, then just yesterday, I was unable to SSH into the board over USB from my mac. However, the USB drive still shows up in my Finder sidebar. I can still SSH via ethernet and I can still SSH via usb from a different mac. So, the problem is definitely related to my mac, but I can’t think of any significant changes to my mac from when it worked to when it didn’t. I obviously have all the drivers installed because it worked fine before. I tried reinstalling the drivers but this didn’t fix the problem.

If I SSH over ethernet I can see that the BBB gets an IP address over the virtual ethernet port:

root@beaglebone:~# ifconfig

usb0 Link encap:Ethernet HWaddr 46:D8:4F:91:30:FB
inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

And it seems to be listening

root@beaglebone:~# systemctl status dropbear.socket
dropbear.socket
Loaded: loaded (/lib/systemd/system/dropbear.socket; enabled)
Active: active (listening) since Sat 2000-01-01 00:00:08 UTC; 5min ago
Accepted: 1; Connected: 1
CGroup: name=systemd:/system/dropbear.socket

However, I my mac side I don’t get an IP address over the virtual ethernet port. Also, I noticed that in my System Preferences → Network that I have several entries for the BBB, but none of them connect.

I was able to get it working again on my mac. Following the directions here (http://joshuawise.com/horndis also copied below) to uninstall HoRNDIS then reinstalling it got everything working again. Just trying to reinstall did not work.

Uninstalling HoRNDIS on a mac

If, for some reason, you need to uninstall HoRNDIS, you can simply drag the extension to the trash. In the Finder, go to the “Go” menu, and select “Go to folder…”; in that, type ”/System/Library/Extensions”. Find “HoRNDIS.kext”, and drag it to the trash. When prompted, type your password; then, restart your Mac to be sure it is unloaded.

Hi,
I reinstalled uninstalled HoRNDIS but still I’m not able to ssh onto the BBB. After executing the command it just goes into processing. Did anyone find any other solution? Any help would be appreciated.
Thanks!