Beagleboard

Nebula on Beagle

There are multiple versions of Beagleboard so the name is used generically. For this guide we are using a Beaglebone Black. It is another excellent Single Board Computer to use as a Nebula device. The main advantage of using a Beagleboard is that it has multiple I2C, SPI and UART peripherals. Also, built in hardware PWMs, analog inputs, and 2 Programmable Real-Time Units(PRU). Standard Linux is not real-time, the kernel cannot be interrupted, and some applications may need exact timing. There is however a real-time kernel available that can be installed on the Beagleboard called Linux-rt.

The Beagleboard is well documented, has a large community following and there are many hardware add-ons to expand its capabilities. Be aware that like most Single Board Computers(SBC) the Beagleboard software is constantly evolving and improving. Don’t rely on years old internet posts for accurate information.

Setup Beagle

Complete ready-to-run Linux for a particular hardware platform is referred to as an image. Beagleboards can run with the image on SD card or on some board versions the image may be flashed to on-board eMMC storage. If you want to become familiar with Beagleboard see this and the official HOMEPAGE .

This setup guide generally follows the recommended one With a few added tips and directions for setup and installing Java so Nebula can run.

  • Working with Beagleboards requires some software tools

    1. To flash the image to an SD card download and install Etcher for your OS.

    2. For Windows to be able to extract .tar.gz files get 7-zip .

  • If you are experienced and want to install the latest kernel, real-time image or Ubuntu 18.04. Use this guide .

  • If you just want an Ubuntu image or a headless Ubuntu server.

  • In any event, once the board is up and running, you will have to Install Java to run Nebula.

The following guide assumes you are using a Beagleboard with the “Debian 9.9 2019-08-03 4GB SD LXQT” (with GUI) download (it’s now in Older Debian Images. Latest is AM3358 Debian 10.3 2020-04-06 4GB SD IoT). The Terminal commands used in this guide should work regardless, they’re all Debian Linux. The Ubuntu, Angstrom or other images may be slightly different but issues can usually be resolved with a Google search of the issue.

1. Start by downloading the latest image . Make sure your board is covered in the list below the download. The Debian image is available with(LXQT) or without(IoT) GUI. Either is OK depending on intended use. GUI versions are large and may not fit in the 4GB eMMC, so they should be run from SD card. There is also a “Flasher” image without GUI for flashing into the eMMC.

2. Use Etcher to extract the image download to an SD card.

  • Use at least an 8GB class 10 SD card.
  • Insert the card in your SD card writer.
  • Open Etcher and select the downloaded image file, select your SD card, click Flash and be patient.

3. After you have copied the image on a micro SD card, insert it into the powered-off BBB.

  • Connect a keyboard, mouse (you may need a USB hub to connect both) and display to the Beagleboard.
  • Use a 5V at 2A external power source as USB power may not work.

4. While holding down the BOOT button (by the SD card) on the Beagleboard, apply power to the board. Continue to hold the BOOT button until the USER LEDs begin to flash. After a few minutes your screen should show a Beagleboard desktop.

Open System Tools > QTerminal and remember these:

  • User is: debian
  • Password is: temppwd
  • Note: echo is turned off for typing in password

5. Regardless of the SD card size you used, the image and the partition it resides on is 4GB and the file system takes up almost all of it. Expand the partition to the size of your SD card so you have space to install additional programs, review this link then run these commands:

sudo /opt/scripts/tools/grow_partition.sh
sudo systemctl reboot

The reboot takes a couple of minutes.

6. Update and upgrade the software.

Update the package repositories. Takes about 2 minutes.

sudo apt update

Upgrade the packages. Takes 20 minutes to an hour depending on the number of packages and your network speed.

sudo apt upgrade

Remove any unused packages.

sudo apt autoremove

7. Everyone knows the default username and password. Make yourself the default user, with your secret password and “sudo” privileges. Starting from debian@beaglebone:~$

sudo su root
The password is still: temppwd
The prompt changes to: root@beaglebone:/home/debian#
adduser yourname
Enter new UNIX password: secret
Retype new UNIX password: secret

passwd: password updated successful
Changing the user information for username
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:

Is the information correct? [Y/n] y

7.1 Make yourself a sudodoer

usermod -aG sudo YourUserName

7.2 Switch user to yourself; use your secret password entered above.

su YourUserName

7.3 Elevate yourself to root using your secret password and switch to your home.

sudo su
cd /home/YourUserName

7.4 Kill all processes owned by the default(debian) user.

killall -u debian
  • The screen will close and reopen with user login.
  • Login with your new credentials
  • Open System Tools > QTerminal

7.5 Remove the default user for security.

sudo userdel -r debian

8. Set auto-login to YourUserName

sudo nano /etc/lightdm/lightdm.conf
About 2/3 down the file find the line “autologin-user=debian”
Change the user from debian to YourUserName
Save and exit nano - Ctl X > y to save > Enter for same filename.

Setup WiFi

