MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Veldrovive
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    V
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 53
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @m1scha
      I checked out MMM-Remote-Control and it is just a problem with string representations.

      remote?action=NOTIFICATION&notification=“SELECT_PAGE”&payload=0 sends the literal notification “SELECT_PAGE” including the quotes. A more correct request would be remote?action=NOTIFICATION&notification=SELECT_PAGE&payload=Main which would switch the the page called main.

      However, in order to support other modules, pages are 1 indexed by notification so to switch to the first page, you would send remote?action=NOTIFICATION&notification=SELECT_PAGE&payload=1

      Strings that are numbers are handled correctly by MMM-Page-Selector.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @m1scha
      Hello, glad you’re enjoying the module.

      I am assuming that your page has some name that is not "0".

      I haven’t extensively tested with magic mirror remote, but I imagine the issue is with setting payload to be a string. When it gets a string, MMM-Page-Selector assumes it is the name of the page, not a page index. If an integer is sent, it assumes it is a page index.

      I don’t know how remote works, but you might be able to use
      http://ip:8080/remote?action=NOTIFICATION&notification=“SELECT_PAGE”&payload=0

      Or you could specify your page name as
      http://ip:8080/remote?action=NOTIFICATION&notification=“SELECT_PAGE”&payload=“YOUR_PAGE_NAME”

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @Brandenborg
      The latest version of this module now has this as a (Not very well tested) feature.
      You can now specify a restoreDefault prop in the MMM-Page-Selector config with the number of seconds you want before it returns to the default page.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @Brandenborg
      The 0 should be the position of your default page in the page list. The furthest left is 0.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @Brandenborg
      This is not a default function of this module. However, if you can edit a small amount of code, it should be easy to implement.
      Just copy these lines of code right after line 235 of MMM-Page-Selector.js. This lines should be selectPage(payload);

      clearTimeout(self.default_timeout);
      if(![0, this.config.defaultPage].includes(payload)){
          self.default_timeout = setTimeout(() => {
              selectPage(this.config.defaultPage);
          }, TIME)
      }
      

      Then just replace TIME with the number of milliseconds you want to remain on the page before it automatically switches back to default. You may also have to change the 0 in the if statement if your default page isn’t at the 0th position.

      posted in System
      V
      Veldrovive
    • RE: How to run as "https"?

      I’m not familiar with how a PWA works so I’m not quite sure what you are asking here. Are you saying that you have a PWA running that has a valid ssl encryption and you want to send requests from the PWA to your magic mirror, but they are being blocked due to mixed content policies?
      What happens when you request to the magic mirror that is using the unsigned certificate?
      A wildcard certificate handles subdomains so if you wanted to use the same certificate you would need to point a subdomain to your magic mirror.

      posted in Troubleshooting
      V
      Veldrovive
    • RE: How to run as "https"?

      @Lorenz
      In order to get a signed certificate, you need to go through a CA or certificate authority. Most of the time, magic mirrors are run on localhost and therefore cannot get a signed certificate so you just have to trust the IP on your browser and deal with the fact that it is not “trusted”.
      If you do happen to have a domain lying around, you can get a signed certificate for that and then use it to have a trusted website, but that’s a bunch of work and usually not worth it. If you do decide to go that route, there are a couple of places to sign certificates for free and I would suggest a quick google search to find them.

      posted in Troubleshooting
      V
      Veldrovive
    • RE: How to run as "https"?

      @Lorenz
      Could you post your server.js file so we can just make sure there aren’t many spelling mistakes?

      • The first thing that you should do is make sure that the path you supplied to the key and cert is correct. This error can arise if you are not pointing to the correct files.
      • Second, you can try to remake the cert and key and see if there was just some error the first time.
      • Third, I would try to figure out if the SSL version is correct. I’m not especially sure how this works, but when I ran into this issue once, somebody had said that the TLS version was incorrect.
      • Last, I would just try to reinstall openSSL and generate a new key.
      posted in Troubleshooting
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @rudibarani
      If I am understanding what you are asking for correctly, this function seems to be out of the scope that Page-Selector encompasses. I would develop a module to include this functionality, but I have been inactive in the world of Magic Mirror as of lately. As it stands, I would post this request to the module suggestions forum or ask somebody to include it in a module that has a closer association with this type of purpose. MMM-Remote-Control could be a good candidate.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @Johans,
      Ah, I believe the confusion comes from the fact that old discussions on this forum do not reflect the current functionality of the module. I try not to make any changes that break old config files, but one was necessary.
      In order to fix this config, you need to replace any instance of pages: "all" with pages: {"all": "some_position"}
      New versions don’t require you to have a position prop at all and you can just use the pages one.
      For more information, refer to the README.
      Hope this helps.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @rudibarani,
      Ok, the development branch now has support for the new class name changes. When a module is shown on a page, it will be given the class page_{Current Page} and then the class will be removed when the module is hidden.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      Ah right. I need to get around to making those changes. I’ll start on them in the morning.

      posted in System
      V
      Veldrovive
    • RE: MMM-Inspirational-Quotes is now here

      It’s truly a gem of the internet and I’m glad that I could share it with the world.

      posted in Entertainment
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      Hey @rudibarani,
      If there are no errors being thrown, then I would make sure that you are on the development branch and not master as I am still not sure how stable some changes are so I am refraining from merging.
      If that is not the problem, I would open up thenode_helper.js file and put console.log() statements in some places to make sure they are running correctly.

      1. Line 30 should be self.restorePage(). I would put on right before that. If it never runs, then there is a problem with how the frontend is handling the config.
      2. Line 38 should then be jsonObj = JSON.parse(obj);. I would print out the value of jsonObj right after that runs to see if the page key is in it.
      3. Line 57 should then be reject(err);. I see that I accidentally didn’t include any debug information when this rejects so put a log that prints out the error directly before this.

      If the problem isn’t immediately obvious, posting the output of those logs would go a long way to figuring this out.

      posted in System
      V
      Veldrovive
    • MMM-Inspirational-Quotes is now here

      The moment we have all been waiting for is upon us. That is if you have been waiting for the moment when bot-created inspirational quotes can be delivered directly to you through the medium of a magic mirror.
      Just to be clear, most of these quotes will not make you inspired, but they will all make you laugh so I think that’s a good trade-off.
      The image generation is done using inspirobot and this module is simply a wrapper for it.
      demo2

      Download and usage instructions can be found on the Github Page

      posted in Entertainment
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      Oh, that’s odd that it is going in inverse order. I must have made a mistake somewhere. I’ll be looking into that and reversing it.

      I have finals coming up soon which means I don’t have very much time to support this and a more intuitive way of ordering the elements will take a bit of time.

      Can you clarify what you mean with your last statement? If I am interpreting it correctly, you are saying that you would like a way of specifying CSS for specific pages. If I’m not mistaken, this would be a pretty quick and easy change as I would just update the class list to include the current page name.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @rudibarani Good to know that’s a solution.
      Right now, modules are stacked in the order that they appear in the config file. If a module is above another in the config, it will be above that other one on the page.
      However, with a little work, that could be changed. Do you think that it would be helpful to be able to change that on a page to page basis?

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @rudibarani
      Good stuff. I’m glad everything is working out.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      Hey robiv,
      I do actually prefer to have issues opened on GitHub. That way I can more easily keep track of them and also it provides a record of my work in case I want to use it in order to prove my merit.
      Thanks for asking.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      Yep, I can verify that it is in fact WatchDog.
      I can also provide an explanation and a patch that you can do yourself. The way I made it possible to not include the position prop anymore is by building a temporary config, loading that one, restarting magic mirror, and then replacing the temporary with the original. I’m really sure of the underlying reason, but this process seems to trigger WatchDog to trigger an abort.
      As robiv says, combined with pm2, this causes a restart loop.
      The two easiest ways to get around this are:

      1. Don’t use watchdog. If you don’t think that you are going to experience crashes, then that works
      2. Give a position prop to every module. Including position props doesn’t change any of the visual function and that way, Page-Selector never triggers a restart and the problem doesn’t occur in the first place. The config for any given module should follow this format:
      {
          module: 'MMM-module-name',
          position: 'any_position' //It doesn't matter what it is
          disabled: false,
          config: {
              ...
          }
      },
      

      I will try to find a way to make the modules play well together, but that might take a while.

      posted in System
      V
      Veldrovive
    • 1 / 1