Connect ip cam to Arduino Yun and watch live video from iPhone

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.

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/

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.

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...

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.

For my setup, I use this: Guide to Setup Streaming Web Cam on the Yun - Arduino Yún - Arduino Forum

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

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.

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

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.

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.

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.

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.

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

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.

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 Dropbox - Yun-Packages - Simplify your life 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.

Hope it helps

AllSystemGO:
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.

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!

If your yun is connected to your computer, you can upload YunSerialTerminal example, open serial monitor and get the same linux prompt you'd get with ssh

I used this command on my OSX terminal an it works: SSH -X root@arduino.local

when i try to install i get this error :

root@Arduino:/mnt/sda1/arduino# opkg install fswebcam_20110717-1_ar71xx.ipk
Installing fswebcam (20110717-1) to root...
Collected errors:

  • satisfy_dependencies_for: Cannot satisfy the following dependencies for fswebcam:
  • libgd *
  • opkg_install_cmd: Cannot install package fswebcam.

I installed all other.

Hi

are you installing the ipk packages from the SD because of your Yun is not connected to Internet?
Otherwise it's a really better solution to let opkg download them (and resolve all the dependances) for you...

I put all the file on my SD , next i connected the arduino using ssh with OSX terminal. Next i type the command "opkg install" for all the files. All works fine but fswebcam no.