bjornatic
Posts: 20
Joined: Wed May 15, 2013 4:44 pm

From Pi to Pi camera streaming

Thu May 16, 2013 5:01 pm

Ok, I'm quite new to this, please be nice. :oops:
Yesterday I got my two brand new RaspPi and one camera board. I did all the updates and followed all the steps given here.

I'm trying to feed the stream of the Camera Bord (Pi1)to another Pi (Pi2) in the network.

So I followed the steps :
To view the feed on a Raspberry Pi (Pi2):

Code: Select all

mkfifo buffer
nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin buffer
To transmit the feed from the Pi (Pi1) with camera module attached

Code: Select all

raspivid -t 999999 -o – | nc 192.168.1.12 5001
On the recieving Pi i get the folowing error : "-bash: /opt/vc/src/hello_pi/hello_video/hello_video.bin: Aucun fichier ou dossier de ce type"

Wich should be translated in "no file or directory of this kind"...

This is very likely a noob question... that is why I m looking for the solution all over the web since hours... You are my last hope :lol:

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: From Pi to Pi camera streaming

Thu May 16, 2013 5:13 pm

bjornatic wrote:Ok, I'm quite new to this, please be nice. :oops:
Yesterday I got my two brand new RaspPi and one camera board. I did all the updates and followed all the steps given here.

I'm trying to feed the stream of the Camera Bord (Pi1)to another Pi (Pi2) in the network.

So I followed the steps :
To view the feed on a Raspberry Pi (Pi2):

Code: Select all

mkfifo buffer
nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin buffer
To transmit the feed from the Pi (Pi1) with camera module attached

Code: Select all

raspivid -t 999999 -o – | nc 192.168.1.12 5001
On the recieving Pi i get the folowing error : "-bash: /opt/vc/src/hello_pi/hello_video/hello_video.bin: Aucun fichier ou dossier de ce type"

Wich should be translated in "no file or directory of this kind"...

This is very likely a noob question... that is why I m looking for the solution all over the web since hours... You are my last hope :lol:
It looks like you haven't compiled hello_video. Follow the instructions in the README file located at: /opt/vc/src/hello_pi

So make the libraries first. Then cd into the hello_video directory and type make. That will then create the /opt/vc/src/hello_pi/hello_video/hello_video.bin file

bjornatic
Posts: 20
Joined: Wed May 15, 2013 4:44 pm

Re: From Pi to Pi camera streaming

Thu May 16, 2013 6:26 pm

Yep. the "README" file... :roll:

Ok, now I do not have the error anymore... But I have no video feed neither.

I still believe I'm in fault, but I start to wonder if my router (livebox) is doing something wrong...

I tried on my Lubuntu desktop with

Code: Select all

nc -l 5001 | mplayer -fps 31 -cache 1024 -
And it does not work neither. I get a "no socket connection" error.

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: From Pi to Pi camera streaming

Thu May 16, 2013 6:33 pm

bjornatic wrote:
I tried on my Lubuntu desktop with

Code: Select all

nc -l 5001 | mplayer -fps 31 -cache 1024 -
And it does not work neither. I get a "no socket connection" error.
Have you changed the IP address on the command transmitting the video to use the IP address of your Lubuntu desktop?

I too am having fun trying to stream, but right now my issue is with streaming to Windows. First Norton Auto-protect blocked the nc.exe file, and now it's blocking 5001 traffic from getting to nc :-) What fun trying to convince it that I want the traffic to get through!!

bjornatic
Posts: 20
Joined: Wed May 15, 2013 4:44 pm

Re: From Pi to Pi camera streaming

Fri May 17, 2013 7:30 am

fbutler wrote:[
Have you changed the IP address on the command transmitting the video to use the IP address of your Lubuntu desktop?
Yes yes, I did :)

And Norton is pure Evil, get rid of it !!

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: From Pi to Pi camera streaming

Fri May 17, 2013 7:38 am

bjornatic wrote:
Yes yes, I did :)

And Norton is pure Evil, get rid of it !!
So is it working now?
As for Norton, it's mostly harmless once you get it under control :-)

bjornatic
Posts: 20
Joined: Wed May 15, 2013 4:44 pm

Re: From Pi to Pi camera streaming

Fri May 17, 2013 11:24 am

Nope, not at all.

I tried to direcly link the lubuntu desktop with the Pi and manually configuring the IP's.. But still no change.

Now I'm back to my original network configuration and I'm focusing on making the streaming work from one Pi to the other.

So I launch both command :

Pi1

Code: Select all

raspivid -t 999999 -o – | nc 192.168.1.10 5001
and
Pi2

Code: Select all

nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin buffer
In the mean time I learned about the "netstat -at" command wich gives me :
Pi2
tcp 0 0 Pi2:5001 Pi1:56308 ESTABLISHED

So, from what I undersant, the connection is established on port 5001 between the 2 pi's... but nothing is streaming...

What am I doing wrong ??

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: From Pi to Pi camera streaming

Fri May 17, 2013 11:53 am

bjornatic wrote:What am I doing wrong ??
Did you do mkfifo buffer? Other than that your command lines look identical to those that I'm using successfully as far as I can see.

bjornatic
Posts: 20
Joined: Wed May 15, 2013 4:44 pm

Re: From Pi to Pi camera streaming

Fri May 17, 2013 12:06 pm

