Can the arduino just "forward" (for lack of a better word...) the web page that the app is creating to its own.
I'm using this to control a fish tank. I want to see my fish when I'm away to check on them. I've created code that creates a web page that displays the temp of the tank as well as have buttons that control feeding and water changes. Under that I want the web page that the app is creating. Is this possible?
Again, I'm sorry that I'm not making much sense. I just can't find the right words...
I know, the review is pretty bad. However, this is the only documentation I've found. Here is my short discription:
IP Cam takes the camera on the iPhone and turns it into a web cam. It broadcasts the picture to a web server. I think it's similar to the way the Arduino creates webservers. You type the IP address and port into a broser and...it shows you the video from the iPhone camera! It says you can get the cameras web server any where in the world.
What I want to know is if I can move this video feed to my program on my Arduino's web sever.
Here's my short description: an application written by a Chinese hacker I've never heard of which, according to the customer reviews on its itunes page, doesn't work, but makes up for it by posing a security risk.
If the author won't even publish basic information on what the app is supposed to do, and how to make it do that, I'm sure as (bleep) not going to trust that it's not doing things it isn't supposed to do.
Personally, I wouldn't install it on a borrowed phone on a bet. Your tolerance for risk may be higher, but there's no way to tell you whether you might be able to get it to work without the technical information that the author chooses not to provide.
That app looks like it will probably do what you want, but there are still a copule of open questions. It sets the iphone up as a webserver, and displays the photo in the webpage it serves up.
It can store more than one photo, so they're presumably saved with a generated filename along the lines of "0001.jpg, 0002.jpg, ..." or "date.time.jpg".
The first question is: does that iphone webpage use something like PHP code to select the "latest" photo, so it's only accessible from within that particular webpage? Or does the photo have its own "magic" URL, so you can embed it in your own webpage on the Arduino without needing to know the real filename?
The other question is whether you can assign the iphone a static IP: it's probably going to be difficult, and maybe impossible, to embed the Apple "Bonjour" protocol for discovering the iphone in an Arduino.
Since this app has a clearly-identified author, with a real contact address, you can ask those questions before you buy.
I think it uses PHP code to determine the latest photo and then updates the web page with the image on it. I doesn't save the photo unless you turn that feature in the settings on the iPhone.
Also, I'm pretty sure it does have a static IP.
How would I transfer the data? Can the Arduino process the web page and forward it to its own?
Wwll, for $1.99, you might as well buy the little bugger and get the real answers, rather than spending hours trying to guess.
Once it's running, you can do a "View page source" on the webpage it serves up, and find out how it references the image. And you can copy-and-paste the URL to access it directly, to see whether you can do a "fetch latest" without getting the whole page.
You could pass the image through the Arduino, but it's going to be faster (probably a lot faster) to use the technique I describe earlier: include only a reference to the image in the HTML the Arduino serves up, and let the user's browser go fetch it from the iphone.
If all else fails (i.e., the iphone app doesn't provide a "latest image" URL), you could have the Arduino fetch the HTML from the iphone, extract the URL, and embed it in its own output. Make sure you have an ATMega328 or bigger, though, because you'll almost certainly run out of RAM if you try to run a client and a server simultaneously on a system that may also need to have DNS and DHCP libraries, plus buffer space to parse the iphone webpage.
The example code for the Ethernet library isn't very helpful for this sort of processing, but I posted some code snippets a week or two ago for buffering the Ethernet data as complete lines of text, instead of reading it one character at a time. That makes it a lot easier to find the data you need in a webpage.
Ok, I have two questions:
Where should I put the HTML of the iPhone app's web server in my arduino code? Also, should I use client.print(); to display the HTML?
I tried to put it in a client.print(); where the other HTML stuff is in my code but nothing appeared in my arduino's web server. Any ideas?
Yes, my arduino web server is up and running, so it's just getting the iPhone video feed working...
I added your line of code to my code and I got a small image icon with a "?" in it on the top of my arduino web server. Is there anything that I can mess around with in your line of code?
Did you try viewing the URL for the photo directly in your browser?
What do you mean? I type this into my browser:
192.168.1.3:8080
So the iPhone is creating a webpage with the images on it successfully.
Here is the source:
<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. Live streaming 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>
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.
Assuming the iphone keeps that address, the URL should be:
http://192.168.1.3:8080/image.jpg
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.
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: files.me.com/elijahwood/2go6wp
Also, How would I rotate the image the iphone produces?