1) Make sure you know the URL that retrieves the temperature reading from the Prop/W5200. Enter the URL in the browser address bar and press enter.
http://192.168.1.104:8080/xmltemp
You should see the XML document.
2) Copy the URL into the proxy page. If the web pages are coming from a server on the internet then you'll have to use the IP assigned by your ISP and configure your router to port forward requests. See this post too
[php]
<?php
$url = "http://192.168.1.104:8080/xmltemp";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
if(!curl_errno($ch))
{
//Content type should be XML
header ('Content-type: text/xml');
}
else
{
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
?>
[/php]
3) Copy the updated proxy page to your web server.
4) Enter the newly create proxy address in the browser address bar and press enter. You should see the same XML as step 1.
5) Update the setInterval() method in the index.htm page with the proxy URL in step 4 and upload index.htm to your web server.
Comments
You should see the XML document.
2) Copy the URL into the proxy page. If the web pages are coming from a server on the internet then you'll have to use the IP assigned by your ISP and configure your router to port forward requests. See this post too
[php]
<?php
$url = "http://192.168.1.104:8080/xmltemp";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
if(!curl_errno($ch))
{
//Content type should be XML
header ('Content-type: text/xml');
}
else
{
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
?>
[/php]
3) Copy the updated proxy page to your web server.
4) Enter the newly create proxy address in the browser address bar and press enter. You should see the same XML as step 1.
5) Update the setInterval() method in the index.htm page with the proxy URL in step 4 and upload index.htm to your web server.