ECE497 Tips and Tricks

Some useful tips and tricks for Linux and the Beagleboard.

Interesting Links
Since we are working with the open source community, you need to know where the action is. Here are some useful links to what's happening in the Beagle community.


 * Adafruit's BeagleBone site.
 * SparkFun's Beagle tutorials.
 * BeagleBoard.org, the starting point for all things Beagle.
 * Beagle Discussion Group, lot's of good information here, but you'll have to dig a bit. Subscribe and follow the discussion.
 * blog, see what is being said about the Beagle.
 * eLinux, this is where this page is being hosted. It's about embedded Linux in general, not just the BeagleBoard.  The Beagle page is dated.
 * bootlin, some good labs about what makes embedded Linux run.
 * Google Summer of Code. BeagleBoard is an accepted organization.
 * Linux Kernel Map
 * Texas Instruments Embedded Processors Wiki

Linux
Learn UNIX in 10 Minutes is a quick overview of the most commonly used Linux commands.

Top 10 Tools is a nice summary of 10 of the most useful Linux commands.

Connecting to RHIT wifi
There is a discussion in the Beagle Google Group about getting wireless working with the bone.

Use these settings for connecting to the Rose-Hulman wireless network:


 * SSID: RHIT-1X
 * Security: WPA & WPA2 Enterprise
 * Leave "anonymous identity" blank
 * CA Certificate: (None)
 * PEAP version: Version 0
 * Inner authentication: MSCHAPv2
 * Use your Rose username and password

Suspending ssh
Most programs can be suspended by typing  (Ctrl-z). If you have an ssh connection to another machine you can suspend it by entering. You can resume the connection by entering fg.

ssh and X-windows
When using ssh between two X-windows systems try

host$ ssh -CX root@beagle

The -X set the DISPLAY variable on the remote machine so you can open windows from the beagle on your host machine.

The -C compressed the data over the link. Good for slow connections.

vnc
You can run a vnc server on the Beagle. Install it with: beagle$ sudo apt update beagle$ sudo apt install x11vnc Install a password with beagle$ x11vnc -storepasswd Run it on the Beagle with beagle$ x11vnc -display :0 -ssl -usepw -forever -q & On your host, connect to it with:

Applications:Internet:Remote Desktop Viewer

ssh configuration
Here's a nice tip so you don't have to remember who to login as on the beagle. On your host, put the following in ~/.ssh/config.

Host bone User debian UserKnownHostsFile /dev/null StrictHostKeyChecking no

Before you had to host$ ssh -CX debian@bone

Now you can just host$ ssh -CX bone

Mounting dfs/afs
These are out of date.

You can set up your Linux box to directly mount your afs and dfs files. The Rose-Hulman Linux Users' Group has a nice page with the details.

After installing  I added the following to my   file: sshfs#username@dfs.Rose-hulman.edu:/DFS/MyDocs/username /home/username/MyDocs fuse user,noauto,uid=1000,gid=1000 0 0 sshfs#username@dfs.rose-hulman.edu:/DFS/Users/Y/username /home/username/dfs-home fuse user,noauto,uid=1000,gid=1000 0 0 sshfs#username@afs.rose-hulman.edu: /home/username/afs-home fuse user,noauto,uid=1000,gid=1000 0 0 You'll have to replace  with your login name. Then create the mount points:

host$ cd ~ host$ mkdir MyDocs host$ mkdir dfs-home host$ mkdir afs-home

Now you can mount your files by using:

host$ cd ~ host$ mount dfs-home host$ cd dfs-home host$ ls

You should now see your dfs files. You can unmount using:

host$ cd ~ host$ sudo umount dfs-home

byobu - A Screen Manager
For years Unix has had  which is a screen manager. byobu is wrapper for screen that puts a nice face on it. You can run byobu on your host computer and on the Beagle. With byobu you can start a long running program (bitbake for example) in one terminal and detach from the terminal and the program will keeping running in the background. Using byobu you can later attach to the program (possibly from another terminal) and see how the program is progressing.

Install byobu with:

host$ sudo apt update host$ sudo apt install byobu

Now you can run it.

beagle$ byobu

You'll see a command prompt. You'll also see some status information on the bottom two lines. Type Ctrl-A ? for help. Type Ctrl-A Ctrl-D to detach from the session. Running byobu again will reattach you to the session. Try running byobu in two windows at the same time. You should see the same session in both.

Backing up an SD card with dd
Here's the command I use to backup an SD card. I use System:Administration:Disk Utility to figure out the path to the card. In this case it's /dev/sdc