Optional, an Ethernet connection to your router is perfectly acceptable but if it’s impracticable, continue with the WiFi setup.

  • It’s important to use a Supported WiFi adapter.
  • Galixsys Networks has had good success with Keebox N 150 USB wireless adapter.
  • Use Connman to setup the initial connection. If you are using the Debian LXQT desktop installation, you can go to Internet > Connman UI Setup
  • The rest of this section is the command line setup.

Start connman

sudo connmanctl

Enable wifi

connmanctl> enable wifi

Reply: Enabled wifi

connmanctl> scan wifi

Reply: Scan completed for wifi

connmanctl> services

Reply: A list of SSIDs found. Note the one you want to connect to. It will show the SSID name, but the important part looks similar to this: wifi_f46d04b1d5aa_7269636e6a6163_managed_psk

connmanctl> agent on

Reply: Agent registered

Connect to the SSID noted above

connmanctl> connect wifi_f46d04b1d5aa_7269636e6a6163_managed_psk
Reply:
Agent RequestInput wifi_f46d04b1d5aa_7269636e6a6163_managed_psk
Passphrase=[ Type=psk, Requirement=mandatory, Alternates=[ WPS ] ]
WPS=[ Type=wpspin, Requirement=alternate ]
Passphrase? wifi_password <- Enter the Password

Reply: Connected wifi_f46d04b1d5aa_7269636e6a6163_managed_psk

Done, quit connman

connmanctl> quit

Getting networks up and running reliably can sometimes be tricky. Following are some helpful websites:

Install Java

Recommend is getting the Java download on your development computer and copy it over to the Beagleboard, especially if you do not already have an Oracle account and must have to set one up before you can download. Beagleboard screens are sluggish compared to Raspberry Pi. While the processor is faster, the graphics processing is much slower.

Go to Java downloads and get Linux ARM 32 Hard Float ABI.

sudo mkdir /opt/java
sudo mv $HOME/Downloads/jdk*.tar.gz /opt/java
cd /opt/java
sudo tar -zxf jdk-8*.tar.gz
sudo chown -R root:root /opt/java

Optional: Delete the Java tar.gz file: rm jdk*.tar.gz

Add Java to your path.

cd ~
nano .bashrc

The latest Beagleboard image does not have sbin or /usr/sbin in the path. You can read about the reasoning here. They contain many useful commands that you shouldn’t have to precede with sudo to use. We’ll add them as well as Java to the path. Append the following line to the end of the .bashrc file.

export PATH=$PATH:/sbin:/usr/sbin:/opt/java/jdk1.8.0_241/bin

To set and use the new path.

source .bashrc

Check the Java install.

which java

See reply: /opt/java/jdk1.8.0_241/bin/java

java -version

See reply: java version “1.8.0_241”

Optional Settings

1. Set the date and time.

sudo dpkg-reconfigure tzdata

2. Change the hostname. The default is “beaglebone”. Edit and save a new name.

sudo nano /etc/hostname

Also, edit the /etc/host file. Edit the line which reads: 127.0.1.1 the-old-hostname so that it now contains your new hostname. This is required otherwise many commands will cease functioning.

sudo nano /etc/hosts

Reboot

sudo systemctl reboot

3. Add screen saver and/or screen locking. There are monitors and TVs that shut down when no signal is available. It may become difficult to get them to come back on after the Beagleboard goes to sleep. After installing XScreenSaver go to Preferences > Screensaver to set it up.

sudo apt install xscreensaver

4. On Beaglebone port 80 is used by bonescript. If you want to use port 80 for Nebula, disable bonescript. To reenable bonescript, run the same 4 commands with enable instead of disable. Note that the Nebula installation allows you to select the network connection to use and port 80 is not allowed on Android APK devices and Nebula doesn’t use bonescript. So it’s best to disable it.

sudo systemctl disable bonescript.service
sudo systemctl disable bonescript.socket
sudo systemctl disable bonescript-autorun.service
sudo systemctl reboot

Setup VNC

The following must all be done by root, so to avoid typing sudo in front of every command.

sudo su

Remove the tightvncserver package.

apt purge tightvncserver

Install the x11vnc package.

apt install x11vnc

Make a systemd service file.

nano /lib/systemd/system/xvnc.service

Add the following to the file. Thanks to and additional tips at: https://blupa.info/books/short-linux-guides/page/x11vnc-systemd-service-xubuntu-1804-%28lightdm%29

[Unit]
Description=x11vnc VNC Server for X11
Requires=lightdm.service
After=lightdm.service

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -display WAIT:0 -forever -shared -rfbport 5900
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
RestartSec=2
SuccessExitStatus=3

[Install]
WantedBy=graphical.target

Enable the service so it’s available after boot-up.

systemctl enable xvnc.service

Reboot the Beagleboard.

systemctl reboot

Exit root.

exit

You can now use RealVNC Viewer on your development computer to control the Beagleboard. This is the same viewer that Raspberry Pi uses.

For a cleaner look with multiple Nebula devices, just like Raspberry Pi, it is best to setup SSH with Xterm on Beagleboards too.