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

    Posts

    Recent Best Controversial
    • API for Map image

      What API’s do you guys use to get satellite image? Preferably one with a dark theme.

      posted in Development
      T
      Temisola1
    • RE: Module UI Design

      @sdetweil said in Module UI Design:

      n

      Okay, so I I have to create another html tag or will it inherit the master?

      posted in Development
      T
      Temisola1
    • Module UI Design

      How can I go about designing the UI for my module. Is there any site I can use as a playground to design the UI?

      Thanks,

      posted in Development
      T
      Temisola1
    • RE: child_process won't execute

      Thank you all for all your wonderful suggestions. I’m able to run my python script successfully now. Thanks!

      posted in Development
      T
      Temisola1
    • RE: Module creation workflow - Newbie

      @sdetweil Amazing. Thank you.

      posted in Development
      T
      Temisola1
    • RE: Module creation workflow - Newbie

      @sdetweil I think I see what your mean now. Can I do, for instance, something like

      wrapper.innerhtml = "<h1>This is some random text</h1>"
      
      
      posted in Development
      T
      Temisola1
    • RE: child_process won't execute

      @sdetweil after running successfully a few times it now returns Buffer 48 45 5c… or something that looks like hexadecimal code

      posted in Development
      T
      Temisola1
    • RE: child_process won't execute

      @sdetweil So I tried putting in the full path in my node_helper as opposed to relative path and that seemed to work. is there a way I can log the current directory in nodejs. It seems that’s the issue

      posted in Development
      T
      Temisola1
    • RE: child_process won't execute

      @sdetweil said in child_process won't execute:

      node testit.js

      Yes, that works in the console.

      posted in Development
      T
      Temisola1
    • RE: child_process won't execute

      @sdetweil That is correct. It works up till that point.

      posted in Development
      T
      Temisola1
    • RE: child_process won't execute

      @sdetweil thanks for the response. that doesn’t seem to be working either.
      Is there something I need to install to be able to use stdout?

      posted in Development
      T
      Temisola1
    • RE: Module creation workflow - Newbie

      @sdetweil How can I construct ModuleName as an html?

      posted in Development
      T
      Temisola1
    • child_process won't execute

      I’m trying to execute a python script using the child_process. However my function doesn’t seem to be triggering.

      const spawn = require("child_process").spawn
      var NodeHelper = require("node_helper")
      const process = spawn("python3", ["return_something.py"])
      
      module.exports = NodeHelper.create({
        start: function() {
          this.countDown = 10000000
        },
        socketNotificationReceived: function(notification, payload) {
            switch(notification){
                case "DO_YOUR_JOB":
                  console.log(payload)
                  this.sendSocketNotification("I_DID", (this.countDown - payload))
                  break
                case "RETRIEVE_DATA":
                  console.log(payload)
                  this.job()
                  break
            }
        },
        job: function(){
          console.log("I'm trying to retrieve data")
          process.stdout.on('data', (data)=>{
            //********everything works up till here
              console.log("inside")
            var result = String.fromCharCode.apply(null, new Uint16Array((data)))
            this.sendSocketNotification("DATA_RETRIEVED", result)
          })
        }
      })
      

      Python script.

      import sys
      
      print("Hello, I'm Amira")
      
      sys.stdout.flush()
      
      posted in Development
      T
      Temisola1
    • Module creation workflow - Newbie

      Hello all. I’m currently trying to build a custom module. I’ve been trying to wrap my head around it for a few days but I think I finally have a decent understanding. I’m not that familiar with node.js so my question might sound stupid. I understand that the MMM-ModuleName.js pretty much passes data or documents to the main html. Is it possible to have an html file with custom html already defined, a table of data for example, load it in your MMM-ModuleName.js using nodejs, modify the contents using the elementid and then pass that to the main html? As opposed to creating the html using nodejs. Again, I’m pretty green when it comes to nodejs please forgive me.

      posted in Development
      T
      Temisola1
    • 1 / 1