Stanley Lio‎ > ‎

BeagleBone Black Note


Save potential development time (Python)
Some tasks are just too awkward for 8-bit AVR (SD card, Ethernet, USB host...)


Ethernet over USB
Internal USB-serial converter (ttyO0, over USB, appears as "Gadget Serial" on Windows 7)
External USB-serial converter (dedicated 6-pin header on BBB)


Changes made by route or ifconfig won't stick after reboot because the BBB Angstrom uses connman (Connection Manager, "con man" HAHA). It rewrites the routing table after reset for example.

1. Call get-services in /usr/lib/connman/test
2. Find out the name tag for your Ethernet interface ("ethernet_blah blah blah_cable")
cd /usr/lib/connman/test
./set-nameservers ethernet_????????_cable
./set-ipv4-method ethernet_????????_cable manual


(optional but nice)
Share your laptop's internet with the BBB: Windows 7 Shared Connection
share with either the Ethernet over USB or Ethernet (I prefer the latter as it's more reliable).


BBB has no battery-powered RTC
after you have internet access

/usr/bin/ntpdate -b -s -u

Boot from microSD

To boot from microSD instead of the internal eMMC with older images, the "boot" button need to be held down during power up. I got my BBB in April 2014, and it boots into the microSD automatically even if I don't press the "boot" button. The bootloader attempts to boot from uSD first before resorting to eMMC.

I wonder if I could reuse the "boot" button in run time.

Python GPIO


opkg update
opkg install python-pip python-setuptools python-smbus
pip install Adafruit_BBIO

python -c "import Adafruit_BBIO.GPIO as GPIO; print GPIO"

pip install pyserial

Now to blink an external LED:

import Adafruit_BBIO.GPIO as GPIO
import time


t = 0.5

    while True:
except KeyboardInterrupt:
    print 'user interrupted'


"GPS mouse"

My "GPS mouse" (often named "BU-353") works out of the box since it has a PL-2303 and is recognized by Linux.

BMP180 Pressure Sensor

Barometric pressure and temperature
I2C pins - confusion

I2C pins

The correct pins are in the "NAME" column, NOT the "MODE2" column. Wasted me over an hour of debugging.

This is a very useful command:
i2cdetect -y -r 1

Log I2C Sensor on Power Up

use cron:
first make your script executable by
chmod +x

then to edit the crontab file,
env EDITOR=nano crontab -e

"env EDITOR=nano" make sure the nano editor is used. I don't know how to use vim.

then add this line:
@reboot /usr/bin/python /home/root/

to verify the task, do this
crontab -l

you should see your task there.

Now just reboot and enjoy.

Resizing the Root Partition on a uSD Card

Several sources point to the same technique, but the method bricks the BBB (the uSD card) if run on Angstrom. Works fine on Debian though.

All Rights Reserved. Stanley Lio, 2014