Raspberry Pi Development so Far


With the help of this site, the brothers, Mathieu (http://openrovpi242.blogspot.com/2013/03/software-changes-for-pi.html) and several other sources; I have the OpenROV cockpit software running on my Raspberry Pi (Raspbian distro). There is currently no Arduino cape compatibility yet (I don't have an Arduino yet) but video streaming is successful!
Although other's have gotten this far and beyond with the Raspberry Pi, I haven't seen any walkthroughs posted for the Raspbian distrobution of RPi. Below are the steps I took to get this far and the problems I'm still having.

This assumes you have a clean install of Raspbian loaded on a Raspberry Pi with terminal access (I use ssh exclusively).

1. change hostname and hosts file to openrov-XXX

sudo vi /etc/hostname

delete hostname and replace with openrov-xxxx (where xxx is your serial number)

sudo vi /etc/hosts

(delete hostname and replace with same host name as above)

3.update and install prerequisite packages for openROV project:

sudo apt-get install g++ curl pkg-config libv4l-dev libjpeg-dev build-essential libssl-dev vim cmake git-core build-essential

4. install prerequisites (for the installation of mjpg-streamer)

sudo apt-get install subversion libv4l-dev libjpeg8-dev imagemagick

5. cd to /opt and use svn to install mjpg-streamer

cd /opt/

sudo svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer

(this is a different version of mjpg-streamer than is on the beagle bone but it appears to be the only one that I have been able to download successfully so far)

cd mjpg-streamer/mjpg-streamer

sudo make USE_LIBV4L2=true clean all

sudo make DESTDIR=/usr install

as part of a failed attempt to install mjpg_streamer-r-63, I copied /usr/include/linux/videodev2.h to videodev.h. I'm not sure if this is necessary.

6. plug in webcam and test mjpg_streamer

mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -r 640x480 -f 5" -o "/usr/lib/output_http.so -p 8090"

you can see the stream if you add the following line to an html page…

<img src="http://xxx.xxx.xxx.xxx:8090/?action=stream">

where xxx.xxx.xxx.xxx is the IP address of the Raspberry Pi

7. cd back into /opt and install node.js

cd /opt

sudo git clone https://github.com/joyent/node.git

cd node

sudo git checkout v0.8.11

sudo ./configure

sudo make //this part takes a loooooong time!

sudo make install

8. cd back into /opt and install ROV cockpit

cd /opt

sudo git clone git://github.com/openrov-software.git

sudo mv openrov-software openrov

cd openrov

export LD_LIBRARY_PATH=/usr/local/lib

source ~/.bashrc

9. install packages for node.js

cd /opt/openrov

sudo npm install express socket.io serialport nconf

10. reboot

sudo reboot

11. copy input_uvc.so and output_http.so to usr/local/lib/

sudo cp /usr/lib/input_uvc.so /usr/local/lib/

sudo cp /usr/lib/output_http.so /usr/local/lib/

12. Start the OpenROV app in a terminal session to look for errors

cd /opt/openrov/src/

node app.js

the camera light should come on and arduino firmware errors will start popping up on bash)

13. look at OpenROV cockpit via web browser


As I said, the Arduino Firmware error happens continuously but at least I can get an image through the cockpit window.

I did some duration testing and found that the Raspberry Pi seems to go brain dead after several hours of running the software. I'm pretty sure the issue is related to mjpg-streamer because I had the same results when I ran it alone (without calling node app.js). In the near future, I'm going to try r-63 again to see if I have better luck.


Nice! We found a way around the really long Node build:

1. Install NVM (Node Version Manager) from github.com/creathionix/nvm.git

2. Using that, install v0.8,11

3. Add "nvm use v0.8.11" to your .bashrc


Excellent! I’ll definitely try that out the next time I have to install the package.


It seems that I have had better success with the duration testing using mjpg-streamer-r-64. The following hack is required to install it on Raspberry Pi.

Step 4. No need to install subversion but other prerequisites seem necessary.

Step 5. Follow these steps instead...

cd /opt/

wget http://downloads.sourceforge.net/project/mjpg-streamer/mjpg-streamer/Sourcecode/mjpg-streamer-r63.tar.gz

tar zxf mjpg-streamer-r63.tar.gz

cd mjpg-streamer-r63

sudo make USE_LIBV4L2=true clean all

5a... Instead of using the package to install, manually copy the necessary files...

sudo cp mjpg_streamer /usr/bin

sudo cp output_http.so /usr/local/lib/

sudo cp input_uvc.so /usr/local/lib/

Proceed with step 6...

I have been able to get 24 hours + with no crashing using r63.