Can no longer launch SmartRemote template in a web browser

More
2 years 1 month ago #2814 by Nillaz
When I'm making changes to the remote I generally prefer to do my testing on one of the remotes themselves, but I realized I'll probably find being able to load this in a browser useful as I make some YouTube videos about the SmartRemote, how I configure things, and how I use the system in practice. I used to be able to do this by going to my.ipaddress/smartremote/ but I must have hosed something as this is no longer working correctly for me.

I thought at first it wasn't loading anything at all as I was looking at a black screen, but then I realized that I'm looking at the index.html background image (I'm just using a solid black color instead of a background image). However, none of the smartremote's page elements themselves are showing up. I've tried clearing the Chrome cache and that didn't make a difference.

So I wondered if I had screwed something up when moving files from my existing project to the smartremote-sample template. I downloaded a fresh copy of the smartremote-sample folder and tested that. It does the same thing...Chrome only loads the background without the page elements.

So then I checked the moonlightphones-sample and it loads the sample index page correctly. Weird.

Anyone have any thoughts as to what might be going on? I'm assuming that at least some of you open the remote in a browser (or use the Launch feature in myDesigner which pretty much amounts to the same thing) when working with/adding things to the remote. Any insights would be greatly appreciated!

Please Log in to join the conversation.

More
2 years 1 month ago #2815 by bowlingbeeg
I always test on the remote itself as well. I just tried this through MyDesigner and a web browser and I only get the background image just like you.
The following user(s) said Thank You: Nillaz

Please Log in to join the conversation.

More
2 years 1 month ago #2816 by bowlingbeeg
I see this error, not sure if it's related or not:

fxApp.js?ver=87647984:333 Uncaught ReferenceError: srApp is not defined
at AppCore.initApp (fxApp.js?ver=87647984:333:13)
at HTMLDocument.checkForReady (fxApp.js?ver=87647984:1402:13)

And here is the code .. which by the way looks wrong since no matter which leg it taken the variable is set to 1.

if (srApp.backlightOnMotion) {
this.doCommand("SetVariable|smartremote_backlightonmotion_clientname~1")
} else {
this.doCommand("SetVariable|smartremote_backlightonmotion_clientname~1")
}

Please Log in to join the conversation.

More
2 years 1 month ago #2817 by bowlingbeeg
Commented out that code and still don't get anything other than the background image.

Please Log in to join the conversation.

More
2 years 1 month ago #2818 by Nillaz
Thanks for taking a look at this! At least I know that this time it wasn't something I broke! lol

Please Log in to join the conversation.

More
2 years 1 month ago - 2 years 1 month ago #2822 by davep
This is fixed in the Samrtremote-Sample I just uploaded. The section of code that was mentioned above can only be run from the SmartRemote itself. I forgot to test to make sure it was running from a remote. And yes a 1 needed to be a 0.

Copy the fxApp.js file from the sample into your project or inject the following change into your current version.

            if (typeof(srApp) !== 'undefined') {
               if (srApp.backlightOnMotion) {
                  this.doCommand("SetVariable|smartremote_backlightonmotion_clientname~1")
               } else {
                  this.doCommand("SetVariable|smartremote_backlightonmotion_clientname~0")
               }
               this.doCommand("SetVariable|smartremote_backlightonseconds_clientname~" + srApp.backlightDelay);
            }
Last edit: 2 years 1 month ago by davep.
The following user(s) said Thank You: Nillaz

Please Log in to join the conversation.

Time to create page: 0.182 seconds