I want to gain freedom from the dreaded BeagleBone Black Ethernet Over USB method of connecting.
Firstly, I am setting a static IP address for the Beaglebone as described here: http://www.rovbots.com/setting-a-static-ip-address-for-beaglebone-black/
- Successfully changed the etc/network/interfaces file to add the information about the static address. Check
- Board boots up with the 5V 2A power adapter (according to the board’s LEDs).
- Tried to Putty SSH to the board – Fail – Connection attempt timed out
- Also failed using these instructions – http://derekmolloy.ie/set-ip-address-to-be-static-on-the-beaglebone-black/ I get “Network error: Connection timed out” – Fail
After much Googling, I found this site http://www.quepublishing.com/articles/article.aspx?p=2447201&seqNum=2 which has a chapter excerpt from the Beaglebone Black Primer at http://www.quepublishing.com/store/beaglebone-black-primer-9780789753861?w_ptgrevartcl=Getting+Started+with+the+BeagleBone+Black_244720.
That chapter excerpt describes how to simultaneously connect your BBB by Ethernet over USB and with an Ethernet crossover cable. By SSHing to the BBB over the USB connection you can log in and use the ifconfig command to get the IP address assigned to the eth0 adapter on the BBB. Then you can SSH to the BBB using that Ethernet address and login. However, this doesn’t seem to work unless you first unplug the USB cable to force the use of the Ethernet connection.
This procedure seemed to wipe out the whole concept of a static IP address on the BBB. I’ll have to see when I reconnect again whether the same eth0 address found via ifconfig still works.
When I go back into Windows and set my wireless network adapter to share its internet connection with the Ethernet network adapter I get kicked off the BBB.
I then reconnect the Ethernet Over USB connection (EOUSB) to the BBB, login and do ifconfig and see that the eth0 address is now 192.168.137.96 – the first 9 digits of which match the Windows Ethernet network adapter’s static address.
I then went back in and edited the /etc/network/interfaces file in the BBB to have an eth0 static IP address of 192.168.137.95 and a netmask of 255.255.255.0.
Logging in over EOUSB still works. Whew! When I unplug EOUSB and use the eth0 IP address found using ifconfig though, I get that that network location is unreachable.
Then, starting the BBB up with just the external 5V power supply and with the Ethernet crossover cable and then plugging in EOUSB to login and use ifconfig I see that the BBB eth0 has an address of 192.168.137.206. So, it looks like when connecting with the Ethernet crossover cable eth0 gets a dynamically assigned address in the 192.168.137.206 range to coincide with the IP address that the Windows machine’s LAN network adapter is set to – 184.108.40.206. And I can then unplug EOUSB and login to the BBB using 192.168.137.206. The static IP address that I set for eth0 in the BBB’s /etc/network/interfaces file is being ignored. Will that address for eth0 be different every time? That’s going to be a problem.
Next steps …. ????? Probably figure out how to get the startup and network access process to honor the static IP address set in the BBB’s interfaces file.
Back on this 8/30/16 6:06 AM
Following the suggestions at this link https://ubuntuforums.org/showthread.php?t=2288300 in order to try to cure the static address problem. I searched for “/etc/init.d/udhcpd restart” in the /opt/scripts/boot directory and found in a file called “autoconfigure_usb0.sh” – which makes sense. I commented out the lines as suggested in the link. The line numbers in “autoconfigure_usb0.sh” that I commented out are #s 97, 92, 93. And that failed. I can’t connect with either EOUSB nor via the serial connection now. So, I have to reflash the image. Sigh.
7:38 AM Went for a run while the BBB image was reflashed. I am now back to zero and can ssh to the BBB over both EOUSB and Ethernet. Lots of work to get back to where I started, but I press on.
This link http://stackoverflow.com/questions/24598610/issue-setting-static-eth0-ip-beaglebone-black-version-c-debian-preloaded provides a couple of suggestions on how to fix the problem. The first is to edit /etc/network/interfaces to contain
auto eth0 iface eth0 inet static address 192.168.0.102 netmask 255.255.255.0 network 192.168.0.0 gateway 192.168.0.1
That didn’t work. Another answer that hadn’t been upvoted at all suggested adding the line “/sbin/ifconfig eth0 220.127.116.11 netmask 255.255.255.0 || true” to the /opt/scripts/boot/autoconfigure_usb0.sh script. I made that edit, adding that line in two places and it worked.
I can now start the BBB either connected via EOUSB or with the crossover Ethernet cable and log in using either IP address.