PDA

View Full Version : GoDevice "Can't find device" Fix... any update?



NeoMorph
August 8th, 2007, 02:35 AM
It's really tough not being able to use GoDevice... the false parameter at the end removes the error but the command then doesn't work either.

All I want to do is force my panel to show the home screen after 30 seconds of inactivity. It works all but the page jump command, GoDevice. :( I know it works because 30 seconds after I press the last button it goes...

"MCE: Didn't find device"

Arrrrrggghhhhh.... *runs screaming for the hills*

Edit: Stuck in bed so make that *falls out of bed screaming for the fix*

Edit2: That's THE fix not A fix... I'm not a strung out junkie you know... :D Mind you I can't stop trying stuff in NRD so maybe I am a Promixis Junkie ;)

Rob H
August 8th, 2007, 03:08 AM
If it's a home page then you have to use NetRemote.GoHome(pagename) - note that there's only one parameter here - plus the optional boolean

NeoMorph
August 8th, 2007, 03:13 AM
Nope... GoHome's broke as well - it crashes NR on my PC.

Other people have had the Device not found error (what does that mean btw?).

Rob H
August 8th, 2007, 03:30 AM
GoHome works fine here. How are you calling it?

If you're calling it from a button using Lua OnDown then it will almost certainly do as you say, but it should be okay from an OnRelease. The crash in OnDown is because the GoHome works, but then the button that called it has disappeared but NR still has a pointer to it and tries to use it.

NeoMorph
August 8th, 2007, 05:03 AM
Sweet... until it's fixed I'll just have to use the HOME pagegroup until GoDevice is fixed.

Here is the little inactivity code I use to return it to the home page after 60 seconds...


-- Return to Home Page after 60 Seconds of Inactivity
NetRemote.RegisterVariableWatch('Utility.TimeSince LastAction',
function(name, value)
iIdleTimer=math.floor(value/1000); if (iIdleTimer == 60) then NetRemote.GoHome('Home Page'); end;
end)



Works a treat...

Rob H
August 8th, 2007, 07:20 AM
To be on the safe side I'd change the == to >= just in case.

NetRemote.GoDevice does work though, but not for pages in the Home pagegroup. There may also be a restriction based on which template is used for the page.

Oh, yeah, it's case sensitive too :)

NeoMorph
August 8th, 2007, 09:07 AM
To be on the safe side I'd change the == to >= just in case.

Err... why >= ? Surely that would mean that every second after it hits 60 it would jump to the homepage! The whole point of making it an integer guarantees it would hit the exact number shouldn't it?

ROFL... yup... I was right... refresh city... it causes it to appear like it's stuck in a loop and any flash movie on the home page staggers like a drunk at midnight on a Friday night.

The main reason for it auto defaulting to the home page was to make it load up and run what in essence is a screensaver.

NeoMorph
August 8th, 2007, 09:27 AM
NetRemote.GoDevice does work though, but not for pages in the Home pagegroup. There may also be a restriction based on which template is used for the page.

Oh, yeah, it's case sensitive too :)

OK... The docs need to be updated because it doesn't say that you can't used GoDevice for the home page group.

That said, I just created a test jump and added the -1 at the end to shut up the error message and I take it all back... it darn well works. I then removed the -1 to see the error message again...

IT DIDN'T APPEAR :confused:

OK... I'm now really confused. I'm thinking I may have got something case sensitive wrong or was trying to jump in the home directory. Why is there two commands anyway? Seems a bit strange. If GoDevice worked on HOME as well it would do away with two commands.

Anyway... Do you like my forum Avatar... guess what the initials stand for? ;)

Rob H
August 8th, 2007, 11:14 AM
I was thinking of the situation where something else is running on the same PC and consuming a lot of CPU - it's possible that Utility.TimeSinceLastAction won't be updated in a timely fashion. You'd need to modify the code to check the current pagegroup and group, and only do the GoHome if you weren't already on the home page.

The separation between GoHome, GoDevice and GoMacro is for historical reasons, the original CCF format is based on that of the Phillips Pronto which divides pages into Home, Device and Macro.

It would make sense for a future version of NR to have a GoPage function that works for any group and page.

NeoMorph
August 8th, 2007, 11:33 AM
I was thinking of the situation where something else is running on the same PC and consuming a lot of CPU - it's possible that Utility.TimeSinceLastAction won't be updated in a timely fashion. You'd need to modify the code to check the current pagegroup and group, and only do the GoHome if you weren't already on the home page.

Gotcha... Makes sense now.

BTW... the initials in my Avatar stand for "Oh Darn, NeoMorph's asking questions" again. ;)

The number of questions I've thrown at you guys in the last couple of weeks has been a lot but most of the time I have made a search for. Problem is most of the time I don't know what I'm supposed to be looking for. Like getting an integer in Lua... It took me ages to find that the floor() function is actually int(). Sometimes I think language builders are contrary just for the heck of it heh.

Just want to say thanks for the help. It's helped me come a long way in a relatively short time.