How to prepare your BeagleBone to use as BBBmini.
- Debian 8.6 jessie
- GCC 4.9
- Kernel 4.4 PREEMPT RT
- BBBmini devicetree loaded at startup.
- Download Debian image https://rcn-ee.net/rootfs/bb.org/testing/2016-10-02/console/BBB-blank-debian-8.6-console-armhf-2016-10-02-2gb.img.xz
- Decompress image:
unxz BBB-blank-debian-8.6-console-armhf-2016-10-02-2gb.img.xz
- Use
lsblk
to find the address/dev/sdX
of your microSD device, such as/dev/sdc
./dev/sdX
should point to your microSD device, not partition, be careful here to make sure you don't wipe the wrong device or partition!!! Unplug your microSD card and run lsblk again then plug it back in, if you want to verify it's the correct device. - Copy image to microSD card (>= 2GB), the process can take 15-30 minutes depending on the speed of your microSD card:
sudo dd bs=4M if=./BBB-blank-debian-8.6-console-armhf-2016-10-02-2gb.img of=/dev/sdX status=progress
sync
and remove microSD
- Plug prepared microSD into BeagleBone
- While holding down the boot button, apply power to the board. If there is a newer Debian installed, holding down the boot button is not necessary.
- Wait some minutes until Debian is installed (all four LEDs turned on).
- Remove power.
- Remove microSD.
- Apply power again.
- Connect to the BeagleBone
ssh debian@beaglebone
- Password
temppwd
- Update software:
sudo apt update && sudo apt upgrade -y
- Install software:
sudo apt install -y bb-cape-overlays cpufrequtils g++ pkg-config gawk git make screen python python-dev python-lxml python-pip python-future
- Set link to pkg-config:
sudo ln -s pkg-config /usr/bin/arm-linux-gnueabihf-pkg-config
- Update scripts:
cd /opt/scripts && sudo git pull
- Expend partition:
sudo /opt/scripts/tools/grow_partition.sh
- Install RT Kernel:
sudo /opt/scripts/tools/update_kernel.sh --bone-rt-kernel --lts-4_4
- Add BBBmini DTB:
sudo sed -i 's/#dtb=$/dtb=am335x-boneblack-bbbmini.dtb/' /boot/uEnv.txt
- Add ADC DTBO:
sudo sed -i 's/#cape_enable=bone_capemgr.enable_partno=/cape_enable=bone_capemgr.enable_partno=BB-ADC/g' /boot/uEnv.txt
- Set clock to fixed 1GHz
sudo sed -i 's/GOVERNOR="ondemand"/GOVERNOR="performance"/g' /etc/init.d/cpufrequtils
- Reboot system:
sudo reboot
- Login again:
ssh debian@beaglebone
- Your BeagleBone is now ready to use.
cd ~
git clone https://github.com/ardupilot/ardupilot.git
cd ardupilot
-
- for ArduCopter
git checkout Copter-3.6.7
- for ArduPlane
git checkout ArduPlane-3.9.6
orgit checkout ArduPlane-beta
- for ArduRover
git checkout Rover-3.5.0
- for ArduSub
git checkout ArduSub-stable
orgit checkout ArduSub-beta
- for ArduCopter
git submodule update --init --recursive
./waf configure --board=bbbmini
./waf
(take about 1h20m)cp build/bbbmini/bin/* /home/debian/
Get the source code:
cd ~
git clone https://github.com/ardupilot/ardupilot.git
cd ardupilot
./Tools/scripts/install-prereqs-ubuntu.sh
-
- for ArduCopter
git checkout Copter-3.6.7
- for ArduPlane
git checkout ArduPlane-3.9.6
orgit checkout ArduPlane-beta
- for ArduRover
git checkout Rover-3.5.0
- for ArduSub
git checkout ArduSub-stable
orgit checkout ArduSub-beta
- for ArduCopter
git submodule update --init --recursive
./waf configure --board=bbbmini
./waf
scp build/bbbmini/bin/* debian@beaglebone:/home/debian/
Now you can check your hardware here.
ArduCopter:
sudo /home/debian/arducopter
(plus parameter)
ArduPlane:
sudo /home/debian/arduplane
(plus parameter)
ArduRover:
sudo /home/debian/ardurover
(plus parameter)
ArduSub:
sudo /home/debian/ardusub
(plus parameter)
Parameter mapping:
start parameter | ArduPilot serial port |
---|---|
-A | SERIAL0 |
-B | SERIAL3 |
-C | SERIAL1 |
-D | SERIAL2 |
-E | SERIAL4 |
-F | SERIAL5 |
Check http://ardupilot.org/copter/docs/parameters.html#serial0-baud-serial0-baud-rate to set the right value for SERIALx_BAUD
and SERIALx_PROTOCOL
To connect a MAVLink groundstation with IP 192.168.178.26 add -C udp:192.168.178.26:14550
To use MAVLink via radio connected to UART4 add -C /dev/ttyO4
.
If there is a GPS connected to UART5 add -B /dev/ttyO5
.
Example: MAVLink groundstation with IP 192.168.178.26 on port 14550 and GPS connected to /dev/ttyO5
UART5.
sudo /home/debian/arducopter -C udp:192.168.178.26:14550 -B /dev/ttyO5
Example: MAVLink groundstation via radio connected to UART4 and GPS connected to /dev/ttyO5
UART5.
sudo /home/debian/arducopter -B /dev/ttyO5 -C /dev/ttyO4
If ArduPilot should start automatically at boot time follow the instructions below:
- Connect to your BeagleBone via ssh with
ssh debian@beaglebone
- Edit
/etc/rc.local
withsudo nano /etc/rc.local
- Modify file to (use your ArduPilot file and parameter):
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/bin/sleep 10
/home/debian/arducopter -B /dev/ttyO5 -C /dev/ttyO4 > /home/debian/arducopter.log &
exit 0
- Save file:
Strg + o
+ Enter - Exit nano:
Strg + x
- Reboot BegaleBone with
sudo reboot