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

    Posts

    Recent Best Controversial
    • RE: My Setup (or: How crazy I am)

      Haha. Well it very much helped me, convoluted or not.

      But in any case, since electron is essentially a html browser, you can refresh and use a console just like any other browser, which is actually something I didn’t know prior (F5 on Windows and ⌘+R on a Mac)

      So with that said, I simply work on my files on my local system and push them to the Raspberry Pi.

      Using “npm start” allows me to launch the application on my system, and using “⌘⌥ + I” brings up the console allowing me to debug.

      I actually prefer your method :smile: !

      posted in Development
      E
      Eunanibus
    • RE: http request

      Having good success. Can I get an example of the XML you’re trying to display?

      posted in Development
      E
      Eunanibus
    • RE: Debugging

      Your last post helped immensely! Thank you!

      posted in Development
      E
      Eunanibus
    • RE: http request

      Ok. I took a look at this last night and I’m getting somewhere so let me get back to you on this. I’m just trying to create the module for you.

      posted in Development
      E
      Eunanibus
    • RE: Debugging

      Even when writing console.log(’ ') nothing appears in the terminal, so I just assumed it was logging elsewhere.

      How are you accessing it via your browser?

      posted in Development
      E
      Eunanibus
    • RE: Debugging

      Thanks for your response. I’m still working on it (and something else for another member) - I’m still having trouble accessing/finding a log. For the most part, right now, I’m running the npm from my computer directly and using the electron app there.

      I’m not able to find any log file, or any tool that allows me to debug in real-time. Because of the nature of this app and the modules, it becomes a little more complex than just following instructions that I’ve seen/Any advice?

      posted in Development
      E
      Eunanibus
    • RE: http request

      I’m replying Mobile at the moment so I can’t give you a comprehensive answer (sorry) - does it say which line the error occurs?

      Ensure that the parseData function is not within the GetDom() method, but isolated on its own. Go through and ensure that the document.createElement(“div”) function is referencing a document.

      Sorry, I mocked up that code in about 10 minutes and I’m not an expert so there may be issues.

      posted in Development
      E
      Eunanibus
    • RE: http request

      Sure. So I’d probably go about it with this approach and work from there:

      Try starting with the HelloWorld module and work from there. I’d start with putting this in the GetDom() function and return the contents of whatever you want displayed in the wrapper by appending it.

      var wrapper = document.createElement("div");
      var xmlhttp = new XMLHttpRequest();
      var url = "http://ip:8889/status.xml";
      
      xmlhttp.onreadystatechange = function() {
          if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
              var results = JSON.parse(xmlhttp.responseText);
              wrapper.innerHTML = parseResults(results);
          }
      };
      xmlhttp.open("GET", url, true);
      xmlhttp.send();
      return wrapper;
      
      function parseResults(results) {
         var nodes = results.childNodes;.
         var resultsContainer = document.createElement("div");
          var out = "";
          var i;
          for(i = 0; i < results.length; i++) {
              var resultWrapper = document.createElement("div");
              resultWrapper.innerHTML = x[i].nodeName + ": " + x[i].childNodes[0].nodeValue + "<br>";
            resultsContainer.appendChild(resultWrapper);
          }
          return resultsContainer;
      }
      

      I’m a bit of a beginner too, but I think that might give you something to start with?

      posted in Development
      E
      Eunanibus
    • RE: Debugging

      Darn. That makes things a little more difficult.

      Any advice on how to approach that then? Since I have a dynamic 3D object that needs a rendering size to construct.

      I can keep it at a static size, allow config files to set it?.. Small, medium and large I guess?

      posted in Development
      E
      Eunanibus
    • RE: Debugging

      That makes sense. So then I guess I have 2 questions leading on from that:

      1. I’m attempting to create a dynamic 3d model but I need a height and width. Is there any way to retrieve the rendered height and width at runtime based on the resolution?

      2. Using a browser to go to the rip’s IP via the MM port sounds useful. How do I retrieve the rip’s IP/MM port?

      thanks again for the response

      posted in Development
      E
      Eunanibus
    • 1 / 1