host$ sudo time dd if=/dev/sdc of=FIE2011.img bs=4M count=1000 host$ sudo chown yoder:yoder FIE2011.img host$ md5sum FIE2011.img > FIE2011.img.md5 host$ bzip2 -k FIE2011.img

It takes about 5 minutes to dd a 4G card, 1.2 minutes for md5 and bzip2 takes about 23 minutes.

It looks like the 7z compression is becoming popular. Use it via host$ ''' 7za a FIE2011.img.7z IFE2011.img

It took 16 minutes. The file size is 454M compared to 628M. Wow, faster and smaller.

Getting the BeagleBone to work with unusual network managers
If you plugged in your BeagleBone, but you just can't get it to pop up a page at 192.168.7.2 (aka your browser says "could not connect" or "time out"), then the following steps should help.

First run host$ ip a

This will list a bunch of network interfaces. You should see one that looks odd and long like enp0s29u1u5

That is the interface for the BeagleBone. Now, to get the BeagleBone to communicate with your host over USB serial, run host$ sudo dhcpcd enp0s29u1u5

If this is successful, you should see your interface in the output of the command below. Its state should be UP. host$ ifconfig

Windows
Most of the work is done under Linux; however there are some handy Windows-based tools.

Serial Port
SecureCRT is a good program that gives you both access to a serial port and is also an ssh client. Rose has a license for SecureCRT.

Tera Term also gives you access to the serial port and it's free.

Notepad++
Notepad++ is a nice text editor for Windows.

Mounting the BeagleBone filesystem locally
1. Download and install OSXFUSE and SSHFS from github official page in the respective order.

2. In Terminal do host$ mkdir /Volumes/Beagle host$ sshfs root@beagleIPaddr:/ /Volumes/Beagle

Setup a USB Wireless Device on Beagle
(Here are instructions on setting up a Belkin USB dongle.)

The device I used to setup a wireless connection on the Beagle Board was the Linksys Compact Wireless-G USB Network Adapter with SpeedBooster.

I first opened the wpa_supplicant.conf file to setup my networks:

beagle$ cd /etc beagle$ gedit wpa_supplicant.conf &

This file is filled with numerous examples of possible wireless configurations for you to basically fill in. After looking at the examples, I scrolled down to the bottom of the page and set up two networks: one for home and one for school. Here are examples of my setup networks: network={ ssid="YourHomeNetworkName" psk="YourHomeNetworkPassword" }
 * 1) Home Network

network={ ssid="RHIT-1X" proto=WPA key_mgmt=WPA-EAP pairwise=CCMP group=TKIP eap=PEAP phase1="peapver=0 peaplabel=0" phase2="auth=MSCHAPV2" scan_ssid=1 identity="YourSchoolUsername" password="YourSchoolPassword" } For the network examples above,the quotation marks actually belong there but replace the Your.... areas with your corresponding information. No before the first quotation mark.When finished editing save and exit this file. The information for the RHIT school network was found here:RHLUG
 * 1) School Network

Now you must specify that this is the file to use for the wireless device:

beagle$ cd network beagle$ gedit interfaces &

This file will display all of the different types of Internet connections you have setup. To use the wpa_supplicant.conf file, scroll down to around line 42 of the code and uncomment the configuration for wpasupplicant. After doing this make sure all of the above lines mentioning anything about wlan0 are commented out. Return back to where it says "iface wlan0 inet dhcp" that you uncommented around line 42. Add "auto wlan0" above this line, make sure the line "wpa-conf /etc/wpa_supplicant.conf" is uncommented below the iface line, and change the wpa-driver line below that line to wext. So after all of that the code in this file for the wireless device should be the following: auto wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant.conf wpa-driver wext NOTE: the auto wlan0 command in this file means that this device will load at boot time. You can take the time in here now to comment out any interfaces you don't use like auto usb0 to make these devices not load at boot time, which will increase the speed at which you boot up. Save and exit this file

Once you have finished this you can either restart the Beagle Board or:

beagle$ cd beagle$ /etc/init.d/networking restart

I've found that a lot of the time the interface doesn't receive an IP address when it boots up. If you run ifconfig in the terminal you should see your wireless device connected to a network. If it is connected but no IP address I do the following:

beagle$ ifdown wlan0 beagle$ ifup wlan0
 * 1) it will report messages here and then
 * 1) more messages and it should report connecting and having an IP address

This ifdown ifup method has worked every time for me so far but if anyone can find a way to prevent having to do this almost every time please feel free to edit this

Getting help from a news group
Here's a nice tip on what to do before posting a question to a news group.