A couple weeks ago I went on vacation and borrowed a the Foscam that we normally have watching our dogs and since then I've really wanted to get a camera for the tank, but I love to tinker and wanted full 1080P HD so I started looking around and stumbled onto the Raspberry Pi & RPi Camera module so I set to work, it took a while to figure out all the moving pieces so I've put together the following tutorial to try to simplify it for others and remind myself how I did it for when I setup another one to watch my sump here in the near future. Enough about me, onto the how-to:
Start with this basic tutorial on how to setup "MJPG-Streamer on the Raspberry Pi". Stop at the end of step 6. Step 7 & 8 will need to be done everytime you restart your Raspberry Pi so I've created the following scripts to do that automatically:
1. Login to your Raspbery Pi.
2. sudo su
3. vi /etc/init.d/raspi-stream
Code:
#!/bin/sh
/root/start-raspi-stream.sh
(Hit esc, then :wq to write the file and close out of the text editor)
4. vi /root/start-raspi-stream.sh
Code:
#!/bin/sh
# Kill any existing raspistill processes.
ps -ef | grep raspistill | grep -v grep | awk '{print $2}' | xargs kill -9
# Create temp directory for streaming
mkdir /tmp/stream
# Start the raspicamera running in the background
nohup raspistill --nopreview -w 1440 -h 1080 -q 5 -o /tmp/stream/pic.jpg -tl 1 -t 9999999 -th 0:0:0 >/dev/null 2>&1 &
# Pass the image path to the streaming service
LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -w /usr/local/www"
(Hit esc, then :wq to write the file and close out of the text editor)
5. chmod ugo+x /etc/init.d/raspi-stream
6. update-rc.d raspi-stream defaults
7. Setup Fusiona. If you haven't already, add the webcam tile to your dashboard.
b. Click on the gear for the webcam tile to get to settings.
c. Click the plus sign to add the stream
d. Name it something useful
e. Change the level to view
f. Change the type to Image/Motion JPEG
g.
http://yoururl.net:8080/?action=stream (In order for Apex Fusion to be able to display the stream you'll need to have setup port forwarding, if using the defaults in the tutorial above the port you'll need to forward is port 8080)
Bookmarks