Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Compile AllJoyn on the Raspberry Pi
# make sure you have installed the latest Raspbian OS
# similar instructions for Ubuntu are available here:
sudo apt-get install build-essential
sudo apt-get install maven
sudo apt-get install scons
sudo apt-get install git
sudo apt-get install curl
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install libjson0
sudo apt-get install libjson0-dev
mkdir ~/bin
echo "export PATH=$PATH:~/bin" >> ~/.bashrc
curl > ~/bin/repo
chmod a+x ~/bin/repo
source ~/.bashrc
mkdir -p ~/WORKING_DIRECTORY/alljoyn
git config --global "YOUR_NAME_HERE"
git config --global "YOUR_EMAIL_HERE"
repo init -u
repo sync
export AJ_ROOT=$(pwd)
sudo ln -s /usr/bin/g++ /usr/bin/arm-angstrom-linux-gnueabi-g++
sudo ln -s /usr/bin/gcc /usr/bin/arm-angstrom-linux-gnueabi-gcc
cd ~/WORKING_DIRECTORY/alljoyn/core/alljoyn
scons OS=linux CPU=arm WS=off OE_BASE=/usr BINDINGS=cpp,c,java,js,objc,unity #please check the IMPORTANT comments below before running
sudo ln -sf ~/WORKING_DIRECTORY/alljoyn/core/alljoyn/build/linux/arm/debug/dist/cpp/lib/ /lib/arm-linux-gnueabihf/
cd ~/WORKING_DIRECTORY/alljoyn/core/alljoyn/build/linux/arm/debug/dist/cpp/bin
ldd alljoyn-daemon #daemon not available in latest versions of alljoyn, use BR=on with scons for embedded daemon
./alljoyn-daemon --version
After executing alljoyn-daemon --version, you should see something like the following:
AllJoyn Message Bus Daemon version: v0.0.1
Copyright (c) 2009-2014 AllSeen Alliance.
Build: AllJoyn Library v0.0.1 (Built Fri Aug 22 05:36:57 UTC 2014 by pi - Git: alljoyn branch: '(no branch)' tag: 'v14.06' (+146 changes) commit ref: d611c623c14fb4d404253f39a4641bee518708b9)
In the line:
scons OS=linux CPU=arm WS=off OE_BASE=/usr BINDINGS=cpp,c,java,js,objc,unity
the BINDINGS determine which platforms you build for (options are cpp, c, objc, java js and unity).
CPP, C: For running the deamon you'll only need to build for cpp but maybe you also want the other platforms.
JAVA: don't use OpenJDK, set Java to oracle-java7-jdk as explained below:
sudo apt-get install oracle-java7-jdk
export JAVA_HOME="/usr/lib/jvm/jdk-7-oracle-armhf"
echo "export PATH=$PATH:$JAVA_HOME/bin" >> ~/.bashrc
JS: If you also want to compile for js you need to add js to the bindings but you'll have to download xulrunner from here:
and set the GECKO_HOME variable to point to that uncompressed directory (only the headers are used).
UNITY: to compile for Unity you'll have to install the Mono runtime and gcms:
sudo apt-get install mono-runtime
sudo apt-get install mono-gmcs
GTEST: If you want to build all the unit tests please follow the section googletest in this document:
and export GTEST_DIR with your path to the uncompressed file
BULLSEYE: References to missing variable BULLSEYE_BIN can be safely ignored.
Bullseye is code coverage analysis tool used by the alljoyn team but unfortunately it's not free or open source so I couldn't download it:
SERVICES: you can specify which alljoyn services to build as a scons parameter ( eg. SERVICES=about,audio )
Thanks to Mike Young whose initial setup description helped create this updated guide:
Once you're all set up with the previous section you can also build AllJoyn audio service (enables audio streaming):
cd ~/WORKING_DIRECTORY/alljoyn/core/alljoyn/services/audio
scons OS=linux CPU=arm WS=off SERVICES=about,audio BUILD_SERVICES_SAMPLES=off BINDINGS=core,cpp OE_BASE=/usr
If you get a compilation error in the AudioMixerThread method (in file src/posix/ locate the line with the error and remove the 3rd parameter (false) in the source code (leave the first 2 parameters only).
Please follow the instructions here:
and apply this patch if you need Android 5 support:
This is how you install the js version of AllJoyn without building it yourself (thx to oskarhane for the original instructions):
#Make a new dir where you'll put the binary
sudo mkdir /opt/node
#Get it
tar xvzf node-v0.10.28-linux-arm-pi.tar.gz
#Copy to the dir you made as the first step
sudo cp -r node-v0.10.28-linux-arm-pi/* /opt/node
#Add node to your path so you can call it with just "node"
cd ~
nano .bashrc
#Add these lines to the file you opened
export PATH
#Save and exit
#Install npm package of AllJoyn contributed by octoblu
npm install -g alljoyn
#Warning: only discovery, messaging and notifications supported as of this writing
If node is not found even after adding it to the path maybe you're sudoing and the environment variables are not being passed. Try adding the path /opt/node/bin to the /etc/sudoers file

This comment has been minimized.

Copy link

@heavenfreshca heavenfreshca commented Oct 6, 2014

Hi germanviscuso,

I am trying to do these steps and after executing this command:
scons OS=linux CPU=arm WS=off OE_BASE=/usr BINDINGS=cpp,c

the ubuntu terminal displayed these:
scons: Reading SConscript files ...
CROSS_COMPILE variable is required for Linux/ARM builds

when I tried to update my last command to this:
scons OS=linux CPU=arm WS=off OE_BASE=/usr BINDINGS=cpp,c CROSS_COMPILE=on

the terminal displayed an error:
scons: done reading SConscript files.
scons: Building targets ...
[CC] alljoyn_c/test/bbcclient.c
sh: 1: ongcc: not found

Please let me know what needs to be done with this issue.

Thank you very much,


This comment has been minimized.

Copy link

@gbr-3068 gbr-3068 commented Nov 28, 2014



This comment has been minimized.

Copy link

@ShigeMaeda ShigeMaeda commented Feb 4, 2015

Hello germanviscuso,

After I did avobe steps, I can not found ~/WORKGOUP/core/alljoyn/build/linux/arm/debug/dist/ directory.
I can found only ~/WORKGOUP/core/alljoyn/build/linux/arm/debug/obj directory.
Could you let me know how to make missing directory?

Best Regards,


This comment has been minimized.

Copy link

@truedat101 truedat101 commented Mar 12, 2015

Tip here for the armv7 peeps:

The goofy defaults in the build are for raspi but they won't work for other platforms like the BBB.


This comment has been minimized.

Copy link

@uofubry uofubry commented Jun 25, 2015

I do not have the ~/WORKING_DIRECTORY/alljoyn/core/alljoyn/services/audio directory. The only thing in the services directory is about. I looked at the source tar balls and none of the recent ones have the audio directory either.


This comment has been minimized.

Copy link

@kurtng kurtng commented Oct 28, 2015

I had to run
sudo apt-get update
sudo apt-get install libssl-dev
before as I was getting errors saying that it could not find some openssl header file.


This comment has been minimized.

Copy link

@ghost ghost commented Jul 9, 2017

gpg: keybox '/root/.repoconfig/gnupg/pubring.kbx' created
gpg: /root/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 16530D5E920F5C65: public key "Repo Maintainer <>" imported
gpg: key 67B7E448692B382C: public key "Conley Owens <>" imported
gpg: Total number processed: 2
gpg:               imported: 2
   35d2221..259f165  master     -> origin/master

Traceback (most recent call last):
  File "/root/repo", line 883, in <module>
  File "/root/repo", line 871, in main
    os.execv(sys.executable, me)
TypeError: execv() arg 2 must contain only strings
The command '/bin/sh -c /root/repo init -u' returned a non-zero code: 1

The repo line should be repo init -u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment