A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • [Solved] Socket notification not working

    7
    0 Votes
    7 Posts
    3k Views
    W

    @j.e.f.f I tried npm start dev but I don’t got the output from console.log() in helloworld.js

  • Persistent data

    3
    0 Votes
    3 Posts
    1k Views
    K

    @j.e.f.f said in Persistent data:

    I’m assuming you’re building a custom module where this isn’t practical

    Yeah my module gets OAuth data back which needs to be stored if the user doesn’t want to authenticate the mirror everytime it restarts/crashes. So I hoped there was some kind of datastorage build in for small stuff. I will try it with a .json file

  • How to clear cache?

    2
    0 Votes
    2 Posts
    2k Views
    ?

    Nevermind.
    Electron seems to be able to control its cache automatically.

  • Dynamically Moving Modules

    Moved
    7
    0 Votes
    7 Posts
    3k Views
    S

    This version of MMM-Carousel will allow you to set different locations for a module for different slides:

    [card:shbatm/MMM-Carousel]

    See the very bottom of the README for more information

    If you’re interested in incorporating this into your own module, the relevant parts of the code are here and here

  • JSON-RPC need help

    3
    0 Votes
    3 Posts
    2k Views
    T

    Thanks. But i have an other problem.
    The JSON request works per curl on console, but in js : "net::ERR_EMPTY_RESPONSE "

    Curl : curl -i -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"id\": \"0\", \"method\": \"GetValue\", \"params\": [18697]}" http://xxx.xxx.x.xx:3777/api/

    but in the MM-JS-Script don´t work. Looks like the json parameter don´t work.

  • Custom module bases helloworld

    2
    0 Votes
    2 Posts
    1k Views
    strawberry 3.141S

    @roma-cezar you need to put your code into a node_helper as it is based on node dependencies. Then you can communicate via sockets between the helper and the module. you can have a look in other modules which have a node_helper file how the communication works. also you can have a look in the developer guide here https://github.com/MichMich/MagicMirror/blob/master/modules/README.md

  • Can't load script correctly

    4
    0 Votes
    4 Posts
    3k Views
    N

    You can get leaflet to work in magic mirror quite easily. When you are creating your getDom function take the example from the tutorial as follows:

    var mymap = L.map('mapid').setView([51.505, -0.09], 13); L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', { attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>', maxZoom: 18, id: 'mapbox.streets', accessToken: Your Access token }).addTo(this.mymap);

    You will also need specify the size of the of the map window in your css file

    .Your_Module_Name #mapid { height: 500px; width: 500px; }

    There is a bit of a bug with some of the map not loading, this can be fixed by listening for the DOM_OBJECTS_CREATED notification like so:

    notificationReceived: function (notification, payload, sender) { if (notification === "DOM_OBJECTS_CREATED") { this.mymap.invalidateSize(); } },

    This forces a redraw of the map.

  • Input...What do you think?

    54
    3 Votes
    54 Posts
    29k Views
    cowboysdudeC

    @strawberry-3.141 said in Input...What do you think?:

    config.timeFormat

    Thank you for that!!! One config option gone :) There now the time function is all automatic :) ALL controlled by the users input here:

    language: 'en', timeFormat: 12,

    Ok I’ve had my tea and toast so I must head out the door for the day :)

  • Fun plugins ...

    6
    0 Votes
    6 Posts
    3k Views
    ?

    Add some beard or mustache on face of visitor who see the mirror for fun.

  • Send Notification from one module to another module

    6
    0 Votes
    6 Posts
    5k Views
    SvenSommerS

    It seemed the sender is now a object not only a string with several properties. Therefore this code snippet has changed a little by sender to sender.name:

    notificationReceived: function(notification, payload, sender){ if(notification === "NEW_STUFF" && sender.name === "modula"){ //handle the payload: {foo: "bar"} } }
  • Where to begin for module making?

    5
    0 Votes
    5 Posts
    2k Views
    T

    Excellent. Thank you SvenSommer. I will definitely use that to help.

    I love your build. Very stunning!

  • Module and atom noob needs help

    3
    0 Votes
    3 Posts
    2k Views
    J

    @dekthaigrean For testing, I’ve installed MagicMirror on my macbook. I start it manually from the terminal with npm start, and monitor the server-side output from there. You can monitor the browser-side output in the developer console of Electron. Hover your mouse near the top of the screen, and you’ll be able to release Electron from full-screen mode, then enable dev tools from the menu under View -> Toggle Developer Tools. (pro tip: you can also open Chrome and point it to http://localhost:8080 if you want to take advantage of any other Chrome plugins for debug purposes).

    I use a lot of console.log calls to output various information (variable values, output from API requests, etc) while I write my modules. The node_helper.js file (if you choose to use one) runs server side, and any code changes you make require a restart of MM. Any console.log out from node_helper.js will show up in the terminal window. The main js file (e.g.: MMM-YourModule.js) runs in the browser and any console.log output from the main js file will be in Electron’s dev tool console tab. A browser refresh is all you need to reflect code changes in the that file.

    Once I’ve got my module in a stable state, I copy it to my Raspberry Pi and let it run several days on my mirror to see if there are any problems with normal usage. On the mirror, however it’s harder to monitor browser-side console.log output, especially if you run your Pi without a keyboard and mouse connected. So it’s advantageous to do all your heavy lifting in the node_helper.js file so that any errors will be output to MM’s log files. If you’re using pm2 to run MagicMirror, you can see this log with pm2 logs mm (Assuming the name you gave to the Magic Mirror process was “mm”).

    Your choice of text editor is fine, but it’s just a text editor, and it’s not going to have any knowledge over the rest of the Magic Mirror’s framework. If you like Atom, but want to try something else, you may also like Sublime Text. I’m not sure if Atom does this, but Sublime has a nice feature that divides the screen into multiple panels so you can have several files open side by side. I find this especially helpful when I’m writing my CSS. I’ll have the CSS on one side, and the main js file on the other. Easy to keep track of class names when I write the rules.

  • Bing-Traffic

    4
    0 Votes
    4 Posts
    2k Views
    O

    after that, put the HTML file in the MMM-iFrameReload directory…

    you generate the HTML file from this site
    https://developers.google.com/maps/documentation/javascript/examples/layer-traffic

  • Can I use Chrome for Magicmirror?

    4
    0 Votes
    4 Posts
    2k Views
    ?

    @strawberry-3.141 Thank you very much.

  • This topic is deleted!

    1
    0 Votes
    1 Posts
    21 Views
  • So then, what languages to learn?

    Moved
    6
    0 Votes
    6 Posts
    5k Views
    M

    From my attempts at learning, I think JavaScript and Node.JS are different. Even though node is created with JS it would be worthwhile learning Node.js to get an understanding of how it all runs.

  • Small tips for developemnt on OSX

    1
    1 Votes
    1 Posts
    1k Views
    ?

    I’m not a developer. Once(past 10 yrs) I was, but no more now.
    So these small tips might be not the best. And even many people might already know…
    However I want to share with you.

    These tips are working on OSX.(Your mac should be in the same network with RPi) But I think these are possible in Windows also.

    VNC : You don’t need any additional Monitor for development or configuring RPi(raspbian Jessie or Jessie lite)
    If your raspbian has VNC Server (like X11VNC Server), You can see your raspi screen with your Safrari browser on your mac. Just open your safari and navigate to vnc://your-rpi-ip (eg. vnc://192.168.178.100). It works perfectly. No additional vnc viewer is needed.
    If you want to use Chrome, you can use this plugin.

    Sharing file system.
    If you installed Netatalk in your RPi, you can see your RPI files in your OSX Finder. You don’t need any FTP.

    VNC setup and sharing file system instructions are here.

    Remote text editor instead nano
    I always don’t like all the text-editors on the shell, VI, emacs, nano… :P
    I recommend Atom.io for developing. Textmate and SublimeText are also good. If you use one of these, you can open the file from Shell to your OSX GUI-editor.
    for Atom
    for Textmate
    for SublimeText 3
    (Technically, all these 3 use the same program - rmate)
  • Google Assistant Demo and Idea.

    9
    2 Votes
    9 Posts
    5k Views
    Mykle1M

    @cowboysdude said in Google Assistant Demo and Idea.:

    EVERY American has a bad accent… do your worst LOL

    Uhh, I’m from New Yawk Siddy. I aint got no ackcent.

    Fuhgeddaboudit!

  • New to Modules, Need help

    Solved
    9
    0 Votes
    9 Posts
    4k Views
    Mykle1M

    @cowboysdude said in New to Modules, Need help:

    LOTS OF MADNESS LOL

    And your fair share of genius! (Guru)

  • Youtube Embed API

    4
    0 Votes
    4 Posts
    3k Views
    A

    @Stubbsy1994 The link you provided describes how to embed youtube API into HTML sites using iframe-Tags in two ways. It seems, the module shown in the thread above uses the first method (iframe with source http:// www.youtube. com/embed/VIDEO_ID?parameters). I guess, the pure JS method ultimatively also uses an iframe since its called IFrame Player API.

    As far as I can see, both have equal functionality. It’s not really documented, but it seems like you can call all the functions for the player-object listed here in the direct iframe approach (first method), too. See parameter enablejsapi=1. For example pause or seek-to (not verified for all functions!):

    $('#video1')[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); $('#video1')[0].contentWindow.postMessage('{"event":"command","func":"seekTo","args":[20, true]}', '*');

    Compare sendCommand function in youtube.js of the module described in the thread above.

    So even though the module may not satisfy all your needs by now, maybe you can take it as a starting point to develop your own solution?!