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:
A couple of Questions for the PS Experts...
This thread has 6 replies. Displaying all posts.
Post 1 made on Wednesday February 25, 2009 at 20:48
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
Hey guys. Still just getting my feet wet with prontoscript (but am a programmer of 30 years) and have a couple of questions:

1) I saw a bunch of threads talking about Memory usage. Does anyone know if it's possible to query the pronto from Prontoscript on the amount of free RAM available? I have been developing an application with similar functionality to ProntoSqueeze but for the Roku Soundbridge. It is a fully functional RSP client running on the pronto with searching and browsing capabilities. It also downloads Album Art from the internet. I would like to cache as many album covers as memory would feasibly allow, so as to reduce the server demand and speed up the display of a previously downloaded cover. Most images are 30-50k (taking 60-100k of memory when stored as a string - unicode, right?) I figure with 10MB of RAM, that could be 100 covers. However, for people that don't have that much free, I could store less. For people that have more free, I could theoretically store more. Any way to tell how much RAM is available for globals storage on the fly?

2) How do people detect double taps? I have a list interface for browsing Albums, Artists, Songs, etc., and would like to be able to double click the list to drill down a level? (I already have single clicking working.)

3) Any way to suppress the sound a particular button (with a prontoscript action, of course) makes without disabling it in the whole configuration?

4) What's the best way to detect whether a TCP/IP connection has been dropped (not closed). Occasionally, due to some unusual bugs in the soundbridge, the soundbridge crashes. I don't get a connection closed by host msg. Seems the pronto just sits there. socket.connected still seems to return true even though the connection is no good. Any clues here?

5) What's the best way to tell when the Pronto has gone to sleep? Can I detect it before it sleeps? How do I detect it after it sleeps? Is the only way to setup a scheduleAfter loop and check for a gap in the system time?

Any help with any of the above would be greatly appreciated. Thanks very much.

- Mike
Post 2 made on Wednesday February 25, 2009 at 23:15
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
Ill answer some:

2) If I am using double taps, I normally somehow highlight on a single tap (a little pointer or a frame around the item). I keep track of which item in the list or on the screen is "Highlighted". A single tap is then touching an item that is not currently highlighted, a double tap is touching one that is.

4) probably timing out the connection. All of my TCPIP sends are done asynchronously and timed

5) You can't tell when it is asleep. The processor is stopped so no code is running. You can't tell when it is going to sleep, no indications. You can tell when it has awoken from sleep by using a real time clock and running a loop that process in a small amount of time. The clock is checked in the loop and if the normal elapsed time has occurred between loop cycles it has not awoken from sleep and is currently awake. If the time between loops was about 57 seconds it just woke up internally and will go back to sleep in about 5 seconds if you do nothing
OP | Post 3 made on Thursday February 26, 2009 at 07:53
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
Barry, Thanks for the info. A couple of follow ups, if I may.
2) This is what I figured. I will probably define a PS global and store the button which was clicked, and kick-off a scheduleAfter timer to clear it after, say, 300ms. If it hasn't been cleared, and is the same button, then I know. Thanks for the tip.

4) So you would recommend setting up a timer to detect no response as expected? if I don't get a response after, say, 2 seconds, I can assume the connection is dead, close the port, and reopen. Right?

5) Thanks for this information. I will setup a timer and track the real-time clock. Can you explain a little more about the 57 seconds thing? You're saying the pronto partially wakes once per minute? Are network connections held open during this time? (This may be a good time to gracefully close the IP connection.) And, by go back to sleep when you do nothing, you mean the user clicks nothing, right?

Thanks for all the info. If anyone has additional suggestions on these or the other two questions, that would be much appreciated.

- Mike
Post 4 made on Thursday February 26, 2009 at 09:15
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
Pronto sleep just means that the pronto stops the processor. In theory state would be maintained, but TCPIP gets very tricky depending on the other side. I always check a socket before connecting and I always run the sockets async and capture all errors. The pronto wakes up about once a minute in an attempt to keep a wifi connection alive. It then goes back to sleep if there was no user action for aboput 5 seconds (My understanding, not necessarily fact).

In all my TCPIP work:

1) All the code is at the activity level. In fact this is true for all my xcf work

2) There is a loop called the 'BasicLoop" that is at the activity level that is called from every page (actually the currently active page) every 100 milliseconds using the page timer.

3) All buttons and hard keys, with the exception of the Home key which has special hold down actions, just make an entry into a user queue signifying what button was pressed and passing any parameters like the buttons position is a list of buttons.

4) The basic loop acts as a finite state machine switching on a single state variable. The user queue is checked only if the current loop state is idle. TCPIP comms are timed as long as the loop state is busy and restarted when they time out . TCPIP, a guaranteed delivery protocol, can fail to guarantee delivery under certain instances of a wifi failure. Sleep wake up recognition takes place in the basic loop.

5) All TCPIP work is queue based. An entry is made in a comm queue and the comm queue is processed, guess where - in the Basic loop. The system allows new entries to be added to the queue at any time even while processing a queue entry. The comm Queue entry is always a list of items (a small queue)which consist of multiple TCPIP commands each one processed in order and allows for evaluation of processed results as replies are received. It is referred to as the current work list. An entry in the list is either something to send, something to evaluate, or a place to go. Processing of a reply may add more entries to the basic queue or the currently active queue block or may change the Basic loop state. That is the way I chunk long lists that require telling a server to advance through a list of items. The bottom of any queue list always contains a return point to be executed when the entire block is finished.

Hope that helps

The Finitestate machine has states like Idle, Busy, Done, Stop, Hold, Error. The normal cycle is Idle, Busy (processing a comm queue block), Done (finsihed processing a comm queue block), Idle

A TCPIP entry in a comm block might be an http GET.
Post 5 made on Monday November 8, 2010 at 12:20
leeladisky
Long Time Member
Joined:
Posts:
August 2005
70
Did you ever finish this module? Would be interested to see if it could be expanded to control their new lines of full media servers... Thoughts?
Post 6 made on Monday November 8, 2010 at 16:19
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
I control all my modules using the model described above. In fact I recently posted some library modules on my web site that illustrate how I do this. It is called Pronto Theater Application and contains the full source code.

I have a numbr of Roku photobridge's or whatever they are called gathering dust in a closet. Their (Roku's) design had a weak PSU that burned out after a few months. They would not fess up to it and would not supply a new PSU of a proper design. I refuse to buy another roku product due to that experience. I acually ended researching a proper PSU that fit in their casework and made up a instructional kit for those who had not given up. I went with the Slim (know Logitech) music line.
Post 7 made on Monday November 8, 2010 at 16:47
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
My brother had the same issue with his Roku. A new PSU cost him $50USD.
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