Forum 2005-2010 (read only) > Interfacing

IP cam app for iPhone

<< < (4/5) > >>

Ran Talbott:
Did you try viewing the URL for the photo directly in your browser?

What is that URL?  It'll give us a clue as to whether the iphone is using a magic "latest" URL,  or generating a different filename every time.

Cutting and pasting the iphone's webpage source into your reply as a "code" block might help,  too.


--- Quote ---Did you try viewing the URL for the photo directly in your browser?
--- End quote ---

What do you mean? I type this into my browser:
So the iPhone is creating a webpage with the images on it successfully.

Here is the source:

--- Code: ---<body><html><head><META HTTP-EQUIV='CACHE-CONTROL' CONTENT='NO-CACHE'><div id='content'><h1><img src='image.jpg' id='theImage' name='theImage'width='320' height='372' alt='iphone camera image' /></h1><div class='meta' id='status'> Image Taken: <strong>2010-02-20 14:16:02 -0500</strong> </div><div class='meta' >Update Speed: <select name='interval' id='interval' ONCHANGE='onChangeInterval( this.options[this.selectedIndex].value );'> <option value='0'>Live</option> <option value='500'>0.5 sec</option><option value='1000' selected='yes'>1 sec</option><option value='2000'>2 sec</option> <option value='5000'>5 sec</option> <option value='10000'>10 sec</option><option value='30000'>30 sec</option></select></div><script type='text/javascript'> var intervalElement = document.getElementById('interval'); var interval = intervalElement.options[intervalElement.selectedIndex].value; var isIE = false; function onChangeInterval(newInterval) {if ( newInterval == interval ) { return; }if ( newInterval == 0 ){if (isIE == false) {document.location.href = '/live'; }else {interval = 0;document.getElementById('iewarning').style.display = 'block';}} else {if ( interval == 0 ){if (isIE == false){document.location.href = '/';}else {document.getElementById('iewarning').style.display = 'none';} } interval = newInterval;}}</script><!--[if gte IE 6]><script type='text/javascript'> isIE = true; </script> <p style='color:grey;display:none;' id='iewarning'>You are using the Internet Explorer. ing is only supported on Safari, Firefox or Chrome.</p><![endif]--> <noscript></noscript> <div class='meta' id='movies'></div><script> window.setTimeout('refreshImage()', interval);</script></div></body></html>
--- End code ---

I've removed the header with an HTML editer and this code creates a simple webpage with the video feed and a button that says update speed. It has live, 1 sec, 2 sec, 3 sec, ect. on it.

Thanks for your quick response!

Ran Talbott:
Assuming the iphone keeps that address,  the URL should be:

--- Code: ---
--- End code ---

If you refresh your browser periodically while the camera app is running,  I suspect you'll find that that's the "magic" URL that returns the latest snapshot.

If that's the case,  then putting it into your Arduino code should get you the result you're looking for.

btw,  it turns out that someone has,  in fact,  implemented Bonjour on the Arduino.

Whenever I hit the refresh button it updates the image! Now...IT IS COMPLETE!

I'll go check out the other forum later.

Thanks again!


Here is what my screen looks like now:

I still can't believe how simple it was!

I have one more question; how can I move the temperature reading right before the image? I tried doing everything but I couldn't get it move from the top. Do you mind looking at my code to see if I could do anything to move it down?
Here is my code:

Also, How would I rotate the image the iphone produces?



[0] Message Index

[#] Next page

[*] Previous page

Go to full version