Raspberry Pi IoT Setup » History » Revision 6

« Previous | Revision 6/7 (diff) | Next »
Spencer Sutterlin, 06/10/2014 02:37 PM

Raspberry Pi IoT Setup


Cross-compiling NDN projects for Raspberry Pi

  • ndn-cxx
  • NFD

On the Pi:

Set up networking. Also, NFD uses ipv6 (as well as ipv4) so we need to enable that in the raspberry pi kernel because it's disabled by default.

nano /etc/network/interfaces # Tweak networking as desired
sudo vim /etc/modules # Add “ipv6”
sudo reboot

Install the essentials

sudo apt-get update
sudo apt-get install git vim
sudo apt-get install build-essential

Install libraries required by ndn-cxx, NFD, PyNDN2

sudo apt-get install openssl expat libpcap-dev
sudo apt-get install libssl-dev libsqlite3-dev libcrypto++-dev libboost-all-dev

Go git PyNDN2 and ndn-pi

mkdir ~/ndn
cd ~/ndn
git clone
git clone
echo "export PYTHONPATH=$PYTHONPATH:$HOME/ndn/PyNDN2/python:$HOME/ndn/ndn-pi" >> ~/.bashrc

Also since GPIO sensors must be run as root, environment variables are cleared. Specify to keep PYTHONPATH for sudo

sudo visudo # Add “Defaults   env_keep += “PYTHONPATH”

Copy/install cross-compiled ndn-cxx and NFD files (bin, etc, include, lib) from host to /usr/local on target (Pi).

Install required pip and python packages

sudo python
sudo pip install pycrypto
sudo pip install trollius

If HDMI-CEC node

Install libcec:

Can either be cross-compiled or compiled locally on the pi. Since it only needs to be done once, I just did it on the pi, but it took a bit. They do have a script for cross-compiling for the Raspberry Pi though.

cd ~/ndn
git clone
sudo apt-get install autoconf libtool pkg-config
sudo apt-get install liblockdev1-dev libudev-dev

./configure --with-rpi-include-path="/opt/vc/include" --with-rpi-lib-path="/opt/vc/lib " --enable-rpi --enable-debug
sudo make install
sudo ldconfig

Install protobuf

Since just a 1 time thing, I just did it on the pi, but it took a bit.

tar -zxf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0
make install

Updated by Spencer Sutterlin over 7 years ago · 6 revisions