Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
new firmware: image over IP
This thread has 8 replies. Displaying all posts.
Post 1 made on Saturday January 19, 2008 at 11:33
themoose&1
Long Time Member
Joined:
Posts:
December 2007
15
I am trying to download the following image over IP:



...using the following code (closely based on the example on p45/46 of v1.1 of the ProntoScript dev guide):

--------------------------------------------------------------
var socket = new TCPSocket();
var receivedData = "";

socket.onConnect = function() {
socket.write("GET /uploadtop/v/visual_nustraks.jpg" + " HTTP/1.1\r\n\r\n");
};

socket.onData = function() {
receivedData += socket.read();
};

socket.onIOError = function (e) {
CF.widget("output").label = "IOError " + e;
};

socket.onClose = function () {
// remove the HTTP information from the received data
var imageStartIndex = receivedData.indexOf("\r\n\r\n");
var bitmapData = receivedData.substring(imageStartIndex+4);

// make and display the image
var MyImage = new Image(bitmapData);
CF.widget("output").setImage(MyImage);

};

// MAIN
socket.connect('static.tvgids.nl', 80, 6000);

--------------------------------------------------------------

I don't get any picture displayed in my "output" panel !?
Any suggestions (or working example to start with...) ?
Post 2 made on Saturday January 19, 2008 at 12:13
apierre
Long Time Member
Joined:
Posts:
October 2006
25
Try changing this line:
socket.write("GET /uploadtop/v/visual_nustraks.jpg" + " HTTP/1.1\r\n\r\n");

to this:
socket.write("GET /uploadtop/v/visual_nustraks.jpg" + " HTTP/1.0\r\n\r\n");
Post 3 made on Saturday January 19, 2008 at 12:27
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,003
And if that does not work, it may be that the image data is 'chunked'. There's a function to "unchunk", per se in the Philips RSS example on the Pronto Website. You must be level-1 certified to be able to download this, I believe.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 4 made on Saturday January 19, 2008 at 12:54
sgtoma
Long Time Member
Joined:
Posts:
December 2007
73
APIERRE got it.
Try to make use of debug panels (ProntoScript name _PS_DEBUG_).
Barry has posted a TSU9600 debug mod. Have a look and try it as it is a great feature.
Make sure that your 'panel' has its ProntoScript name sat as: panel

This should get you started:

var socket = new TCPSocket();
var receivedData = "";

socket.onConnect = function() {
System.print ("TCP connected");
socket.write("GET /uploadtop/v/visual_nustraks.jpg" + " HTTP/1.0\r\n\r\n");
//socket.write("GET /uploadtop/v/visual_nustraks.jpg" + " HTTP/1.1\r\n\r\n");
};

socket.onData = function() {
receivedData += socket.read();
System.print ("TCP DATA RECEIVED:"+ receivedData);
};

socket.onIOError = function (e) {
GUI.widget("panel").label = "IOError " + e;
System.print ("TCP ERROR:"+ e);
};

socket.onClose = function () {
// remove the HTTP information from the received data
var imageStartIndex = receivedData.indexOf("\r\n\r\n");
var bitmapData = receivedData.substring(imageStartIndex+4);


// make and display the image
var MyImage = new Image(bitmapData);
GUI.widget("panel").setImage(MyImage);


};

// MAIN
socket.connect('static.tvgids.nl', 80, 6000);
Post 5 made on Saturday January 19, 2008 at 15:48
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,003
Be aware that if you are attempting to fetch images from Escient Fireball PC on port 7445, the software does not honor HTTP 1.0 close and relies on the client (your TSU9600) to close the socket so with Escient Fireball PC. Therefore, the above examples will not work.

This was a real pain with my Escient Integration because with each block of data received, I had to analyze all the data to see if I had all expected content.

Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Monday January 21, 2008 at 15:48
themoose&1
Long Time Member
Joined:
Posts:
December 2007
15
Thx guys, as I have had problems in the past with HTTP /1.0 I used HTTP 1.1 instead. In this case changing it back to 1.0 did the job but I still don't get 10 out of 10 pages succesfully returned.
Another issue is than when use 1.0 and when use 1.1 (or is it just a case of testing what works for each specific HTML page) ?
Post 7 made on Monday January 21, 2008 at 17:00
snelvuur
Long Time Member
Joined:
Posts:
November 2007
55
Just out of curiosity, why would you want to grab that picture? It does not show the current channels its just a background picture. You can better just put it in your gallery..
Post 8 made on Monday January 21, 2008 at 23:30
MVis
Long Time Member
Joined:
Posts:
July 2007
94
I did some simple scaling tests today (setting stretchimage to true and false) and it seems pretty fast. I haven't done any resolution tests to see how well the scaling to widgets filters, but it should be fine for what it is.
OP | Post 9 made on Tuesday January 22, 2008 at 14:29
themoose&1
Long Time Member
Joined:
Posts:
December 2007
15
Snelvuur, just a picture I found on that website to try a picture download enabled by the new firmware on.....
My question on when to use 1.0 or 1.1 still remains unanswered.
Btw, anyone else that has experience with downloads of the same webpage failing every now an then ?


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse