-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No visible icon. #2
Comments
I'm sorry it isn't working for you! We'll fix it. I can see the icons appear when I change the command to "true". Let's start there and see if the command is causing problems for you. You can also see a problem by running "node serveronly" in one window and using FireFox in another window to view the page. The terminal window will show exception traces and the like. You should see something like this when it starts:
That's the server queuing up the updates to fire on your schedule. Next, right-click in FireFox and select "Inspect Element". Click the "Inspector" tab and navigate down the HTML until you see something like this: <div id="module_9_MMM-ScriptScheduler" class="module MMM-ScriptScheduler MMM-ScriptScheduler">
<div class="module-content">
<div>
<span id="scriptsched_0" class="fa-stack fa-lg" style="display: block; margin: 20px; color: rgb(0, 221, 0);">
<i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-warning fa-fw fa-stack-1x fa-inverse"> If you have this, it means the browser correctly drew everything based on your config. If you see If it doesn't say Another thing to help gather info is to make sure nothing else is interfereing since all modules are playing in the same DOM and some mess with the css using global-ish matchers. Add Cheers! |
Thank you for your detailed answer. I am working with a Raspberry Pi 3b+ and I can't do the firefox-stuff. Disabling most of the modules (except clock, calendar and newsfeed) did not change anything. The schedules are working but no icon shows up. How could we approach the issue differently? Cheers |
Let's get a regular browser hooked up to it so we can inspect what HTML is being generated and updated. Your Pi is a Linux box like anything else, so we should be able to run MagicMirror so it's listening on a socket other than loopback. Check your config.js file for something like this: address: "localhost",
port: 8080,
ipWhitelist: [] "localhost" means MagicMirror will not be available outside your Pi. Change this to " This config means you can point a web browser on your local network to MagicMirror running on your Pi. From a laptop/desktop at home, try going to "http://1.2.3.4:8080/" where "1.2.3.4" is the IP address of your Pi. From there, try the steps above to see what HTML is being rendered! |
Thank you. Pretty cool. |
Awesome result, thanks for taking the time to rejigger the thing. If things are firing and you aren't seeing "block", then the cron logic on the server is working, but the portion that tells the browser-resident code to update isn't. Here's the important snippet: exec(schedCfg.command, function(error, stdout, stderr) {
if (stdout) console.log(stdout);
if (stderr) console.log(stderr);
me.sendSocketNotification("UPDATE", { index: indx }); It runs your command (which is working), it logs everything the command sent to it's terminal (output), and then tells the browser to update. Because I'm using Try this: {
schedule: "0 19 * * *",
command: "echo 'amixer 60' && amixer set Playback '60%' ; echo \"RC $?\"; true",
icon: "volume-down",
color: "#4875b4"
} I can't test this where I am right now, but it looks sound (?!). This will put something in the log then run amixer, then write to the log with the status return from amixer, and then force the return code to be successful ( From the logs, we can see if the amixer command is failing for some reason. Next, you should see messages in the browser's console log from this debugging statement: console.log("update: " + JSON.stringify(payload, null, 3)); Let me know what it shows. If this appears, it confirms the above sent a message to the browser telling it to update the HTML. If it doesn't appear, it's the smoking gun: the server isn't telling the browser to update. |
Your suggested command is firing but still no icon. MagicMirror-logs:
Unfortunately I don't know what to do with
But this is what I was able to find in the browser-logs:
I do get this output from every other schedule, too. Does it help in any way? |
You found the smoking gun!
This means the browser can't find the HTML element it's supposed to turn visible. This is the "MMM-ScriptScheduler.js:71" from the error message above: span.style.display = shouldBeVisible ? "block" : "none"; It means the schedule entry that fired sent data to the browser for (maybe?) the wrong icon to turn visible. There are troubleshooting entries in the code that will tell us what happened. From the previous note above, This message will tell us the number that the server told the browser to turn on. We're nearly there. Thanks for sticking with me through what must be a confusing set of steps. |
I am impressed by your patience and helpfulness! There's the following in the console starting with "update:"
And after the second schedule fires there is a new one saying
Is this it? |
Yup, but I was hoping it wasn't 0 or similar small number. OK, this means the server is sending the right thing to the browser. I.e., "index: 1" means the 1st (starting counting from 0) entry in your config is the icon that needs to be shown on the browser display. Let's see what is drawn in the HTML. In your Firefox browser after "Inspect Element" window is open at the bottom, click on the "Inspector" tab. There's a little "Search HTML" entry box. Type in "scriptscheduler". It should jump and highlight a line that looks like this: <div id="module_9_MMM-ScriptScheduler" class="module MMM-ScriptSched...
Right-click on this blue line and select "Copy" then "Outer HTML". Paste it here in the next comment. This is the full HTML that the MMM-ScriptScheduler created in the browser. We'll dissect this together and see why "index:0" and "index:1" weren't found! Here's what I see when I Copy Outer HTML: <div id="module_9_MMM-ScriptScheduler" class="module MMM-ScriptScheduler MMM-ScriptScheduler">
<div class="module-content">
<div>
<span id="scriptsched_0" class="fa-stack fa-lg" style="display: block; margin: 20px; color: rgb(0, 221, 0);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-warning fa-fw fa-stack-1x fa-inverse"></i>
</span>
</div>
</div>
</div> |
Here is what I got <div id="module_4_MMM-ScriptScheduler" class="module MMM-ScriptScheduler MMM-ScriptScheduler">
<header class="module-header">Scheduler</header>
<div class="module-content">
<div>
<span id="scriptsched_0" class="fa-stack fa-lg" style="display: none; margin: 20px; color: rgb(72, 117, 180);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-volume-down fa-fw fa-stack-1x fa-inverse"></i>
</span>
<span id="scriptsched_1" class="fa-stack fa-lg" style="display: none; margin: 20px; color: rgb(72, 117, 180);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-volume-down fa-fw fa-stack-1x fa-inverse"></i>
</span>
<span id="scriptsched_2" class="fa-stack fa-lg" style="display: none; margin: 20px; color: rgb(72, 117, 180);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-volume-down fa-fw fa-stack-1x fa-inverse"></i>
</span>
<span id="scriptsched_4" class="fa-stack fa-lg" style="display: none; margin: 20px; color: rgb(72, 117, 180);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-volume-down fa-fw fa-stack-1x fa-inverse"></i>
</span>
<span id="scriptsched_5" class="fa-stack fa-lg" style="display: none; margin: 20px; color: rgb(238, 238, 0);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-warning fa-fw fa-stack-1x fa-inverse"></i>
</span>
<span id="scriptsched_6" class="fa-stack fa-lg" style="display: none; margin: 20px; color: rgb(238, 238, 0);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-warning fa-fw fa-stack-1x fa-inverse"></i>
</span>
<span id="scriptsched_7" class="fa-stack fa-lg" style="display: none; margin: 20px; color: rgb(238, 238, 0);">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-warning fa-fw fa-stack-1x fa-inverse"></i>
</span>
</div>
</div>
</div> |
Neat. Everything is right where it should be. The At this point, MMM-ScriptScheduler is working correctly and everything is where it should be. You won't like the next sentence, though: there's something wrong with your environment that is affecting ScriptScheduler :-( Let's start by making sure FontAwesome is installed and has the font files setup correctly. This happens automatically during the MagicMirror installation, but something is wrong somewhere, so let's assume nothing! make sure you have the following files based on where MagicMirror is installed:
I'm wondering if the logic is working, but the font images themselves are not available, so the browser is silently failing. If this is the case, try the below. This updates all the dependencies for MagicMirror, including "fontawesome", the library with all the icons in it:
Let's hope this is it! |
Unfortunately the wrong shot. |
Ugh, I'm fast running out of ideas here. We at least narrowed it down to the core problem. Here's another thought that doesn't get this fixed, but does leave you with a usable system: switch from icons to image URLs. Instead of using |
imagurl works flawlessly. |
Thanks for being flexible and working to find something that will get you moving forward. Can we close this issue since we at least proved it isn't ScriptScheduler? |
Off course. |
Hi, I missed something. When I tested the imageurl method I did only set up one schedule. And so far everything worked fine. Schedule was firing and image showed up. But when I added more schedules imageurl wouldn't work either. It turned out that both (icon and imageurl) are working, when I have only one schedule and both are not working with multiple schedules defined. Any clue why this is happening? |
I think I found the smoking gun. Can you reproduce that behavior or is it only happening with my setup? Cheers |
Bingo! Again, thank you for running this to ground. It's definitely a bug in my software that I didn't find. This should be fixed in the latest commit here, which adds important checks that handle when a command, icon, and/or imageurl is not present. Here's my test config:
It's all combinations of missing config items that matter. I let it run for a few cycles, and it behaves correctly:
Please update your install and see what happens:
|
Well done. Now I would really love to have GroveGesture icon/image control as discussed in #3. Sidenote: |
Moved the padding/margin discussion over to #4 |
Hi,
I installed the module a view hours ago.
My schedules are working as expected but no matter what I do no icon shows up.
Changed the 'position' to 'top_right' and added a header which is visible on the MagicMirror screen.
The section in my config.js looks like
Any idea what's wrong?
The text was updated successfully, but these errors were encountered: