Home

Projects

Publications

Testbeds

Software

People

Pictures


How to Connect BeagleBone Black to a PC:

Following steps are based on that Beaglebone Black uses Angstrom Linux system:

  • Use micro-USB-to-USB cable to connect beaglebone black to PC1;

  • Visit http://192.168.7.2 via browser (Chrome, Firefox, etc. but IE will not work) to see whether it can show on-board website1;

  • Use command  "ssh root@192.168.7.2" to connect (no password needed).

If using Ubuntu:

  • Check out the DHCP client table provided by router or use command "nmap IP_DOMAIN" ("IP_DOMAIN" can be something like "192.168.1.1-254") to find out which IP Beaglebone Black has acquired.
  • Use command "ssh ubuntu@IP_ADDRESS" to connect

To Top

How to Make a Ubuntu-Based Mac Mini Work as a Mesh Point


How to Configure Java Environment2:

 Following Steps are based on that Beaglebone Black uses Angstrom Linux system:

For Ubuntu, following steps will be helpful:

  • Update  apt-get by command "sudo apt-get update"
  • Install following packages: openjdk-6-dbg, openjdk-6-jdk, openjdk-6-jre-lib, openjdk-6-source, openjdk-6-jre, openjdk-6-jre-headles (or you could also install all relevant packages on openjdk by using command "apt-get install openjdk-6-*")
  • Test by using HelloWorld.java

To Top


How to Install RXTX Package on Beaglebone Black2:

 Following steps are based on that Beaglebone Black uses Angstrom Linux system:

  • Use opkg to install rxtx and librxtx-java by using commands "opkg install rxtx" and "opkg install librxtx-java"
  • Use command “java –Djava.library.path=/usr/lib/jni/ -cp .:/usr/share/java/rxtx.jar $CommTest$” to run application "CommTest"

If using Ubuntu system:

  • Use apt-get to install librxtx-java by using commands "sudo apt-get install librxtx-java"
  • Write "export CLASSPATH=.:/usr/lib/jvm/java-6-openjdk/lib:/usr/lib/jni:/usr/share/java/RXTXcomm.jar" and "export JAVA_HOME=/usr/lib/jvm/java-6-openjdk" in the ~/.bashrc file
  • Reboot the board

 


Test Codes for RXTX Package3:

Example: Print All Active Serial Ports

 import java.util.Enumeration;
 import gnu.io.*;

 public class TestSerial {
 static Enumeration portList; 
 static CommPortIdentifier portId;

 public static void main(String[] args) {

 try{

 portList = CommPortIdentifier.getPortIdentifiers(); //Get Current Ports
 while (portList.hasMoreElements()) {
 portId = (CommPortIdentifier) portList.nextElement();
 if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {//If Serial
 System.out.println(portId.getName());
 }
 }
 } catch (Exception e) {
 e.printStackTrace();
 }  
 }  
 }

 To Top


 

 How to Install Ubuntu System on Beaglebone Black4:

Requirements: Any form of linux and a card-reader that works with linux
  • Use an SD-Card reader (newer mac ones do not work), place the micro sd card into a reader(optional). If you are using a VM, attach the card-reader to the VM
  • Wget http://rcn-ee.net/deb/rootfs/raring/ubuntu-13.04-console-armhf-2013-08-24.tar.xz
  • tar xJf ubuntu-13.04-console-armhf-2013-08-24.tar.xz
  • cd ubuntu-13.04-console-armhf-2013-08-24
  • sudo ./setup_sdcard.sh --probe-mmc
  • Select the /dev/sdX where X is the sdcard device
  • sudo ./setup_sdcard.sh --mmc /dev/sdX --uboot bone
  • Wait.... yes to the questions (make sure you don't kill your os disk)
  • When complete unmount correctly
  • With the beaglebone black off plug in the sdcard (if a sdcard is detected it won't boot the internal flash angstrom)
  • Plug in USB modem cable (client usb)
  • Go to 192.168.7.2:4200 (they have an web based shell) uname:pwd is -> ubuntu:temppwd
  • Update the sshd settings to enable the current user remote access via password (or add your public rsa key to the ubuntu user, for passwordless ssh): firstly you need to install openssh-client and openssh-server by using commands "sudo apt-get install openssh-client" and "sudo apt-get install openssh-server", then use commands "sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults" and  "sudo chmod a-w /etc/ssh/sshd_config.factory-defaults", and finally use command "sudo restart ssh". If you could find that terminal shows like "ssh start/running, process 975", it works.

  • IF YOU WANNA RUN IN MAXIMUM SPEED ALL THE TIME: Before doing this, make sure that you have checked out the frequency information through "sudo cpufreq-info" command. Firstly you need to write command "sudo cpufreq-set -g performance" in .bashrc file, then use command "sudo chmod -x /etc/init.d/ondemand" to stop normal operation of ondemand service to prevent that it automatically adjusts cpu frequency from highest one to default one. (You could also disable the whole service by "sudo update-rc.d ondemand disable")

 


 

How to Set Autologin for Ubuntu on Beaglebone Black5:

Due to that

1) both getty and login do not belong to any package (that means you cannot get package version thus refresh it by modifying, recompiling downloaded corrensponding source code and doing overwrite),

2) grub packages are unavailable (that means you cannot use the method which firstly asks you to make modification on /etc/default/grub and then change content in /etc/init/tty1.conf),

3) lightdm is also unavailable (that means you cannot achieve this by changing value of variable "autologin-user" in file /etc/lightdm/lightdm.conf),

Following method is the only one being found works (use "ubuntu" as example of user name):

  • sudo passwd -d ubuntu (before doing this, remember to change password of root to make sure that even user account "ubuntu" does not have password, one could also update files to board via root account)
  • sudo nano /etc/init/tty1.conf
  • change last line to be: exec /bin/login -f ubuntu < /dev/tty1 > /dev/tty1 2>&1
  • save and reboot to see whether it works

 


How to Set Ubuntu-based Beaglebone Black with TL-721N Dongle to Be a Mesh Point:

1. Use method mentioned in section "How to Install Ubuntu on BeagleBone Black" to install pre-defined Ubuntu.

2. Use command "wget https://rcn-ee.net/deb/wheezy-armhf/v3.13.0-rc8-bone4/install-me.sh" to get script.

3. Run script until it shows "please reboot", then reboot.

4. Check out whether kernal version is 3.13.0-rc8-bone4 through "uname -a"

5. Install iw. Firstly use command "sudo apt-get update", then "sudo apt-cache search libnl" to install all related packages with name form libnl-3-*, which indicates libnl with version higher than 3.0.

6. Install other necessary packages including pkg-config.

7. git clone http://git.kernel.org/cgit/linux/kernel/git/jberg/iw.git.

8. Enter into iw folder, and run Makefile.

9. Finally put iw into folder /usr/sbin to make it available for calling.

10. REBOOT THE BOARD, and plug TL-WN721 on board/hub during this procedure, then run "iw list" to see whether it is recognizable.

11. If everything goes well you will see a long list saying this device supports interfaces like AP modes, Mesh Points, etc. Then configure it based on this website:

https://github.com/cozybit/open80211s/wiki/HOWTO

BUT BE CAREFUL ABOUT:

1) If you see error code -1, you need to use sudo before your command;

2) If you see Device or Resource Busy, you need to turn off device by using command "sudo ifconfig $MESH_IFACE down", THEN try to shut down network manager service via method described in this link: http://askubuntu.com/questions/21654/how-to-temporarily-turn-off-networkmanager-from-the-command-line

3) If you see information like "operation not supported" please use command like "iw list | grep mesh" to double-check whether it supports mesh point mode.


 

How to Make a Ubuntu-Based Mac Mini Work as a Mesh Point

1. Check out corresponding .config file to see whether mesh is enabled in mac80211. If no, install a new kernel or re-configure the old kernel; if yes, go to step 2.

2. Install all necessary packages including open-jdk-7-*, iw, etc. (How to do this please refer to above instructions).

3. Sudo Service network-manager stop, sudo ifconfig lo down

