|
|
|
The following page was printed from RemoteCentral.com:
Topic: | Reset Wifi in prontoscript. This thread has 45 replies. Displaying posts 16 through 30. |
|
Post 16 made on Friday September 5, 2008 at 13:21 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,994 |
|
|
Krazz,
Try it!
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
OP | Post 17 made on Friday September 5, 2008 at 15:09 |
kevin82 Long Time Member |
Joined: Posts: | January 2008 197 |
|
|
As I understand your first post kevin82, you are looking for a way to disconnect and connect on demand?! you just need the first two lines of code from the 'test' button in the script. it works for me!!
|
|
|
Post 18 made on Friday September 5, 2008 at 19:26 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,994 |
|
|
Per Belgium,
Whoever has the source code, you are free to publish it. The activity property will be in the next Dev Guide.
I don't have the source snippet handy so whoever got it last, please post the code snippet.
Thanks, Lyndel
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
OP | Post 19 made on Saturday September 6, 2008 at 10:06 |
kevin82 Long Time Member |
Joined: Posts: | January 2008 197 |
|
|
On September 5, 2008 at 19:26, Lyndel McGee said...
Per Belgium,
Whoever has the source code, you are free to publish it. The activity property will be in the next Dev Guide.
I don't have the source snippet handy so whoever got it last, please post the code snippet.
Thanks, Lyndel wifiEnabled = false; wifiEnabled = true; var notConnected = true; while (notConnected) { try { tryCount++; var w = widget("STATUS"); if (tryCount > 10) { if (w) w.label = "Cannot connect to network, please check your settings..."; // Better here would be performing a jump to a message page making this code to break automatically and the code below would not have to be executed GUI.updateScreen(); tryCount=0; break; } if (w) w.label = "Trying Macro..."; GUI.updateScreen(); w = CF.widget("MACRO"); // This Macro should be an IR code that you issue on the extender if necessary a dummy one... if (w) w.executeActions(); // will fail if no network connection and the exception will be caught //Hereafter you can do a pagejump or issue the real macro System.delay(300); if (w) w.label = "Executed Macro..."; notConnected = false; } catch(e) { var w = widget("STATUS"); if (w) w.label = "Waiting for connection with the nearest access point... " + tryCount; GUI.updateScreen(); System.delay(200); } } tryCount=0;
|
|
|
Post 20 made on Saturday September 6, 2008 at 10:28 |
Barry Gordon Founding Member |
Joined: Posts: | August 2001 2,157 |
|
|
It is one line of code. I will be home later this evening and I will post it. I do not understand what Kevin posted but I do not believe it will turn the radio on and off unless I missed something.
I placed the line of code as
CF.widget("widgetName").enabled=!CF.widget("widgetName").enabled
"widgetName" is what I can not remember on a button whose released or normal image is a 1% opacity rectangle that covers the wifi widget on my home page. Its pressed state image is a big red X. If the wifi widget is active you see the widget. Touch it, the big red X appears and the widget collapses. Touch it again and the radio starts up and re-acquires the WAP. It takes 2-3 seconds for that to happen. When the radio re-acquires the WAP it will go to the one with the strongest signal and the wifi widget expands to show the signal strength. I had a long discussion with the Philips team at Cedia and they are going to review Philips policies and see if they can forge a better relationship with thier client base.
|
|
Post 21 made on Saturday September 6, 2008 at 12:55 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,994 |
|
|
The above code will work. Here's an explanation of how this feature was added.
The Activity class has a new property named 'wifiEnabled' that can be toggled.
So, the 2 lines of code from above
wifiEnabled = false; wifiEnabled = true;
toggle wifi status by simply turning it off and then back on. The remainder of the code is just extra illustrating how one might want to integrate this feature into a configuration.
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
OP | Post 22 made on Saturday September 6, 2008 at 15:11 |
kevin82 Long Time Member |
Joined: Posts: | January 2008 197 |
|
|
On September 4, 2008 at 10:37, kevin82 said...
Ive got a reply from the pronto team, and it works great!!
The remote disconnects and reconnects with just 2 lines of script. Like i said before, you only need the first two lines of code..
|
|
|
Post 23 made on Saturday September 6, 2008 at 19:28 |
Barry Gordon Founding Member |
Joined: Posts: | August 2001 2,157 |
|
|
Sorry guys, the simple line of code will not work unless. It will turn out to be an undefined parameter variable
The code I use is as follows:
if(CF.activity().wifiEnabled) { CF.activity().wifiEnabled=false; widget("WiFi_Reset").label="X" } else { CF.activity().wifiEnabled=true; widget("WiFi_Reset").label="" }
I do agree with Lyndell's statement that there is now an activity level property called wifiEnabled, But just using the property name in the Prontoscript of a button will not work, unless it has been set to point to CF.activity().wifiEnabled. I always use the fully qualified items just to avoid confusion. I just tried it and it is reported as an undefined variable as I suspected.
As I stated earlier in this post I use a transparent button, and change its label to remind me that the radio is shut off. The button is tagged as "WiFi_Reset" and as I stated before it is 1% opacity
|
|
Post 24 made on Wednesday September 24, 2008 at 12:07 |
pthornhill Long Time Member |
|
|
Has anyone else found that using this code: CF.activity().wifiEnabled = false; CF.activity().wifiEnabled = true; to disconnect/reconnect to strongest WAP can cause the 9600 to lock up and need a power cycle? Doesn't happen very often but when it does its always when its disconnected and says "Connecting" top left on screen. This happens in multiple rooms with different WAPs so I doubt its the network. This even happens if a put a scheduleAfter in for the reconnect to give it several seconds between disconnecting and reconnecting. Also affects 2 different 9600's so I know its not a dodgy Pronto or firmware. Running latest versions of firmware on everything. Any suggestions on how to avoid this? Anyone else seen it happen?
Last edited by pthornhill
on September 24, 2008 12:35.
|
|
Post 25 made on Saturday January 24, 2009 at 15:02 |
gopronto Senior Member |
Joined: Posts: | April 2008 1,453 |
|
|
removed :)
Last edited by gopronto
on January 24, 2009 15:13.
|
Pronto still one of the best Wi-Fi Remotes, www.ikonavs.co.nz and [Link: axiumcontrol.com] Axium Control |
|
Post 26 made on Saturday January 24, 2009 at 15:31 |
Barry Gordon Founding Member |
Joined: Posts: | August 2001 2,157 |
|
|
I do not use it often, but have never seen it do what you have seen.
|
|
Post 27 made on Saturday January 24, 2009 at 16:32 |
gopronto Senior Member |
Joined: Posts: | April 2008 1,453 |
|
|
On January 24, 2009 at 15:31, Barry Gordon said...
I do not use it often, but have never seen it do what you have seen. I flashed the firmware again and it was ok.... strange.. Im sure in PEP1 when you did wifi disable you were left with the wifi icon on the TSU with a red "x" above it , but now it disapears..
|
Pronto still one of the best Wi-Fi Remotes, www.ikonavs.co.nz and [Link: axiumcontrol.com] Axium Control |
|
Post 28 made on Saturday January 24, 2009 at 18:40 |
Barry Gordon Founding Member |
Joined: Posts: | August 2001 2,157 |
|
|
GoPronto, are you referring to the Slimpronto code? I believe I may have based the wifi enable/disable in that home page
|
|
Post 29 made on Saturday January 24, 2009 at 18:48 |
gopronto Senior Member |
Joined: Posts: | April 2008 1,453 |
|
|
On January 24, 2009 at 18:40, Barry Gordon said...
GoPronto, are you referring to the Slimpronto code? I believe I may have based the wifi enable/disable in that home page Not in slimpronto , just in general... i was doing some checking for a distributor of mine , he has made some comments that its no behaving the same as it used too...
|
Pronto still one of the best Wi-Fi Remotes, www.ikonavs.co.nz and [Link: axiumcontrol.com] Axium Control |
|
Post 30 made on Saturday January 24, 2009 at 19:46 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,994 |
|
|
What firmware revision, please?
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
|
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.
|
|