MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Loading parts of config from external json file

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    6 Posts 2 Posters 705 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      melonlord
      last edited by

      Hello,

      I’m planning on making a smart mirror and making an external app to control my mirror as a hobby project and I want to edit parts of the config using it. So I started experimenting with loading from an external json file and saw that I could load port for the application just fine from the json.

      I then tried to load the feeds for the newsfeed module from the json and the application starts but just shows a black screen. No errors in the console, config:check passes, I even console.logged the config and it was in the correct format.

      Does anyone have any experience with loading config from external file or does anyone know what could cause the black screen?

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @melonlord
        last edited by

        @melonlord u can’t load from external file.

        it loads in browser, which doesn’t allow file I/o

        u might want to looks at my MMM-Config app

        which presents a form to manage config from any web browser phone, tablet , laptop or desktop

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          melonlord @sdetweil
          last edited by

          @sdetweil shame about that.

          While what you have is nice, it’s not exactly what I’m looking for. I guess I’ll have to look into some other smart mirror platforms.

          Thanks

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @melonlord
            last edited by

            @melonlord about the only thing that would work is to create another file with your ‘includes’
            and preprocess it to generate the config.js
            add another step to the mm.sh before npm start

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            M 1 Reply Last reply Reply Quote 0
            • M Offline
              melonlord @sdetweil
              last edited by

              @sdetweil the preprocessor idea is actually pretty good!

              From initial testing it seems to work! There is still hope :D

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @melonlord
                last edited by

                @melonlord u could also fix the package.json start command to run a script, or chain the command, so that not starting with mm.sh would still work. move the preprocess step out of mm.sh

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy