MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. emrhssla
    3. Topics
    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 13
    • Posts 49
    • Groups 0

    Topics

    • E

      To delete a commit from git ..

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      4
      1
      0 Votes
      4 Posts
      858 Views
      S
      @emrhssla git log to get the commit number git reset --hard commit_number~ where commit_number is the id of the commit you wish to remove. this will update your local repo. if you have already pushed the commit to a remote, then you will have to repush with git push -f
    • E

      How can I run console.log("text") when I click on an image?

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      3
      0 Votes
      3 Posts
      636 Views
      S
      @emrhssla also, on the module side, logging is Log.log() instead of console.log() then u open the developers window, and select the console tab… currently there is no mechanism to show both parts of a module in the same place node_helper = console.log() - shows in terminal window module.js = Log.log() - shows in developers window, console tab
    • E

      How to change the path of a picture in magicmirror , using MMM-imageSlideshow

      Watching Ignoring Scheduled Pinned Locked Moved Solved Troubleshooting
      17
      2
      0 Votes
      17 Posts
      5k Views
      E
      @sdetweil thank U!!
    • E

      capture.py in MMM-Facial-Recognition-Tools error

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      1
      0 Votes
      1 Posts
      923 Views
      E
      https://forum.magicmirror.builders/topic/6345/facial-recognition-module-step-by-step-guide Referring to the above link, I was following the guidelines. But while following the guide, an error occurred in the Python capture.py part. I am trying to run capture.py but getting this Error. I am using a webcam… python capture.py Traceback (most recent call last): File “capture.py”, line 18, in import lib.capture as capture File “/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/capture.py”, line 12, in from builtins import input ImportError: No module named builtins python3 capture.py Traceback (most recent call last): File "capture.py", line 18, in import lib.capture as capture File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/capture.py", line 21, in from . import config File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools/lib/config.py", line 15, in (CV_MAJOR_VER, CV_MINOR_VER, mv1, mv2) = cv2.__version__.split(".") ValueError: not enough values to unpack (expected 4, got 3) Then im tring to sudo pip install future --upgrade, I modified the code in config.py from CV_MAJOR_VER, CV_MINOR_VER, mv1, mv2 = cv2.version.split(“.”) to CV_MAJOR_VER, CV_MINOR_VER, type = cv2.version.split(“.”) try: python3 capture.py // python capture.py success!! I’m still worried. Is there anything wrong with it later?
    • E

      Camera capture cannot be performed on the Magic Mirror.

      Watching Ignoring Scheduled Pinned Locked Moved Solved Troubleshooting
      5
      4
      0 Votes
      5 Posts
      2k Views
      E
      @Sean thank you!
    • E

      node_helper.js does not work.

      Watching Ignoring Scheduled Pinned Locked Moved Solved Troubleshooting
      21
      2
      0 Votes
      21 Posts
      6k Views
      S
      @emrhssla said in node_helper.js does not work.: But I don’t know why /pi/Desktop/Beauty/Magicmirror isn’t working. Is this because of /pi/Magicmirror? because its a mess with all that macOS level binaries installed… i had to rm -rf ~/Desktop/Beauty/node_modules/electron cp ~/MagicMirror/node_modules/electron ~/Desktop/Beauty/node_modules to get the UI to show on the pi… i tested before by executing Electron to show some page in a terminal window ON THE PI do ~/Desktop/Beauty/node_modules/electron/dist/electron http://cnn.com this should open electron to show some web page initially I got a frame, with empty insides
    • E

      npm install error

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      11
      2
      0 Votes
      11 Posts
      5k Views
      S
      @emrhssla yeh, my fault… i had u erase too much, there is a supplied node_helper module in the modules folder… you can copy it from the /pi/MagicMirror installation cp -r ~/MagicMirror/modules/node_modules/node_helper ~/newTest/modules/node_modules
    • E

      Even a simple node_help.js example does not run.

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      13
      4
      0 Votes
      13 Posts
      3k Views
      S
      Looks like your system doesn’t have python installed.
    • E

      I don't know how to use node_helper.js.

      Watching Ignoring Scheduled Pinned Locked Moved Solved Troubleshooting
      6
      0 Votes
      6 Posts
      3k Views
      E
      @sdetweil oh!!! [image: 1555075763163-acdbfe01-9c20-45b9-a177-87d554b225e0-image.png] thank you very very very much :)
    • E

      modules[i].show isn't runnig

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      1
      1
      0 Votes
      1 Posts
      456 Views
      E
      I use MMM-Modulebar. To briefly explain the Modulebar Module, create several buttons and press each button to show each module and hide it once again. The following code was added from the original Modulebar code(99th-108th lines): if(num==1){ Modulebarr.sendNotification('CHANGE_POSITIONS', modules = { 'clock':{ visible: 'true', position: 'top_left', }, } ); } num is the button’s unique number I sent a notification from Modulebar to MMM-Dynamic-Modules. Dynamic-Modules notification worked well. But the next cord line, modules[i]Show didn’t work. Error details are as follows: [image: 1554791375604-c0fc6e84-cc73-451c-8937-bc3e56c11f19-image.png] var Modulebarr; Module.register("MMM-Modulebar",{ requiresVersion: "2.1.0", defaults: { // Allow the module to force modules to be shown (if hidden and locked by another module ex. profile-switcher). allowForce: false, // Determines if the border around the buttons should be shown. showBorder: true, // The minimum width for all the buttons. minWidth: "0px", // The minimum height for all the buttons. minHeight: "0px", // The location of the symbol relative to the text. Options: left, right, top or bottom picturePlacement: "left", // The direction of the bar. Options: row, column, row-reverse or column-reverse direction: "row", // The speed of the hide and show animation. animationSpeed: 1000, // The default button 1. Add your buttons in the config. buttons: { "1": { // The modules exact name to be affected. module: "clock", // The text to be displayed in the button. text: "Clock", // Then symbol from font-awesome! symbol: "clock-o" } } }, start(){ Modulebarr=this; }, // Define required styles. getStyles: function(){ return ["font-awesome.css", "MMM-Modulebar.css"]; }, // Override dom generator. getDom: function() { var menu = document.createElement("span"); menu.className = "modulebar-menu"; menu.id = this.identifier + "_menu"; menu.style.flexDirection = this.config.direction; // Sends each button to the "createButton" function be created. for (var num in this.config.buttons) { menu.appendChild(this.createButton(this, num, this.config.buttons[num], this.config.picturePlacement)); } return menu; }, // Creates the buttons. createButton: function (self, num, data, placement) { // Creates the span elemet to contain all the buttons. var item = document.createElement("span"); // Builds a uniqe indentity / button. item.id = self.identifier + "_button_" + num; // Sets a class to all buttons. item.className = "modulebar-button"; // Makes sure the width and height is at least the defined minimum. item.style.minWidth = self.config.minWidth; item.style.minHeight = self.config.minHeight; // Collects all modules loaded in MagicMirror. var modules = MM.getModules(); // When a button is clicked, the module either gets hidden or shown depending on current module status. item.addEventListener("click", function () { // Lists through all modules for testing. for (var i = 0; i < modules.length; i++) { // Check if the curent module is the one. if (modules[i].name === data.module) { // Splits out the module number of the module with the same name. var idnr = modules[i].data.identifier.split("_"); // Checks if idnum is set in config.js. If it is, it only hides that module, if not hides all modules with the same name. if (idnr[1] == data.idnum || data.idnum == null) { // Check if the module is hidden. if (modules[i].hidden) { // Check if there is a "showURL" defined. if (data.showUrl != null) { // Visiting the show URL. fetch(data.showUrl); // Prints the visited hideURL. console.log("Visiting show URL: "+data.showUrl); } // add code if(num==1){ Modulebarr.sendNotification('CHANGE_POSITIONS', modules = { 'clock':{ visible: 'true', position: 'top_left', }, } ); } // modules[i].show(self.config.animationSpeed, {force: self.config.allowForce}); // Prints in the console what just happend (adding the ID). console.log("Showing "+modules[i].name+" ID: "+idnr[1]); }else{ // Hides the module. modules[i].hide(self.config.animationSpeed, {force: self.config.allowForce}); // Prints in the console what just happend (adding the ID). console.log("Hiding "+modules[i].name+" ID: "+idnr[1]); // Check if there is a "hideURL" defined. if (data.hideUrl != null) { // Visiting the the URL. fetch(data.hideUrl); // Prints the visited hideURL. console.log("Visiting hide URL: "+data.hideUrl); } } } } } }); // Fixes the aligning. item.style.flexDirection = { "right" : "row-reverse", "left" : "row", "top" : "column", "bottom" : "column-reverse" }[placement]; // Sets the border around the symbol/picture/text to black. if (!self.config.showBorder) { item.style.borderColor = "black"; } // Adds the Font-Awesome symbol if specified. if (data.symbol) { var symbol = document.createElement("span"); symbol.className = "modulebar-picture fa fa-" + data.symbol; // Sets the size on the symbol if specified. if (data.size) { symbol.className += " fa-" + data.size; symbol.className += data.size == 1 ? "g" : "x"; } // Align the symbol with a margin. if (data.text && placement === "left") { symbol.style.marginRight = "4px"; } // Adds the symbol to the item. item.appendChild(symbol); // Adds a picture if specified. } else if (data.img) { var image = document.createElement("img"); image.className = "modulebar-picture"; image.src = data.img; // Sets the size of the picture if specified. if (data.width) image.width = data.width; if (data.height) image.height = data.height; // Align the picture with a margin. if (data.text && placement === "left") { image.style.marginRight = "4px"; } // Adds the picture to the item. item.appendChild(image); } // Adds the text if specified. if (data.text) { var text = document.createElement("span"); text.className = "modulebar-text"; text.innerHTML = data.text; // Align the text with a margin. if ((data.symbol || data.img) && placement === "right") { text.style.marginRight = "4px"; } // Adds the text to the item. item.appendChild(text); } // All done. :) return item; }, notificationReceived: function(notification, payload) { if(notification === "DOM_OBJECTS_CREATED"){ this.hide() } } }); config is { module: "MMM-Modulebar", position: "top_left", classes: "default everyone", config: { showBorder:false, direction:"column", buttons: { "1": { module: "MMM-EmbedYoutube1", width:"50", height:"50", text:"먹방", \ img:"https://image.flaticon.com/icons/svg/1643/1643011.svg", }, }, } },
    • E

      How can I change the variable value of the config after the magic mirror is run? I want to change the config of MMM-embedYoutube through MMM-Modulebar.

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      9
      2
      0 Votes
      9 Posts
      1k Views
      E
      @sdetweil success using notification! thank you!
    • E

      modules.data.position is not changed

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      4
      0 Votes
      4 Posts
      780 Views
      S
      @emrhssla if you did this kind of change, the module code should not know…
    • E

      Uncaught TypeError: this.sendNotification is not a function at HTMLParagraphElement.

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      4
      0 Votes
      4 Posts
      2k Views
      ?
      Try this; notificationReceived: function(notification, payload, sender) { switch(notification) { case "DOM_OBJECTS_CREATED": var elem = document.getElementById("TEST") elem.addEventListener("click", () => { this.sendNotification('CHANGE_POSITIONS', ... ... }, Or, notificationReceived: function(notification, payload, sender) { switch(notification) { case "DOM_OBJECTS_CREATED": var elem = document.getElementById("TEST") var that = this elem.addEventListener("click", function() { that.sendNotification('CHANGE_POSITIONS', ... ... },
    • 1 / 1