{{EBC3.8}}If you are running the 3.8 kernel, check out these [http://beagleboard.org/Getting%20Started instructions] for getting started.

−

=== Internet Connection ===

+

{{EBC3.8}}'''These instructions are for the 3.8 kernel.''' [[EBC Exercise 02 Out-of-the-Box, Bone 3.2 Kernel]] has instructions for the 3.2 kernel.

−

One of the slickest features of the Bone is it's ability to access the Internet through the USB connection.

+

== Getting Started ==

+

We'll be running the 3.8 kernel, check out these [http://beagleboard.org/Getting%20Started instructions] for getting started. Then come back here to get your network set up.

−

==== Linux ====

+

== Internet Connection ==

−

On your host computer run:

+

+

One of the slickest features of the Bone is its ability to access the Internet through the USB (tether) connection. You should have already used it following the instructions above. Below shows how to set up your host and Bone so the bone can access the internet through your host.

+

+

=== Linux ===

+

==== ifconfig ====

+

Run:

host$ '''ifconfig'''

host$ '''ifconfig'''

Line 39:

Line 43:

collisions:0 txqueuelen:0

collisions:0 txqueuelen:0

RX bytes:3665320 (3.6 MB) TX bytes:3665320 (3.6 MB)

RX bytes:3665320 (3.6 MB) TX bytes:3665320 (3.6 MB)

−

You'll see a new network has appeared, '''eth4''' in my case. The IP address is '''192.168.7.1'''. There's a good chance the Bone is at '''192.168.7.''2'''''. Try connecting to it.

+

+

==== ssh ====

+

You'll see a new network has appeared, '''eth4''' in my case. The IP address of your host is '''192.168.7.1'''. There's a good chance the Bone is at '''192.168.7.''2'''''. Try connecting to it.

host$ '''ssh -X root@192.168.7.2'''

host$ '''ssh -X root@192.168.7.2'''

−

beagle$

+

bone$

−

You are now logged into the Bone through the network. This is much faster than the serial port (.115M vs. 100M) and supports many interesting network things. The only problem is, the Beagle doesn't know how to access the Internet through the host. Get back to the host computer by entering RETURN ~ ^Z. That is, hit RETURN, then ~ (it's up there near the ESC key) and then Ctrl-Z. This gets you back to your host, but leaves the ssh connection running.

+

You are now logged into the Bone through the network. This is much faster than the serial port (.115M vs. 100M) and supports many interesting network operations. The only problem is, the Beagle doesn't know how to access the Internet through the host. Get back to the host computer:

−

Copy the following lines into a file call '''host.ipForward.sh'''

+

bone$ '''exit'''

−

<pre>

+

==== Set Up Git ====

−

#!/bin/bash

+

−

# These are the commands to run on the host to setup IP masquerading so the Beagle

We need to run some files that are in the class '''git''' repository. We'll learn more about using git later. Here I'll just show you how to get the files. Here we are installing these files on your host computer, later we'll install them on your Beagle.

(The whole repo is some 550M. Using '''--depth=1''' you only get the recent history and it only takes 190M.)

−

ssh -X root@192.168.7.2

+

−

(Hit RETURN)

+

−

beagle$ '''ping google.com'''

+

−

You should see Google responding. Hit Ctrl-C to stop.

+

This will take a while since it's getting all the course files, including pdf files of the course PowerPoint.

−

''Note: If you are using Ubuntu 12.04 and having an issue connecting to the internet, you may need to add a line to the /etc/resolv.conf file on the Bone. If ping google.com returns an "unknown host" error, this means that the Bone cannot resolve the url google.com to an IP address. Users with an Ubuntu 12.04 host may see this issue because the resolv.conf that Ubuntu uses (and is copied to the Bone in the host.ipForward.sh script) is not compatible with the Bone. The solution is to run the host.ipForward script as normal, then add the line "nameserver 8.8.8.8" above the existing entry in /etc/resolv.conf (run "nano /etc/resolv.conf" on the Bone to edit the file). This configures the Bone to use [https://developers.google.com/speed/public-dns/ Google's Public DNS Server].''

+

==== Running ipMasquerade.sh ====

+

Now that the files are installed, run:

+

host$ '''cd exercises/setup'''

+

host$ '''./ipMasquerade.sh ''eth0'''''

+

This will give you instructions on how to set up your host.

+

Note: If you are using a wireless connection you should use

−

Congratulations! Your Beagle is now on the network through your host computer.

+

host$ '''./ipMasquerade.sh ''wlan0'''''

−

== Kernel 3.2 ==

+

Once ./ipMasquerade.sh has been run you can:

−

{{EBC3.2}}'''These instructions are for the 3.2 kernel.'''

+

host$ '''./firstssh.sh'''

+

Now you should have network access on the Bone.

+

bone$ '''ping -c2 google.com'''

−

The BeagleBone can do many neat things right out of the box using just the USB cable and SD card that come with it. Before hooking up anything, if you are running Linux or OSX on your host computer, open a terminal at run:

+

You should see Google responding.

−

host$ '''ls /dev/tty* > /tmp/tty'''

+

Congratulations! Your Beagle is now on the network through your host computer.

−

This will record what devices are present on you host computer. Once you plug the bone in it will create a new device. Windows users don't have to do anything here.

+

====Troubleshooting====

−

Install the SD card (not the one that says Linux SDK on it) and attach the Bone to a host computer via the USB cable. The little USB connector goes to the Beagle in the connector on the bottom of the board near the Ethernet connector. Connect the large end of the USB cable to a host computer. The host can be either Linux, Mac, or Windows (though if you are doing development, consider running Linux on the host.) I give instructions for each.

+

=====Unknown Host=====

−

The Beagle, powered via the USB, will boot up. You should initially see two LEDs blinking, near the Ethernet connector. The one labeled '''0''' blinks a heartbeat pattern. LED '''1''' blinks when the SD card is being accessed. After about 30 seconds LED 1 will stop blinking. The Bone is booted.

+

If you get an unknown host response when attempting to ping google.com, and you are off campus, try pinging the Google DNS by IP address. Run:

−

Here are some of the things it can do.

+

bone$ '''ping 8.8.8.8'''

−

== YouTube Introduction ==

+

If you are on campus, run:

−

[http://www.youtube.com/watch?v=z6b4zlh0IrE&feature=bf_next&list=UUf_sAmhBw7Tj7-2ujmLFoQg Here's] a nice overview of the BeagleBone. It shows how to work with it using a Windows host.

+

bone$ '''ping 137.112.5.28'''

−

== USB Drive ==

+

If you now see responses by pinging a specific IP, it is possible that a firewall on your host computer is blocking the Beagle's access to the DNS when attempting to ping by domain name. On Ubuntu/Mint, run:

−

On your host you will notice a new folder appearing. On Linux and OSX it's call '''BEAGLE_BONE'''. On Windows it's '''Beagle Bone Getting Started'''. Open it up and look around. The '''README.html''' gives lots of information about getting going with the Bone. Look at it in detail after going though this page.

+

host$ '''sudo ufw disable'''

+

Firewall stopped and disabled on system startup

−

When you are doing exploring the files, eject the drive (don't select ''SAFELY REMOVE DRIVE''). Once the drive is ejected, the network will start up over the USB.

+

You should get a response, such as above, that the firewall will be disabled upon next startup. After saving anything important, restart your host through the start menu or run:

−

== Built in USB to serial adapter ==

+

host$ '''reboot'''

−

The Beagle xM has a serial port connector on board, but the Bone doesn't. Instead you access the serial port through the USB connector. The trick is figuring out how to access it.

+

Repeat this exercise and attempt to ping Google by domain name again. If you now receive responses, then the firewall was indeed the issue. Otherwise, the internet is your friend. Use your host computer to try and find a solution. Feel free to add solutions here when you find them

−

=== Linux, OSX ===

+

=== OSX ===

−

+

I haven't checked these instructions this year. Please report your results and update if needed.

−

Run the following:

+

−

host$ '''ls /dev/tty* > /tmp/tty2'''

+

−

host$ '''diff /tmp/tty*'''

+

−

ttyUSB1

+

−

host$ '''screen /dev/''ttyUSB1'' 115200''' (Linux)

+

−

host$ '''screen /dev/tty.usb*B 115200''' (OSX)

+

−

+

−

The first line lists what devices are out there. The second compares that list to the list made earlier. What appears is the USB to serial device on the Bone. The last line starts a serial port program that attaches to that device. Notice the ''ttyUSB1'' is the same string as returned by the diff command.

+

−

+

−

=== Windows ===

+

−

To find where the serial port appears in Windows, click on the start menu and search for '''Device Manager''' and run it.

+

−

+

−

[[File:Device_Manager.png|300px‎]]

+

−

+

−

Select '''Ports''' and look for USB Serial Port. In my case the port appears at '''COM6'''.

+

−

+

−

[[File:Port.png‎|300px]]

+

−

+

−

Start up a [[ECE497_Tips_and_Tricks#Serial_Port serial port]] program and connect. The baud rate is 115200.

+

−

+

−

=== Logging in ===

+

−

+

−

Hit RETURN and you'll see the following. Login as '''root''' and look around.

+

−

+

−

.---O---.

+

−

| | .-. o o

+

−

| | |-----.-----.-----.| | .----..-----.-----.

+

−

| | | __ | ---'| '--.| .-'| | |

+

−

| | | | | |--- || --'| | | ' | | | |

+

−

'---'---'--'--'--. |-----''----''--' '-----'-'-'-'

+

−

-' |

+

−

'---'

+

−

+

−

The Angstrom Distribution beaglebone ttyO0

+

−

+

−

Angstrom v2012.01-core - Kernel 3.2.5+

+

−

+

−

beaglebone login: '''root'''

+

−

Last login: Fri Jul 13 01:28:06 UTC 2012 on ttyO0

+

−

root@beaglebone:~#

+

−

+

−

== Internet Connection ==

+

−

+

−

One of the slickest features of the Bone is it's ability to access the Internet through the USB connection. The network connection starts up ''after'' you've ejected the '''BEAGLE_BONE''' drive that appears. Do it now.

+

−

+

−

=== Linux ===

+

−

After ejecting, run:

+

−

+

−

host$ '''ifconfig'''

+

−

eth0 Link encap:Ethernet HWaddr 00:18:8b:72:b8:c2

+

−

inet addr:137.112.41.109 Bcast:137.112.41.255 Mask:255.255.255.0

+

−

inet6 addr: fe80::218:8bff:fe72:b8c2/64 Scope:Link

+

−

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

+

−

RX packets:8481193 errors:0 dropped:0 overruns:0 frame:0

+

−

TX packets:1871287 errors:0 dropped:0 overruns:0 carrier:0

+

−

collisions:0 txqueuelen:1000

+

−

RX bytes:3172154531 (3.1 GB) TX bytes:203188180 (203.1 MB)

+

−

Interrupt:19

+

−

+

−

eth4 Link encap:Ethernet HWaddr d4:94:a1:39:ff:ff

+

−

inet addr:192.168.7.1 Bcast:192.168.7.3 Mask:255.255.255.252

+

−

inet6 addr: fe80::d694:a1ff:fe39:ffff/64 Scope:Link

+

−

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

+

−

RX packets:8 errors:0 dropped:0 overruns:0 frame:0

+

−

TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

+

−

collisions:0 txqueuelen:1000

+

−

RX bytes:2775 (2.7 KB) TX bytes:1234 (1.2 KB)

+

−

+

−

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:16436 Metric:1

+

−

RX packets:37315 errors:0 dropped:0 overruns:0 frame:0

+

−

TX packets:37315 errors:0 dropped:0 overruns:0 carrier:0

+

−

collisions:0 txqueuelen:0

+

−

RX bytes:3665320 (3.6 MB) TX bytes:3665320 (3.6 MB)

+

−

You'll see at new network has appear, '''eth4''' in my case. The IP address is '''192.168.7.1'''. There's a good chance the Bone is at '''192.168.7.''2'''''. Try connecting to it.

+

−

host$ '''ssh -X root@192.168.7.2'''

+

−

beagle$

+

−

You are now logged into the Bone through the network. This is much faster than the serial port (.115M vs. 100M) and supports many interesting network things. The only problem is, the Beagle doesn't know how to access the Internet through the host. Get back to the host computer by entering RETURN ~ ^Z. That is, hit RETURN, then ~ (it's up there near the ESC key) and then Ctrl-Z. This gets you back to your host, but leaves the ssh connection running.

+

−

+

−

Copy the following lines into a file call '''host.ipForward.sh'''

+

−

+

−

<pre>

+

−

#!/bin/bash

+

−

# These are the commands to run on the host to setup IP masquerading so the Beagle

# Check to see what nameservers the host is using and copy these to the same

+

−

# file on the Beagle

+

−

# This makes it so you can connect to the Beagle without using your password.

+

−

ssh-copy-id root@$beagleAddr

+

−

# Save the /etc/resolv.conf on the Beagle in case we mess things up.

+

−

ssh root@$beagleAddr "mv -n /etc/resolv.conf /etc/resolv.conf.orig"

+

−

# Copy the resolv.conf file to the Beagle. Now the Beagle will use the

+

−

# same name servers as the host.

+

−

cat /etc/resolv.conf - << EOF > /tmp/resolv.conf

+

−

nameserver 137.112.18.59

+

−

nameserver 137.112.5.28

+

−

nameserver 137.112.4.196

+

−

search rose-hulman.edu

+

−

nameserver 8.8.8.8

+

−

nameserver 8.8.4.4

+

−

EOF

+

−

scp /tmp/resolv.conf root@$beagleAddr:/etc

+

−

# Tell the beagle to use the host as the gateway.

+

−

ssh root@$beagleAddr "/sbin/route add default gw $hostAddr"

+

−

</pre>

+

−

+

−

Now run:

+

−

host$ '''chmod +x host.ipForward.sh'''

+

−

host$ '''./host.ipForward.sh ''eth0'''''

+

−

This will give you instructions on how to set up your host and will remotely set up your Beagle.

+

−

Note: If you are using a wireless connection you should use host$ '''./host.ipForward.sh ''wlan0'''''

+

−

+

−

Once ./host.ipForward.sh has been run you can:

+

−

host$ '''fg'''

+

−

ssh -X root@192.168.7.2

+

−

(Hit RETURN)

+

−

beagle$ '''ping google.com'''

+

−

+

−

You should see Google responding. Hit Ctrl-C to stop.

+

−

+

−

''Note: If you are using Ubuntu 12.04 and having an issue connecting to the internet, you may need to add a line to the /etc/resolv.conf file on the Bone. If ping google.com returns an "unknown host" error, this means that the Bone cannot resolve the url google.com to an IP address. Users with an Ubuntu 12.04 host may see this issue because the resolv.conf that Ubuntu uses (and is copied to the Bone in the host.ipForward.sh script) is not compatible with the Bone. The solution is to run the host.ipForward script as normal, then add the line "nameserver 8.8.8.8" above the existing entry in /etc/resolv.conf (run "nano /etc/resolv.conf" on the Bone to edit the file). This configures the Bone to use [https://developers.google.com/speed/public-dns/ Google's Public DNS Server].''

+

−

+

−

Congratulations! Your Beagle is now on the network through your host computer.

+

−

+

−

=== OSX===

+

−

After ejecting

+

# go to '''System Preferences''' and select '''Network'''

# go to '''System Preferences''' and select '''Network'''

Line 311:

Line 123:

host$ '''screen /dev/ttyusb*B 115200'''

host$ '''screen /dev/ttyusb*B 115200'''

−

beagle$ '''udhcpc -i usb0'''

+

bone$ '''udhcpc -i usb0'''

−

beagle$ '''ping google.com'''

+

bone$ '''ping google.com'''

This is all nicely shown [http://www.youtube.com/watch?v=Cf9hnscbSK8&feature=youtu.be here] in this silent YouTube movie.

This is all nicely shown [http://www.youtube.com/watch?v=Cf9hnscbSK8&feature=youtu.be here] in this silent YouTube movie.

−

Congratulations, you now have a connection to the Internet.

+

Congratulations, you now have a connection from your BeagleBone to the Internet.

=== Windows 7 ===

=== Windows 7 ===

+

I haven't checked these either. Please report results and update if needed.

+

There are several ways of running ssh on Windows 7. Below are a couple of tools that you can use.

There are several ways of running ssh on Windows 7. Below are a couple of tools that you can use.

−

−

==== msysgit ====

−

Install [http://msysgit.github.com/ msysgit]. This is a version of git for Windows based on msys (a unix like shell for Windows) which includes ssh. This solution is simple if all you need to do is connect to your bone.

−

−

==== Cygwin ====

−

Install [http://cygwin.com/ Cygwin]. There are many packages that you can install that aren't installed by default:

−

−

Required

−

# openssh

−

−

Optional

−

# make

−

# gcc-core

−

# gcc-g++

−

# gdb

−

# git

−

−

This solution is more involved, but it allows you to install development tools.

==== Environment Setup ====

==== Environment Setup ====

Line 363:

Line 159:

# Check the box to '''Allow other network users to connect through this computer's Internet connection'''

# Check the box to '''Allow other network users to connect through this computer's Internet connection'''

# Select your bone's local area connection for the '''Home networking connection''' (if you cannot choose the local area connection, turn your internet connection sharing off and then back on)

# Select your bone's local area connection for the '''Home networking connection''' (if you cannot choose the local area connection, turn your internet connection sharing off and then back on)

Getting Started

We'll be running the 3.8 kernel, check out these instructions for getting started. Then come back here to get your network set up.

Internet Connection

One of the slickest features of the Bone is its ability to access the Internet through the USB (tether) connection. You should have already used it following the instructions above. Below shows how to set up your host and Bone so the bone can access the internet through your host.

ssh

You'll see a new network has appeared, eth4 in my case. The IP address of your host is 192.168.7.1. There's a good chance the Bone is at 192.168.7.2. Try connecting to it.

host$ ssh -X root@192.168.7.2
bone$

You are now logged into the Bone through the network. This is much faster than the serial port (.115M vs. 100M) and supports many interesting network operations. The only problem is, the Beagle doesn't know how to access the Internet through the host. Get back to the host computer:

bone$ exit

Set Up Git

We need to run some files that are in the class git repository. We'll learn more about using git later. Here I'll just show you how to get the files. Here we are installing these files on your host computer, later we'll install them on your Beagle.

Get the Files

(The whole repo is some 550M. Using --depth=1 you only get the recent history and it only takes 190M.)

This will take a while since it's getting all the course files, including pdf files of the course PowerPoint.

Running ipMasquerade.sh

Now that the files are installed, run:

host$ cd exercises/setup
host$ ./ipMasquerade.sh eth0

This will give you instructions on how to set up your host.
Note: If you are using a wireless connection you should use

host$ ./ipMasquerade.sh wlan0

Once ./ipMasquerade.sh has been run you can:

host$ ./firstssh.sh

Now you should have network access on the Bone.

bone$ ping -c2 google.com

You should see Google responding.

Congratulations! Your Beagle is now on the network through your host computer.

Troubleshooting

Unknown Host

If you get an unknown host response when attempting to ping google.com, and you are off campus, try pinging the Google DNS by IP address. Run:

bone$ ping 8.8.8.8

If you are on campus, run:

bone$ ping 137.112.5.28

If you now see responses by pinging a specific IP, it is possible that a firewall on your host computer is blocking the Beagle's access to the DNS when attempting to ping by domain name. On Ubuntu/Mint, run:

You should get a response, such as above, that the firewall will be disabled upon next startup. After saving anything important, restart your host through the start menu or run:

host$ reboot

Repeat this exercise and attempt to ping Google by domain name again. If you now receive responses, then the firewall was indeed the issue. Otherwise, the internet is your friend. Use your host computer to try and find a solution. Feel free to add solutions here when you find them

OSX

I haven't checked these instructions this year. Please report your results and update if needed.

go to System Preferences and select Network

You should see RNDIS/...Gadget. This is the network connection to the Beagle. Select it

Congratulations, you now have a connection from your BeagleBone to the Internet.

Windows 7

I haven't checked these either. Please report results and update if needed.

There are several ways of running ssh on Windows 7. Below are a couple of tools that you can use.

Environment Setup

You can either run ssh from a bash terminal (i.e. C:\Program Files\Git\Git Bash or C:\cygwin\Cygwin.bat), or you can add the bin directories to your path and run from the Windows command prompt (i.e. add C:\Program Files\Git\bin or C:\cygwin\bin to your path).

Note: Be careful adding multiple bin directories to your path

First time setup

Run regedit

Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters

Change IPEnableRouter from 0 to 1

Close regedit

Run services

Make sure the following are set to Automatic and are started

Routing and Remote Access

Internet Connection Sharing (ICS)

Connecting to the Internet

After ejecting

Navigate to Control Panel\Network and Internet\Network and Sharing Center\Change adapter settings

Right click your wired/wireless internet connection and go to Properties

Go to the Sharing tab

Check the box to Allow other network users to connect through this computer's Internet connection

Select your bone's local area connection for the Home networking connection (if you cannot choose the local area connection, turn your internet connection sharing off and then back on)