Steve Karg - 2019-07-28

Compiling natively on Beaglebone Black Debian Stretch
note: this is for compiling and running the BACnet demos under debian stretch.

requirements
Beaglebone Black (or any of the variants green, blue, industrial, pocket…)
SD card with Debian Stretch IoT or Stretch Console. The console version is minimal and recommended. The instructions also work under the Debian Stretch LXQT desktop version.
Router with Ethernet Internet connection for the Beaglebone Black
Laptop connected to same network as the Beaglebone Black

Hardware setup
1. Connect an Ethernet cable from the network router to the Beaglebone Black
2. Insert the SD card
3. Connect USB power from a 5V@1A power supply

Update the system and install required libraries
1. ssh debian@beaglebone #from your laptop, default password is temppwd
2. sudo passwd debian #change password
3. sudo /opt/scripts/tools/grow_partition.sh #expand file system. skip if you are running on the emmc
4. sudo reboot #and log in again with ssh
5. sudo apt-get update
6. sudo apt-get upgrade
7. sudo apt-get dist-upgrade
8. sudo apt-get install build-essential subversion-tools

Get the BACnet Stack source and compile
1. svn checkout http://svn.code.sf.net/p/bacnet/code/trunk/bacnet-stack/
2. cd bacnet-stack
3. make clean all
4. ./bin/bacserv 1234

how to automatically bacserv demo at system boot

nano ~/autostart.sh #and add the following lines (ctrl+o, ctrl+x to save and exit)…

#!/bin/bash
~/bacnet-stack/bin/bacserv 1234

Make the autostart executiable:
chmod +x ~/autostart.sh
crontab -e #and add the following line to the end…

@reboot cd /home/debian && ./autostart.sh

notes and additional information

  • an easy way to burn the img.xy file (no need to unpack) to a sd card is to use etcher.
  • if you get WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! when trying to ssh in, type ssh-keygen -R beaglebone to reset.
  • to avoid sd card corruption one should always shut down the system properly and not just pull out the 5v power. when running headless you can either ssh in and type sudo halt -p, use a gpio pin with a button + python script

These instructions were created after I modified the following instructions to suit the BACnet project. Thank you to supercollider project!
https://supercollider.github.io/development/building-beagleboneblack

 

Last edit: Steve Karg 2019-07-28