4. Check out whether dongle supports mesh mode by using command "iw list | grep mesh".

5. Configure manually according to PreConfig.java to see whether there is some error information - if there is, please refer to previous instruction to handle with them.

6. Run modified server code before starting clients.

IF STEP 1's RESULT IS NO, FOLLOWING METHOD COULD BE TRIED:

1. Go to http://kernel.ubuntu.com/~kernel-ppa/mainline/linux-3.11.y.z-review/2014-03-13-saucy/, and download all three .deb packages.

2. Install them in the sequence of linux-headers-3.11.10-992_3.11.10-992.201403130405_all.deb => linux-headers-3.11.10-992-generic_3.11.10-992.201403130405_amd64.deb => linux-image-3.11.10-992-generic_3.11.10-992.201403130405_amd64.deb

3. Reboot after installation, select this kernel when booting into ubuntu, and try again.


 

How to Capture Frame Header

Before this, it is recommended to learn about how tcpdump works - because if one knows this, he/she could make sure that whether tcpdump could get whole raw frame (Physical layer frame) or can only get frame in the link-layer level.

Part 1: Original Cases (Non-802.11s case)

1. sudo service network-manager stop

2. sudo iw dev {Interface_Name} set monitor none

3. sudo ifconfig {Interface_Name} up

4. sudo tcpdump -o {Interface_Name} -w {File_Name} -y IEEE802_11_RADIO (Interface_Name here means wlan*)

5. Analyze generated file

Part 2: 802.11s Case

1. Follow part 1.1-1.4.

2. Create an interface mesh1 as above shows.

3. Run experiment.

To Top

 


 

 

How to use watchdog timer (original link)

The embedded watchdog on the BeagleBone can be very handy in the case of an embedded product, on a remote location or inside a robot.

 

The watchdog will restart the BeagleBone it is not written to in 60 seconds (while being kept open).

 

To use it:

Open the file /dev/watchdog

Do not close the file

Write something (e.g. "\n") to the file at least every 59 seconds to keep the system running

If a write is not performed within 60 seconds, the watchdog restarts the BeagleBone.

 

To test:

cat > /dev/watchdog

Hit return once

Wait 60 seconds

Watch the BeagleBone reset.

Original Link

To Top

 

 



 

How to copy files from Beaglebone Black to USB flash drive 

 Original Link

Get the Information

Sometimes devices don't automount, in which case you should try to manually mount it. First, you must know what device we are dealing with and what filesystem it is formatted with. Most flash drives are FAT16 or FAT32 and most external hard disks are NTFS.

sudo fdisk -l

Find your device in the list, it is probably something like /dev/sdb1. For more information about filesystems, seeLinuxFilesystemsExplained

Create the Mount Point

Now we need to create a mount point for the device, let's say we want to call it "external". You can call it whatever you want, just please don't use spaces in the name or it gets a little more complicated - use an underscore to separate words (like "my_external"). Create the mount point:

sudo mkdir /media/external 

Mount the Drive

We can now mount the drive. Let's say the device is /dev/sdb1, the filesystem is FAT16 or FAT32 (like it is for most USB flash drives), and we want to mount it at /media/external (having already created the mount point):

sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=1000,utf8,dmask=027,fmask=137

The options following the "-o" allow your user to have ownership of the drive, and the masks allow for extra security for file system permissions. If you don't use those extra options you may not be able to read and write the drive with your regular username.

Otherwise if the device is formatted with NTFS, run:

sudo mount -t ntfs-3g /dev/sdb1 /media/external


You must have the ntfs-3g driver installed. See MountingWindowsPartitions for more information.  

Unmounting the Drive

When you are finished with the device, don't forget to unmount the drive before disconnecting it. Assuming /dev/sdb1 mounted at /media/external, you can either unmount using the device or the mount point:

sudo umount /dev/sdb1

or:

sudo umount /media/external

You cannot unmount from the desktop by right clicking the icon if the drive was manually mounted.

 

 To Top

 

 

 

 

 

 

 

 

 

 

 

 


--------------------------------------------------------------------------------------------------------------------------