Skip to content

Latest commit

 

History

History
199 lines (154 loc) · 7.03 KB

beaglebone-black.md

File metadata and controls

199 lines (154 loc) · 7.03 KB

BeagleBone Black

Contributor: https://github.com/srickardti

OpenThread Border Router (OTBR) provides support for the BeagleBone Black (BBB) platform.

Hardware requirements:

  • External 5V AC adapter for power
  • An 8 GB or larger microSD card ("uSD card" in this guide)
  • A supported OpenThread platform (such as the TI CC2652) for Thread network connectivity in an RCP design

Steps to enable:

  1. Download and install the OS.
  2. Prepare the Debian Environment for OTBR
  3. (Optional) Enable Wi-Fi
  4. Build and install OTBR

Step 1: Download and install the OS

  1. Download the latest Debian IoT image for BeagleBone.
    • The version used for this guide was bone-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz
  2. Install the OS image on a uSD Card by following the BeagleBone getting started guide.
  3. Boot the BeagleBone and SSH into the device.
    • Connectivity over a local Ethernet based network is recommended.
    • The cloud9 IDE will be disabled later in this guide.
    • This guide will change the state of BeagleBone network interfaces, be aware your secure shell session may disconnect.
    • Modern BeagleBone bootloaders will run from the uSD card by default, but some BeagleBone Black devices may try to boot from the internal eMMC. Make sure to press the BOOT Button in this case.

Warning: The power requirements of the development kit used for the OpenThread RCP may be too great for the power that can be supplied from a computer's USB port. It is recommended that you use the 5V power adaptor for the BeagleBone where applicable.

For more detailed information on the BeagleBone, see the BeagleBoard Support Page.

Step 2: Prepare the Debian Environment for OTBR

The filesystem for the uSD BeagleBone image is limited to 4GB to fit on most uSD cards. Expand the partition to enable usage of the entire storage capacity.

$ sudo /opt/scripts/tools/grow_partition.sh

You are encouraged to read that helper script to find out how the filesystem is expanded. You will have to reboot the BeagleBone and re-login to use this new filesystem definition.

$ sudo shutdown -r now

This will close your SSH session. Once you are logged back in you may skip to building the OTBR code.

Step 3: (Optional) Enable Wi-Fi

Note: The BeagleBone Black does not have built-in Wi-Fi support. This guide was built and tested with a BBONE-GATEWAY-CAPE for Wi-Fi AP operation. Some BeagleBone variants have onboard Wi-Fi capability, and some of this guide may be applicable. Connman is used by the generic BeagleBone distribution for Wi-Fi connectivity, you are encouraged to look at the configuration options available in the files /etc/default/bb* and the setup scripts /usr/bin/bb*. This package may be more applicable to your application.

Once logged back into the BeagleBone, install Network Manager:

$ sudo apt-get update
$ sudo apt-get install network-manager

Then disable connman and enable network-manager:

$ sudo systemctl disable connman
$ sudo systemctl enable network-manager

If we were to stop connman directly here it would break the SSH session because the network interface is managed by connman. Instead we configure the system to take effect on the next boot. Now reboot the Beaglebone and re-login.

$ sudo shutdown -r now

Network Manager may not have setup the DNS name servers. Edit resolv.conf with the command sudo vim /etc/resolv.conf and make sure the contents contain the Google DNS and Cloudflare DNS:

nameserver 8.8.8.8
nameserver 1.1.1.1

Restart to make sure Network Manager is setup correctly.

$ sudo shutdown -r now

The WiLink 8 module does not like to have its MAC address changed at runtime. Network Manager will try to do this when scanning. Edit the NetworkManager.conf with the command sudo vim /etc/NetworkManager/NetworkManager.conf and add the lines below:

[device]
wifi.scan-rand-mac-address=no

The BBONE-GATEWAY-CAPE is not recognized by the BeagleBone by default because of a pin conflict. Add the configuration manually by editing the uEnv.txt with the command sudo vim /boot/uEnv.txt and make sure the following lines match:

#Custom Cape
dtb_overlay=/lib/firmware/BB-GATEWAY-WL1837-00A0.dtbo
#
#Disable auto loading of virtual capes (emmc/video/wireless/adc)
disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
disable_uboot_overlay_adc=1

The BeagleBone wilink setup scripts try to use connman by default to enable Wi-Fi AP activity. Edit the default configuration folder with the command sudo vim /etc/default/bb-wl18xx and make sure the variables match below:

TETHER_ENABLED=no
USE_CONNMAN_TETHER=no

Restart to make sure Network Manager can see the new interface.

$ sudo shutdown -r now

Once logged back in you can run ifconfig or nmcli to see the new wlan interface.

Warning: The startup scripts may take a few moments to enable the wlan0 interface. If you do not see the interface, check journalctl to see if the system is having difficulty bringing up the interface.

Don't forget to pass the options NETWORK_MANAGER=1 and NETWORK_MANAGER_WIFI=1 to the setup script in the next step to use Network Manager.

Step 4: Build and install OTBR

See Build and Configuration for instructions on building and installing OTBR.

License

Copyright (c) 2021, The OpenThread Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.