Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

BBB Setup

alexmac22347 edited this page Nov 21, 2020 · 6 revisions

How to setup the Beaglebone Black from a fresh install.

Install operating system

download latest DEBIAN 9 image: https://beagleboard.org/latest-images
Debian 10 wont work. Java doesnt install properly and tinc also does not work properly (tun0 automatically gets set to down on startup)

download balenaEtcher https://www.balena.io/etcher/

Use it to flast the .img.zy image onto the beaglebone

Useful scripts

Paste in the config_pins.sh and receive_internet.sh scripts
recieve_internet.sh:

# receive internet from usb0
ifconfig usb0 192.168.7.2
route add default gw 192.168.7.1
echo nameserver 8.8.8.8 >> /etc/resolv.conf

config_pins.sh:

#!/bin/bash
# Enables CANbus
config-pin p9.19 can
config-pin p9.20 can

sudo ip link set can0 up type can bitrate 500000
sudo ifconfig can0 up
 
config-pin p9.11 uart
config-pin p9.13 uart
 
config-pin p9.24 uart
config-pin p9.26 uart
 
# print status of pins
config-pin -q P9.19
config-pin -q P9.20
config-pin -q P9.11
config-pin -q P9.13
config-pin -q P9.24
config-pin -q P9.26

Enable DHCP for ethernet

edit /etc/network/interfaces uncomment block below.

#auto eth0
#iface eth0 inet dhcp

Enable vcan0 on boot

add "vcan" to /etc/modules. add the following to /etc/network/interfaces:

auto vcan0
   iface vcan0 inet manual
   pre-up /sbin/ip link add dev $IFACE type vcan
   up /sbin/ifconfig $IFACE up

Enable tun0 (bugfix)

This is some sort of bug, but to get the VPN to work on this specific version of debian for the BBB, you need to manually add tun0 tun the interfaces file:

auto tun0
iface tun0 inet static
    address 10.0.0.3
    netmask 255.255.255.0
                                 

Setup tinc VPN

https://www.digitalocean.com/community/tutorials/how-to-install-tinc-and-set-up-a-basic-vpn-on-ubuntu-18-04

Expand file system partion

sudo /opt/scripts/tools/grow_partition.sh

Add swap

# dd if=/dev/zero of=/swapfile1 bs=1024 count=1048576
# chown root:root /swapfile1
# chmod 0600 /swapfile1
# mkswap /swapfile1
# swapon /swapfile1

append to /etc/fstab:
/swapfile1 none swap sw 0 0

install java (for jenkins)

sudo apt-get install default-jre

optional

lots of packages are out of date, so run an upgrade. install psmisc (useful killall tool)

remove unneeded stuff (nodejs, cloud9 ide, nodered) you may need to "install" c9-core-installer libnode-dev libnode64 nodejs first, and then uninstall (apt-get is confused)

apt-get upgrade
apt-get install psmisc 

systemctl disable nodered.socket
systemctl disable cloud9.socket

apt-get install c9-core-installer libnode-dev libnode64 nodejs # dumb step since apt-get cant uninstall them till its the latest version?
apt-get remove --purge c9-core-installer libnode-dev libnode64 nodejs nodejs-doc bb-node-red-installer