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: Positions of modules

      @jakuk Start at this post. The CSS will change the style of each module (size, font, etc) but to have them appear in the appropriate regions, it’s best to use your module configurations in config.js.

      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Quick Question regarding Magic Mirror cache

      @chef The POST request isn’t sending it an image, it’s sending the URL to the image (e.g. http://192.168.2.18:9920/security/values/2). The problem is, it already has a cached copy of that image. I suggest you append a timestamp to trick electron into re-fetching the same image/resource.

      You want to pass it a URL-encoded value, so use %3F as ? and just append your timestamp, like so:

      http://192.168.2.48:8080/api/v1/modules/alert/show_ALERT?timer=10500&imageUrl=http://192.168.2.18:9920/security/values/2%3F
      {INSERT TIMESTAMP HERE}&imageHeight=220px
      
      posted in General Discussion
      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: Messed up CSS between Portrait and Landscape monitors

      @Damian Use the built-in DOM inspector to see what styles are currently applied. Right-click on the compliments module and select “Inspect”.

      Worst case, using !important should work:

      .module.compliments {
      font-size: 73% !important;
      }
      
      posted in Troubleshooting
      N
      ninjabreadman
    • RE: GIF update from URL with MMM-EyeCandy

      @Mykle1 Yep, just needs to be a ? before the first parameter. Anything after gets appended with an &, e.g. https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=1521767776&otherseed=4846528&page=2.

      Making your code the following:

      ... // img creation, etc
      var getTimeStamp = new Date().getTime();
      img.src = "https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=" + getTimeStamp;
      pic.appendChild(img);
      wrapper.appendChild(pic);
      
      posted in Troubleshooting
      N
      ninjabreadman
    • RE: Magic mirror serving multiple clients

      @zack949 Not of which I’m aware. Most dev effort is spent on the display/features end. It would also have to track the config options for dozens of regularly changing modules, which presents its own challenges.

      I recommend using a syntax-highlighting code editor, like (the free) Atom. It will help with closing brackets/braces, and using the proper quotes. You can also run “Atom Beautify” in “Packages” regularly to keep formatting for legibility.

      posted in General Discussion
      N
      ninjabreadman
    • RE: Module Developer Challenge - I surrender!

      @Mykle1 It doesn’t seem that pc-stats has all the info you require. You might consider switching to the systeminformation package.

      You can then use si.cpu() for your CPU stats and si.cpuTemperature() to retrieve an object that (if I read the docs right) looks like { main: 0, max: 0, cores: [0, 0] } with your core temps. You can then combine the two responses (or you may be able to have it return all within one request) and return those in a single sendNotification() call.

      posted in Development
      N
      ninjabreadman
    • RE: MMM-ImagesPhotos - Show images from a directory

      @twosquirrels So, I suspect (but cannot be certain) that this is your problem. I’ve not found great browser support for EXIF image rotation. There are a variety of command line approaches available, and even some GUI apps.

      posted in Utilities
      N
      ninjabreadman
    • RE: MMM-CalendarExt

      @abetterway I think you mean switch the origin branch of the MMM-CalendarExt repository to forRPI1.

      In this case, use git checkout forRPI1 within the ~/MagicMirror/modules/MMM-CalendarExt directory.

      posted in Productivity
      N
      ninjabreadman
    • RE: Really confused

      @Duke86 Hi Duke, start with cd MagicMirror/ … you’re probably trying to start MM out of the wrong folder.

      posted in Troubleshooting
      N
      ninjabreadman
    • 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