Yes I did.

prw-r--r-- 1 pi pi 0 mai 16 19:41 buffer
-rwxr-xr-x 1 pi pi 126222 mai 16 19:41 hello_video.bin

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: From Pi to Pi camera streaming

Fri May 17, 2013 12:23 pm

bjornatic wrote:Yes I did.

prw-r--r-- 1 pi pi 0 mai 16 19:41 buffer
-rwxr-xr-x 1 pi pi 126222 mai 16 19:41 hello_video.bin
I'm stumped. :? Here's the exact cut and pasted command lines that I am using in case you can see any difference

Sender:

Code: Select all

pi@raspbi1 ~ $ raspivid -t 999999 -o - | nc 192.168.1.87 5001
Receiver:

Code: Select all

pi@raspbi4 ~ $ nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin buffer

bjornatic
Posts: 20
Joined: Wed May 15, 2013 4:44 pm

Re: From Pi to Pi camera streaming

Fri May 17, 2013 2:27 pm

fbutler wrote:Here's the exact cut and pasted command lines that I am using in case you can see any difference

Sender:

Code: Select all

pi@raspbi1 ~ $ raspivid -t 999999 -o - | nc 192.168.1.87 5001
Well, if I use this line, the camera red led does not turn on and the program quits without error after a few seconds.

The difference between your line of command and the one I mentioned is the little "–" after the "-o".

In my case its a – (EN DASH), in yours its a - (HYPHEN-MINUS).

And I thought, linux was just more (and only more) case sensitive than other OS's... :lol:But this is just just super tricky to me.

Anyway, I believe the – (EN DASH) is right. But even then... no streaming for me. :|

So, now, just some very low level basic questions :
Assuming I past the two command lines right, there should be at least some data traveling between the Pi's and netstat should reveal it, right ??

Wich tests should I perform to get closer to the origin of the problem ? (beside looking myself in the mirror).
Last edited by bjornatic on Mon May 20, 2013 8:52 am, edited 1 time in total.

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: From Pi to Pi camera streaming

Fri May 17, 2013 2:51 pm

bjornatic wrote:Assuming I past the two command lines right, there should be at least some data traveling between the Pi's and netstat should reveal it, right ??

Wich tests should I perform to get closer to the origin of the problem ? (beside looking myself in the mirror).
If there was any data passing between the Pi's I believe you would see this as this on the receiving end as it starts showing how many bytes are being received on the screen. I'm at a partial loss at the minute as to how to debug it further. Let me have a think.....

bjornatic
Posts: 20
Joined: Wed May 15, 2013 4:44 pm

Re: From Pi to Pi camera streaming

Mon May 20, 2013 8:39 am

bjornatic wrote:
fbutler wrote:Here's the exact cut and pasted command lines that I am using in case you can see any difference

Sender:

Code: Select all

pi@raspbi1 ~ $ raspivid -t 999999 -o - | nc 192.168.1.87 5001
Well, if I use this line, the camera red led does not turn on and the program quits without error avec a few second.

The difference between your line of command and the one I mentioned is the little "–" after the "-o".

In my case its a – (EN DASH), in yours its a - (HYPHEN-MINUS).

And I thought, linux was just more (and only more) case sensitive than other OS's... :lol:But this is just just super tricky to me.

Anyway, I believe the – (EN DASH) is right. But even then... no streaming for me. :|
Sooo... I finally got to solve my problem. And I-was-wrong by stating "Anyway, I believe the – (EN DASH) is right."...

Here is the complete story of what happened (in cas of another noob like me is going crazy) :

The article "Camera board available for sale!" gives the following code to activate the streaming option :
"raspivid -t 999999 -o | nc [insert the IP address of the client] 5001"

For me, on OSX (do not know if its the same on other os's...), the minus after the -o is a "EN DASH"... And if I copy/paste this exact command, (which I religiously did for the pas 4 days), the streaming won't work.

Fbutler gave me the right command :

Code: Select all

raspivid -t 999999 -o - | nc 192.168.1.87 5001
But, I assumed this was wrong because as I launched it before launching the recieving command on the ... receiver ... it didn't worked and, as I stated : "the camera red led does not turn on and the program quits without error after a few seconds".

:roll:

SO, thank you Fbutler, you where right to insist.
PLEASE, admin, correct the command line on the frontpage or please explain to me what this – (EN DASH) is doing there.

And now, I will go an sit in front of my TV to stare at the stream of my beloved new toy. :)
Last edited by bjornatic on Mon May 20, 2013 8:52 am, edited 2 times in total.

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: From Pi to Pi camera streaming

Mon May 20, 2013 8:49 am

bjornatic wrote:SO, thank you Fbutler, you where right to insist.
PLEASE, admin, correct the command line on the frontpage or please explain to me what this – (EN DASH) is doing there.

And now, I will go an sit in front of my TV to stare at the stream of my beloved new toy. :)
Excellent news. I was completely at a loss as to why it worked for me but not for you :-)

Rushy
Posts: 35
Joined: Tue Nov 27, 2012 3:24 pm

Re: From Pi to Pi camera streaming

Sun May 26, 2013 11:29 pm

FYI
Raspivid -t 999999 -o -
this writes to stdout which creates a buffered stream to another device.

Hope this sums up the '-o -' confusion

Return to “Camera board”