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

    Posts

    Recent Best Controversial
    • RE: MMM-Loxone

      @bobbythemoh Can you please post your pm2 log. You can optain it by executing pm2 log MagicMirror if you are using pm2.

      I just detected some unhandled rejections which may cause the black screen.

      posted in Utilities
      idoodlerI
      idoodler
    • RE: Modules again.....

      @sdetweil Actualy JSON requires quotation of the key and of the value (if the value is a string)

      Example of a JSON file:

      {
          "string": "This is a string",
          "bool": true,
          "int", 1,
          "float": 3.14,
          "arrayOfStrings": [
              "string1",
              "string2"
          ],
          "arrayOfInts": [
              1,
              2
          ]
      }
      

      The same can be used in a Javascript file, but as an object. You can also throw away the quotation of the keys.

      posted in Development
      idoodlerI
      idoodler
    • RE: programming model

      @sdetweil I don’t think that. The helper is running on your Raspberry Pi, the module is running in every browser instance you open.

      You need to coordinate your “show image event” from the helper and send out a notification to the module what image to show.

      The ViewManagement must be in the module, the image downloading, handling must be in the helper.

      Note: You only have one helper, but you can have multiple modules!

      posted in Development
      idoodlerI
      idoodler
    • RE: what can i do in a module, porting from another mirror project

      @sdetweil A MagicMirror Module has two parts, the node_helper.js and any other required node.js modulewhich runs on your Raspberry Pi, the other part is just plain Javascript like in any Website running on the Browser (Electron in the default case).

      There are many node.js websocket server modules: https://www.npmjs.com/search?q=Websocket

      Your node_helper.js is running the Websocket server and your other part is running a Websocket client. Follow this tutorial for the Websocket Client

      The communication won’t be encrypted in any way, so don’t pass importand information over the Websocket!

      posted in Development
      idoodlerI
      idoodler
    • RE: programming model

      @sdetweil I solved this problem by using this.sendSocketNotification This allows me to communicate with the modules interface.

      posted in Development
      idoodlerI
      idoodler
    • RE: programming model

      @sdetweil Wait, I think I misunderstoodyour question.

      Do you want to have a class variable just in your node_helper.js, or do you want to share a variable between node_helper.js and your MMM-ModuleName.js file?

      posted in Development
      idoodlerI
      idoodler
    • RE: programming model

      @sdetweil Thats simply how to define a variable inside an object in node.js :grinning_face_with_smiling_eyes:

      posted in Development
      idoodlerI
      idoodler
    • RE: Modules again.....

      @brenj You definitely need some JSLint: https://www.jslint.com/

      :winking_face:

      posted in Development
      idoodlerI
      idoodler
    • RE: programming model

      @sdetweil If you want class variables you can do the following:

      module.exports = NodeHelper.create({
      
          variable1: true,          // This is one way
      
          start: function() {
              this.variable2 = true // This is another way
      
             // Both variables can be accessed via this.VARIABLE_NAME
          }
       });
      
      posted in Development
      idoodlerI
      idoodler
    • RE: what can i do in a module, porting from another mirror project

      @sdetweil You can establish a custom Websocket connection between your node_helper.js, which is node.js and your other JS code which runs in a browser.

      posted in Development
      idoodlerI
      idoodler
    • 1
    • 2
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 17 / 20