Project

General

Profile

Raspberry Pi IoT Setup » History » Revision 5

Revision 4 (Spencer Sutterlin, 06/10/2014 01:46 AM) → Revision 5/7 (Spencer Sutterlin, 06/10/2014 02:18 AM)

Raspberry Pi IoT Setup 
 ====================== 

 ## Cross-compile: 

 [[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 https://github.com/named-data/PyNDN2.git 
     
 git clone https://github.com/remap/ndn-pi.git 
     
 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 
 sudo vim /etc/modules # Add “ipv6” 
 # Copy/install ndn-cxx/NFD from VM to keep PYTHONPATH for PI 
 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 

     (Don't clear PYTHONPATH for root since GPIO sensors must be run as root) 
 wget https://bootstrap.pypa.io/get-pip.py 
     
 sudo python get-pip.py 
     
 rm get-pip.py 
     
 sudo pip install pycrypto 
     
 sudo pip install trollius 


 ## 
 ``` 

 If HDMI-CEC node, install libcec: node: 

 ``` 
 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 https://github.com/Pulse-Eight/libcec 
     
 sudo apt-get install autoconf libtool pkg-config 
     
 sudo apt-get install liblockdev1-dev libudev-dev 

     

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