How to publish the raspberry streaming a live feed

raspberry streaming side viewI decided to publish my raspberry streaming from home a live feed of the yard in Haarlem.

I will assume you already have a raspberry streaming a livevideo feed.

To do so i need to use some sort of dynamic dns so i can link my home internet connection without taking care of the ip address. I decided for no-ip.com as i know it already and i know they have a linux client so i can install it directly on the raspberry.

This movie requires Flash Player 9

So step #1 is getting an account with no-ip.com or if you already have your favorite dynamic dns provider, just create a host or use the one already have.

Now since this point i will assume you have already an account and a host to be used for our purpose. To do this just create a host on no-ip.com without taking care about the ip addredd used there.

Download No-IP DUC for Linux

personally I downloaded the file directly on the Raspberry using a normal ssh connection. For your convenience i will paste here my dialog with the machine.

root@raspberrypi:~# cd /usr/src
root@raspberrypi:/usr/src# wget https://www.noip.com/client/linux/noip-duc-linux.tar.gz
root@raspberrypi:/usr/src# tar -xzf noip-duc-linux.tar.gz
root@raspberrypi:/usr/src/noip-2.1.9-1# make
root@raspberrypi:/usr/src/noip-2.1.9-1# make install

At this point you will be asked some question by the installer about your account credentials and the domain you want to keep up to date from this system.

Please enter the login/email string for no-ip.com  giuseppe@xxx.com
Please enter the password for user 'giuseppe@xxx.com'  ***********
Only one host [11010100110101010.zapto.org] is registered to this account.
It will be used.
Please enter an update interval:[30]  30
Do you wish to run something at successful update?[N] (y/N)  n

New configuration file '/tmp/no-ip2.conf' created.

mv /tmp/no-ip2.conf /usr/local/etc/no-ip2.conf

As you can see, there was just one host registered and it has been selected automatically. Otherwise, with more than one domain i don’t know exactly if the wizard will list the available hosts so you can at least copy/paste the one you want.

If you want to start over you can reconfigure your client typing:

noip2 -C

Anyway, this was easy. Let’s get the service started at boot: create a file under /etc/init.d with the following content:

nano /etc/init.d/noip

And add this content:

#######################################################
#! /bin/sh
# . /etc/rc.d/init.d/functions	# uncomment/modify for your killproc
case "$1" in
    start)
	echo "Starting noip2."
	/usr/local/bin/noip2
    ;;
    stop)
	echo -n "Shutting down noip2."
	killproc -TERM /usr/local/bin/noip2
    ;;
    *)
	echo "Usage: $0 {start|stop}"
	exit 1
esac
exit 0
#######################################################

add the No-IP client at startup:

chmod +x /etc/init.d/noip
update-rc.d -f noip defaults

 

At this point let’s see if this works already:

root@raspberrypi:/usr/src/noip-2.1.9-1# ping 11010100110101010.zapto.org
PING 11010100110101010.zapto.org (00.248.97.54) 56(84) bytes of data.
64 bytes from dhcp-000-248-097-054.chello.nl (00.248.97.54): icmp_req=1 ttl=64 time=1.53 ms
64 bytes from dhcp-000-248-097-054.chello.nl (00.248.97.54): icmp_req=2 ttl=64 time=6.77 ms
64 bytes from dhcp-000-248-097-054.chello.nl (00.248.97.54): icmp_req=3 ttl=64 time=20.5 ms
64 bytes from dhcp-000-248-097-054.chello.nl (00.248.97.54): icmp_req=4 ttl=64 time=1.19 ms

Of course it works!

Now: i have to map the 80 port of my router to the internal ip of the raspberry which,  has to be set as static (see how to setup a static ip address for raspberry pi).

My router uses dd-wrt, but I’ve been advised about openwrt. Anyway, this image describes how i managed to map the port to the internal ip address. If you have another router and if you are in troubles with this, don’t hesitate to ask me by comment.

dd-wrt screenshotAs you can see i had to use the port-range management insted of using the port forwarding management, because it simply doesn’t work on my version and on my router. But at this point if we try to open the webpage using the new hostname standing on the same network of the raspberry, we can’t because of a problem with dd-wrt and postrouting. So we need to type this command in the “administration”->”Commands” Form, run it and save it as firewall

iptables -t nat -I POSTROUTING -o br0 -s 192.168.2.0/24 -d 192.168.2.0/24 -j MASQUERADE

At this point you should be able to see your video feed on your browser. If you followed my tutorial about how to streaming with a webcam with a raspberry pi, you should have a live video feed available at http://ip.address.of.the.raspberry/test.swf. In this case it will answer on the new created hostname on no-ip at the same relative url, in my case:

http://11010100110101010.zapto.org

screenshot of the streaming video feed from raspberry

 

Using that hostname was too ugly so i decided to setup a cname for my domain giuseppeurso.net, in order to directly point to the ugly hostname:

RASPBERRY:GIUSEPPEURSO:NET => 11010100110101010.zapto.org

You can try to open my address if you want, maybe it works, but i don’t know how it does with multiple connections. 🙂

 

(Visited 2,011 times, 1 visits today)

Author: Giuseppe Urso

Giuseppe lives in Haarlem now with his shiny dog, Filippa In 1982 received his first home computer, a Commodore 64, followed by Datasette and a 1541 Floppy Disk Drive. In 1999 he installed his first Linux distro (LRH6). In 2006 he switched to Debian as favourite OS. Giuseppe Urso actively sustains the Free Software Fundation and his founder Richard Mattew Stallman, he speaks to people trying to convince them to join the fight now, and about how important is to use Free Software only. He has a job as Infra Specialist at Hippo Enterprise Java Cms an Open Source Enterprise class Content Management System, one of the coolest company ever, in Amsterdam. He's always ready to install Debian on other people computers for free.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.