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:
Ip problem
This thread has 6 replies. Displaying all posts.
Post 1 made on Sunday January 25, 2009 at 10:46
ConceptMan
Lurking Member
Joined:
Posts:
January 2009
3
Hi , can anyone help?

I'm using a tsu9600 to connect via a wireless router to my lighting control system.

the script below succesfully connects and i can operate the buttons fine, the problem is that if the controller is not constantly polled then the connection drops out.

Also , if i leave the page and then return to it i get a connection error.

If i then leave and go back the connection works fine again.....

Any ideas?

By the way i am an absolute nove with Prontoscript!

Here's the link for the xcf file i'm using.

[Link: smart-house.it]
Post 2 made on Sunday January 25, 2009 at 11:15
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
Looking at the script; your lighting system is being controlled through an RFX9600 extender. Being as the script does run and it is potentially a networking issue:

Suggest that you use a debug panel (add a panel to the page that is problematic and give it a Prontoscript tag name of _PS_DEBUG_). When you run your script, any errors generated will be reported in the panel. If your extender is erroring, it should show up in the debug panel. If not also look at the diagnostic log.

One thing that has come up repeatedly on this forum when it comes to network issues is always firmware. There have been a couple of firmware updates that have come out recently. Check the firmware of your TSU and the extender and make sure that they are both up to date. A lot of strange problems have been remedied by a little flash update of each units firmware.

Looking at your description, it sounds like the unit (TSU) is going into sleep mode and the comm connection is being dropped abnormally. Don't quote me, but I think that this has been addressed in one of the firmware updates that Philips has issued over the recent past.
You can hide almost anything until you have to put the drywall up!
OP | Post 3 made on Sunday January 25, 2009 at 13:49
ConceptMan
Lurking Member
Joined:
Posts:
January 2009
3
thanks guerilla,

I will try the firmware update.

Also the system has two modes of control , the one i'm interested in is the test page testing 1 as this has the script to connect via tcp/ip . Can you see anything on here that would cause the socket to be closed when exiting the page and returning immediately?

Basically when i open the page it says connected to the IP etc then sends a Modbus command to read the registers in the controller. On exiting and re-opening the same page - the same modbus command is sent again but this time no response is received and the socket is then closed folowed closely by an IO error.
Post 4 made on Sunday January 25, 2009 at 15:04
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
Hi ConceptMan,
sorry I was originally looking at the wrong section of the script! The basics of the script look ok; the TCP socket properties are being defined before use, etc...

although page level functions will work, I follow other members suggestions with respect to functions and place them on the activity script level so that they are always available regardless of what page you have navigated to. As soon as you navigate away from a page, it's technically unloaded and none of it's functions or variables are available.

The socket is being closed, but it sounds and looks like when you are re-entering the page the Pronto is trying to re-use the pre-existing socket. If memory serves, I don't think Prontoscript allows for re-using the socket.

if my above assumption is correct (I can guarantee another member will chime in!): You need to re-initialize both the socket and any properties associated with it (onData, OnConnect, etc...) after each socket.close. Although it doesn't exactly dispose of the old objects, you are technically overwriting them and as such re-init'ing all of the properties.

most people will create an additional function to 're-init' the socket and all of its properties. Thus each time the connection is closed you would want to re-init the socket and all its properties; otherwise you might end up getting a 'object x has no properties assigned to it' or something a little more cryptic.


Hope this gives you some useful info! Cheers // Jason

PS: Does it spit out a specific IO error message?

Edit: If you are using the 'back' button to navigate back to the page with the script on it, the page script may not be executed. I'm not 100% sure on this one, but try navigating to the page using something else other than the 'previous page' option. This should guarantee that the page script is being executed!

Last edited by GuerillaBuild on January 25, 2009 15:17.
You can hide almost anything until you have to put the drywall up!
Post 5 made on Monday January 26, 2009 at 11:55
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
ProntoScript does not support socket reuse. There are 2 options. If the server to which you are connecting support HTTP1.1 (I did not look at your code), you could put keep-alive headers in place (search for HTTP 1.1 RFCs on web) or you should simply reestablish the connection in onClose.

See Item #1 here with examples (note some examples are not complete and left to the reader to complete).

[Link: pronto.philips.com]
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Monday January 26, 2009 at 12:30
ConceptMan
Lurking Member
Joined:
Posts:
January 2009
3
Hi Guys,
Thanks for all your help so far.
I can know keep the socket alive by polling the lighting controller so this is now no longer an issue.
But, try as i might i cannot get round the fact that by coming out of the test page and then returning to it I get a socket error.
I have tried everything - firmware updates , reInitSocket etc all to no avail.
Help!!!!
Post 7 made on Monday January 26, 2009 at 20:50
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Declare your socket variable in the Activity script page instead of in the test page.

If you are leaving the activity and returning back to a page inside, then that is your problem as Prontoscript is shutdown upon leaving an activity (that is, it is not global to the remote, but rather activity-centric).
Lyndel McGee
Philips Pronto Addict/Beta Tester


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