MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. ninjabreadman
    3. Best
    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: Module Developer Challenge - I surrender!

      @Mykle1 Depending on the style/implementation you’re using, you may want to read up on Promises in JS.

      Also, see this note here about the lm-sensors package.

      Alternatively, have a look at MMM-SystemStats which uses vcgencmd on the CLI to retrieve the system temp, which would be far easier to integrate into your current module.

      posted in Development
      N
      ninjabreadman
    • RE: Calendar module won't show all events

      I’ve had the same problem since upgrading to MagicMirror 2.2.0.

      It seems that Node.js is upset that MMM-CalendarExt uses an async function at MMM-CalendarExt.js:182. From what I can tell, Node.js didn’t support async until 7.4, and I’m (apparently) running 6.12.2 (via node -v). However, until I upgraded MagicMirror this weekend, MMM-CalendarExt was working fine.

      I just edited run-start.sh:4 to the following, and just got MMM-CalendarExt working again:

      electron --js-flags="--harmony-async-await" js/electron.js $1
      

      Can someone explain why upgrading to MagicMirror 2.2.0 would’ve rolled back the Node.js support for async?

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Modules not always loading

      Hi @NathanWilcox,

      If you followed the manual install, you should see the shell script (mm.sh) when you run ls -la ~. Run pm2 list to see what processes are registered in pm2. You can then pm2 stop mm && pm2 delete mm && pm2 save, and finally rm ~/mm.sh.

      mm should then be gone for good, and only MagicMirror will remain. You can confirm what remains by running pm2 list again.

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Creating a module with existing Nodejs client?

      @Baxer An API (and client) give you a way to ask for information; it doesn’t stipulate what information to request, or how to display it. However, you could use MagicMirror-Module-Template then run npm install --save open-shl within your module folder to install open-shl.

      You would then add the code featured here to load the API and start querying data. I recommend loading the API in your node_helper.js and passing back the data to display via this.sendSocketNotification(notification, payload).

      posted in Development
      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: magic mirror as a smart clock

      @MrRodz If you install MMM-Remote-Control and correctly configure the ipWhiteList, it will install a generic receiver to receive commands to your MM via a local HTTP GET request.

      You can then use an HTTP GET request like http://192.168.178.240:8080/remote?action=SHOW&module=module_0_MMM-GoogleMapsTraffic to trigger a module/action, switch profiles, or create your own custom actions.

      I’m terms of GPIO for your doorbell, see MMM-Buttons or MMM-PIR-Sensor. It seems to me you want to receive a GPIO event, switch profiles, and start a timer to later revert your profile to the original – that’s basically MMM-PIR-Sensor (movement, turn on screen, set timer to turn off).

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: How to pass a value between functions in a Module?

      @ameenaziz I think if you change var ajaxResult; to this.ajaxResult = ""; and change all other references (from ajaxResult to this.ajaxResult), you should be able to access it from anywhere in your module, including getDom(). Just remember when getDom() is first called, this.ajaxResult may still be empty until the response is received.

      posted in Development
      N
      ninjabreadman
    • RE: Modules assistance for MM newbie! Help!

      @Fookes No problem. You need to use a program (app) to open any file. Right now, you’re using what came with your Mac (called TextEdit). But it’s much more of a note taking or word processing program than a text editor for code. It doesn’t understand code, and does things that break it. Once you’ve downloaded and installed Atom (by moving it to your ~/Applications folder on your Mac) you can run it then open the file, or right-click a file and select “Open with…” and choose Atom. Not only will it not break your code, it will colour-code (called “syntax-highlighting”) your code, show you where brackets/braces match, and can help to make your code legible (called “Beautify” in Atom).

      For adding modules, check out this walkthrough for tips: https://forum.magicmirror.builders/topic/4231/how-to-add-modules-for-absolute-beginners

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Transfer to smaller SD card

      @crowbar You can either (1) truncate your original SD partition to 8Gb, transfer or backup/restore to your new card, or (2) create an image, resize the image to 8Gb, then restore it to your new SD card. If you already have an RPi backup, suggest you do the latter method.

      As @Mykle1 notes, this is a very common issue (esp for RPi), but is complicated in that Win/Mac don’t play nice/at all with ext4 partitions. It’s not a great idea to back up the RPi while it’s running (esp to itself) – it is swapping all kinds of temp files, it has comparatively poor I/O, plus you’ll need a machine with two SD card readers or an interim storage medium like an HDD or USB stick. As he notes, a Live USB/CD is useful in this regard.

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Why are people doing this: var self = this?

      @E3V3A This seems like a pretty comprehensive primer, including the particularities of this in JavaScript.

      posted in Development
      N
      ninjabreadman
    • 1 / 1