Getting started with Bela » History » Version 30

Giulio Moro, 2016-03-08 12:19 AM

1 19 Giulio Moro
h1.  Getting started with Bela
2 1 Giulio Moro
3 1 Giulio Moro
h2. Prerequisites
4 1 Giulio Moro
5 1 Giulio Moro
Before starting, make sure you have:
6 1 Giulio Moro
* Beaglebone Black
7 20 Giulio Moro
* Bela cape
8 1 Giulio Moro
* standard-A to mini-B USB cable
9 1 Giulio Moro
* 2GB or more micro-SD card
10 3 Giulio Moro
* Optional, but recommended: up to two 3-ways female connectors for audio in/out from the cape. You will probably want some sort of stereo female jack connector at the other end.
11 1 Giulio Moro
12 1 Giulio Moro
h2. Hardware setup
13 1 Giulio Moro
14 1 Giulio Moro
Stack the audio cape on top of the Beaglebone Black (BBB). Make sure all the pins from the cape fit into the socket header of the BBB and that no pin gets bent in the process. 
15 1 Giulio Moro
16 1 Giulio Moro
h2. Software setup
17 1 Giulio Moro
18 20 Giulio Moro
Download the Bela SD card image here: 
19 20 Giulio Moro
20 11 Andrew McPherson
21 20 Giulio Moro
Uncompress the image using @xz@ (which you may have to install) and flash it onto the SD card. A card of at least 2GB is required. This image contains a Debian 7.7 distribution with Xenomai extensions which contains all the toolkits needed to compile and run Bela projects.
22 5 Giulio Moro
Insert the SD card into the BBB and plug it into your computer with the USB cable. The BBB will boot Debian and advertise itself to your computer as a network interface.
23 2 Giulio Moro
24 6 Giulio Moro
Communication between the BBB and the host pc takes place through the Ethernet over USB network connection. In order to log into the BBB you need an ssh client and you might need some network drivers according to your operating system, as detailed below.
25 6 Giulio Moro
26 1 Giulio Moro
h3. Linux users
27 1 Giulio Moro
28 6 Giulio Moro
All you need should be already on your machine, jump to *Test the ssh connection* below and have fun!
29 1 Giulio Moro
30 5 Giulio Moro
h3. MacOS users
31 5 Giulio Moro
32 29 Giulio Moro
* install network drivers for the BBB from and the serial drivers from . This requires a reboot.
33 23 Giulio Moro
34 25 Giulio Moro
Apparently HoRNDIS rel7 is not working properly on El Capitan. See instructions below for how to make it work (from: ), after having being through the steps above:
35 23 Giulio Moro
36 23 Giulio Moro
> * In the terminal with
37 24 Giulio Moro
>   <pre>$ sudo rm -rf /System/Library/Extensions/HoRNDIS.kext</pre>
38 24 Giulio Moro
> and
39 24 Giulio Moro
>  <pre>$ sudo rm -rf /Library/Extensions/HoRNDIS.kext</pre>
40 23 Giulio Moro
> * install HoRNDIS-rel8pre1.pkg 
41 23 Giulio Moro
> (from
42 23 Giulio Moro
> * reboot OSX
43 23 Giulio Moro
44 23 Giulio Moro
 * make sure the BBB is plugged in and booted up (might take up to one minute after you plug it in).
45 22 Giulio Moro
Everything might be already working now. Open a browser and go to http://localhost:3000, the IDE should show up.
46 21 Giulio Moro
47 23 Giulio Moro
In case the IDE is not showing up and the ssh test below fails, try the following:
48 5 Giulio Moro
* go to System Preferences->Network, click the + symbol at the bottom left. From the popup window, select "Beaglebone Black"
49 5 Giulio Moro
* now set the "Configure IP v4" field to "Using DHCP with manual address" and set the IP address to
50 5 Giulio Moro
51 5 Giulio Moro
* click apply and wait a few seconds, the indicator close to the icon should turn green
52 1 Giulio Moro
* jump to the *Test the ssh connection* section below to check that everything is working properly
53 22 Giulio Moro
Open a browser and go to http://localhost:3000, the IDE should show up. In case it does not, try the following:
54 1 Giulio Moro
55 5 Giulio Moro
h3. Windows users
56 5 Giulio Moro
57 26 Giulio Moro
* you will need a toolkit that allows you to use ssh and some other basic shell tools. The shell scripts in this project have been tested with *mingw* Make sure you install also a copy of rsync with it. You will want to note that in order to paste code into the mingw terminal you have to right click on the terminal's title bar and navigate the menu to edit->paste .
58 6 Giulio Moro
* additionally, you need to install the network drivers from (Windows 64 bit) or (Windows 32bit)
59 1 Giulio Moro
* in the network connections manually set thel IP address for the BBB to
60 9 Giulio Moro
61 22 Giulio Moro
* Open a browser and go to http://localhost:3000, the IDE should show up. In case it does not (or if it does but you plan to use ssh as well) jump to the *Test the ssh connection* section below to check that everything is working properly
62 1 Giulio Moro
63 1 Giulio Moro
h3. Test ssh connection
64 1 Giulio Moro
65 27 Andrew McPherson
When using the USB network connection, the BBB has a self-assigned IP of, we will log in with username *root* and an empty password (older images have a password 'a').
66 1 Giulio Moro
67 6 Giulio Moro
If you have gone through operating system-specific steps above, you should be able to connect to the beaglebone with
68 6 Giulio Moro
<pre>$ ssh root@</pre>
69 6 Giulio Moro
70 6 Giulio Moro
According to the settings of your ssh client, you might, or might not, be prompted with something along the lines of 
71 6 Giulio Moro
<pre>The authenticity of host ' (' can't be established.
72 6 Giulio Moro
RSA key fingerprint is 35:b2:ff:ae:c2:02:30:af:84:1e:0d:f5:c9:c8:4b:34.
73 1 Giulio Moro
Are you sure you want to continue connecting (yes/no)? </pre>
74 6 Giulio Moro
type @yes@ and press the return key.
75 6 Giulio Moro
76 6 Giulio Moro
If everything is ok, you will now be displayed the BBB prompt:
77 13 Andrew McPherson
<pre>root@arm ~#</pre>
78 6 Giulio Moro
79 22 Giulio Moro
h3. (Optional) ssh config and ssh keys setup
80 1 Giulio Moro
81 22 Giulio Moro
If you set a password on your beaglebone, ssh would require you to enter the password everytime you open a connection to the BBB. This will happen a few times during setup and then 3 times every time you build and run your project. To avoid quickly getting annoyed by this, you can use ssh keys. In the @scripts/@ you will find a setup script which
82 6 Giulio Moro
* generates (if not exists) a key-pair on your host machine (stored in @~/.ssh/@ )
83 6 Giulio Moro
* sets the @~/.ssh/config@ file
84 6 Giulio Moro
* copies the public key to the BBB
85 16 Giulio Moro
86 6 Giulio Moro
To do so, run the @./ if you are on Windows or @./ otherwise from the @scripts/@ folder
87 5 Giulio Moro
88 1 Giulio Moro
This way you will be able to log into the BBB simply typing:
89 7 Giulio Moro
<pre>ssh bbb</pre>
90 5 Giulio Moro
91 1 Giulio Moro
h2. Build your first project
92 4 Giulio Moro
93 20 Giulio Moro
Clone the Bela repository to your machine using Mercurial:
94 28 Andrew McPherson
<pre>hg clone</pre>
95 20 Giulio Moro
or download a zip file of the archive from 
96 10 Giulio Moro
97 20 Giulio Moro
Do you want to experience C++ development from a web browser? Open a new tab and you are ready for [[ Compiling Bela projects in a web browser]]
98 20 Giulio Moro
Do you want to get started immediately, without need to install any software on your machine? Grab a terminal and learn about  [[ Compiling Bela projects on the board]]
99 20 Giulio Moro
Do you want to turn your computer into a cross-compiling machine, with the advantages of an IDE and you are willing to put (some) effort into it? [[ Compiling Bela projects in Eclipse]]