Go Down

Topic: Connect ip cam to Arduino Yun and watch live video from iPhone (Read 11972 times) previous topic - next topic

Nico91

Hi,

i would like to connect an ip cam to my Arduino Yun ethernet port. Next i would like to connect my iPhone to the wifi Access Point of the Yun and watch the live video from my iPhone.

To do this I need to configure the arduino as a router. How can I do that?

Thank You.

lucad79

Hi Nico,

it could be possible, but why using a Yun for a similar application, where a simple router in "wifi client" mode works fine and it's cheaper? For example a TL-WR702N:
http://www.lucadentella.it/2012/12/09/enc28j60-e-arduino-11/

Nico91

#2
Nov 11, 2013, 05:02 pm Last Edit: Nov 11, 2013, 09:00 pm by Nico91 Reason: 1
Thank you for the reply.

I need this configuration because i want to send URL command to the Yun using iPhone.  For example if i want build a rover with video stream i use ip cam to make the video and Arduino to move the rover.

lucad79

Hi Nico

I read some documentation from OpenWRT project... what you're looking for is something described here:
http://wiki.openwrt.org/doc/howto/clientmode

as you may read, it's not an "easy" setup...

Nico91

So if i want watch my live video through Arduino using my iPhone i need to do this setup? is there other way?

Thank you.

AllSystemGO

For my setup, I use this: http://forum.arduino.cc/index.php?topic=188690.0

and then I open Safari and browse to http://the ip:8080/?action=stream

Hope it help and that's what you are looking for

Nico91

But the configurations that are shown in this discussion you need to use a usb webcam or ip cam?

He says that the video has a delay of 4 seconds, but with the ip cam it should be in real time.

Thank You.

AllSystemGO

Yeah but you need to read the complete posts. At the end he uses the mjpg-stream and it works really good. I tried it and I have a 1/2 a sec of delay. And I use a USB Cam, Microsoft HD-3000

lucad79

Guys,

an IP Cam is a cam with an ethernet interface... so the setup using an USB webcam can't work.
My suggestion is to provide an external solution to "transform" the IP Cam in a wifi Cam, like the router I suggested before.

Nico91

Hi,

i can also use a USB webcam if this configuration has very little delay. How long can this configuration continue to operate ?

If i use a webcam without HD can i reduce the delay?

The ip cam that i have have also wifi configuration, but it is the same problem, arduino is not configured like a router so if i connect the cam to Arduino and my iPhone to Arduino i can't watch the video from iPhone.  Maybe i could use an external mini router but if the webcam configuration has a very little delay it is the best configuration also for the dimension.

Thank You.

AllSystemGO

Like I said there is a 1/2 a sec delay using a HD-3000 at 5 FPS, I don't think that the HD is doing the delay here.

Nico91

Can i reduce the fps to reduce delay?

I don't understand some command:

-SSH into OpenWRT
-Install either the UVC driver (if not already installed) e.g. opkg install kmod-video-uvc
    where i need to install them? and how?

Thank You.

AllSystemGO

5 FPS is the lowest you can go I think. But you could try it and test it for yourself.

I know the steps are a bit tricky cause I had a hard time understanding too. So here goes

Quote
SSH into OpenWRT

This mean you need to connect to the Yun SSH interface, so open putty for windows, and SSH to the IP of the YUN. So in my case it was ssh 192.168.240.1. That's going to get you in the linux part of the Yun, or as they call it the OpenWRT.

Quote
Install either the UVC driver (if not already installed) e.g. opkg install kmod-video-uvc
    where i need to install them? and how?

That's the hardest part to understand. What you need to do is get the package from here https://www.dropbox.com/sh/6nv5f2datb3n2ps/nj-z27B6i1 download all the ipk to your desktop. Then you can put them on a MicroSD. Take that MicroSD and put it in the Arduino.

2- Then you need to mount the MicroSD, you need to type those commands in putty while connected to the openWRT. The commands you need to type are in bold

- add your micro sd card (it should appear as /dev/sda1 by default)
- Create a folder or mount point /mnt/sda1 (mkdir /mnt/sda1)
- mount your sd card - mount /dev/sda1 /mnt/sda1

3- Then you need to install those package. So you need to go in the /mnt/sda1 and install all the packages. And you do it like that : opkg install mjpg-streamer.ipk.

So start by the first one and go down the list. Don't worry if you install one package and you get an error message saying that you need another package before. Just install the Pre-Requisit and after re-install the one that fail. In the end all the package should install.

4- Once all that's done type mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480" -o "output_http.so -p 8080 -w /mnt/share"

and you should be all set.

Quote

- Open your web browser to: http://arduino.local:8080/?action=stream for a stream or http://192.168.1.1:8080?action=snapshot for a single snappy
- Enjoy


Hope it helps

federicofissore


2- Then you need to mount the MicroSD, you need to type those commands in putty while connected to the openWRT. The commands you need to type are in bold

- add your micro sd card (it should appear as /dev/sda1 by default)
- Create a folder or mount point /mnt/sda1 (mkdir /mnt/sda1)
- mount your sd card - mount /dev/sda1 /mnt/sda1


Why do you need to do that? Isn't the yun doing that automatically? It should. AFAIK, if it doesn't, doing it manually shouldn't work either.

Nico91

Thank you!!

When i need to connect to the Yun interface i need to type the command "ssh ip" on my OSX terminal and all works fine? I can know the ip connecting to my Yun and open the network settings?

Sorry for the question but I am an iOS developer and i don't know this kind of programming.

Thank you very much!

Go Up