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

    Posts

    Recent Best Controversial
    • RE: Multiple screens fo MM.

      @tbbear @Mykle1 Do you mean multiple pages of modules? I don’t see how this would help with configuring two monitors. Are you showing different pages on different displays?

      @Joshrobbs1 The Raspberry Pi will not support a second monitor out of the box. It is possible to support a second monitor on the RPi, but it will require additional hardware and a different flavour of Linux: See here You could also look for an old laptop that already supports dual monitors, which may be easier and give your setup much more memory and processing power.

      Even if you run two separate computers, you may decide to have them run off of a single MM server (think RPi3b with MM install, and an RPi0W that connects to it). Have a look at this tread here. Because their index.html codeblock is empty, I think @Alvinger used code (something like) this:

      document.documentBody.setAttribute('data-useragent', navigator.userAgent);
      

      Anyhow, this solution can be used regardless of whether the monitors are connected to the same computer, if you simply want to avoid running a separate instances of MM on each computer. This way you can decide which modules appear on each of your displays simply by using two different browsers.

      posted in General Discussion
      N
      ninjabreadman
    • RE: What is the difference between require() and getScripts()?

      @E3V3A

      require() is for when you mean “I’m going to use this code somewhere else in this script I am writing right now” — i.e. somewhere on the server-side.

      getScripts() is for when you mean “my client-facing/browser code will need this loaded to perform some operation” — i.e. somewhere on the client-side.

      (As always, this is what I understand and hope someone will correct me if I’m wrong.)

      posted in Development
      N
      ninjabreadman
    • RE: What is the difference between these function definitions?

      @E3V3A The former is object notation; therefore, you need to be defining an object. For example:

      var Lemon = {
        skinColor: "yellow",
        juice: 10, // in mL
        squeeze: function() {
          return this.juice;
        }
      }
      

      That way, for each Lemon you can call Lemon.squeeze(). It is relative to itself; the Lemon returns its juice, that it only knows about because it’s a complete object.

      Meanwhile, if you have myFunction() it doesn’t belong to an object. It just exists. You can call it from anywhere as myFunction(). You can even assign it to another variable and call it from there (this is also why you can pass a callback function as an argument):

      var myFunction = new function(){
      ...
      }
      var otherFunction = myFunction;
      otherFunction();
      

      You can also have “lambda” functions that have no name.

      But, to answer your question, you can only use the “object” style if you’re in the middle of defining an object. An “object” style function (most often called a “method” of the object) can also reference the object itself, whereas as a function without an object needs it to be passed as a parameter, such as squeeze(someLemon).

      posted in Development
      N
      ninjabreadman
    • RE: can't get the webcam to work

      @xela That’s a whitelist issue; the ipWhiteList controls which computers can connect to the MM server. address controls what the electron instance connects to.

      Have a look here for @mochman’s ipWhiteList config walkthrough. If you’re on an IPv6 network, it’s not altogether intuitive for those of us who grew accustomed to IPv4.

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Calendar just loading

      Are these the files you found and changed?

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: MMM-Tabulator: How to port HTML JS imports to node JS imports? [solved]

      @E3V3A These paths are relative to your module file, which is why this.file() is needed.

      I believe you could have alternately start with a slash, which makes the path relative to the server root:

      '/modules/MMM-Tabulator/node_modules/jquery/dist/jquery.min.js',
      '/modules/MMM-Tabulator/node_modules/jquery-ui-dist/jquery-ui.min.js',
      '/modules/MMM-Tabulator/node_modules/jquery.tabulator/dist/js/tabulator.js'
      
      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Adding jQuery

      @E3V3A When I look up the error, I find this thread which says:

      Check if the file path is correct and the file exists - in my case that was the issue - as I fixed it, the error disappeared.

      I suspect that jQuery is installed in your module’s node_modules folder, and not at the root of your MagicMirror (I may however be wrong).

      In which case I would expect jQuery to be installed at “http://192.168.1.2:8080/modules/MMM-Tabulator/node_modules/jquery-ui-dist/jquery-ui.css”. This is why in your thread here you needed to use this.file() so that it created a relative path.

      posted in Requests
      N
      ninjabreadman
    • RE: Hey Guys, I need help

      @Shisim It is telling you what line it’s on (e.g. 56) and also why there’s a problem (e.g. Expected ']' to match '[' from line 28 and instead saw ':'). There were a handful of missing brackets and braces.

      I’ve fixed your errors and placed the file here. I’ll leave the link live for a week or so. I’ve also left comments where you were missing brackets or braces. You will need to learn what they do and how to balance them.

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: can't get the webcam to work

      @xela You’ll want the address to be localhost or 127.0.0.1.

      I don’t know exactly how it’s working with 0.0.0.0 and reaching the loopback to display the server, but Chromium (and therefore electron) will only allow the camera over http for those addresses.

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Custom module_data in payload MMM remote control

      @saifkazi Have a look at node_helper.js and the answerPost() and answerGet() functions. You should be able to modify one to catch your additional data and modify the position of a given module. Not sure if you can change the position on the fly, or whether you need to write the config and restart the mirror.

      posted in General Discussion
      N
      ninjabreadman
    • 1
    • 2
    • 9
    • 10
    • 11
    • 12
    • 13
    • 20
    • 21
    • 11 / 21