• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Compliments.json absolute or relative and proper path

Scheduled Pinned Locked Moved Solved Troubleshooting
6 Posts 3 Posters 815 Views 4 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.
  • K Offline
    kayakbabe
    last edited by Apr 28, 2022, 5:56 AM

    I’ve read the other posts, not sure I found all of them, and I"m still having a little problem. I can’t seem to get the right path to my compliments.json file. I have to admit I’m a bit rusty on my linux and doing things with the command path.

    I notice the magic mirror config.js has base path is “/”
    I’m going to assume that is the magic mirror directory itself and all things are supposed to run relative to that.

    here is my issue:
    I have the compliments.json located in the mirror’s config folder (I figured that would be the safest place to put it so it won’t get overwritten if I update anything. )
    so in the config.js in the modules section for compliments I tried
    remoteFile: ‘/mounts/config/compliments.json’
    remoteFile: ‘/config/compliments.json’
    remoteFile: ‘compliments.json’
    remoteFile: ‘/home/pi/magicmirror/mounts/config/compliments.json’

    none of those paths worked…
    so please help me out. I’m guessing I need a relative path instead of absolute, or I’m adding or not adding a slash or something.

    (I’m not breaking the module, so I think I"m just not getting to my compliments.json at all and the compliments module is just defaulting)

    K K 2 Replies Last reply Apr 28, 2022, 8:24 AM Reply Quote 0
    • K Offline
      kayakbabe @kayakbabe
      last edited by Apr 28, 2022, 8:24 AM

      @kayakbabe Well, I haven’t played with Docker ever. I also used the #MagicMirrorOS install method because it sounded super fast and easy. That said, I discovered some things about Docker. .And in the process discovered that the compliments.json I created was being erased/deleted/disappeared every time I stopped and started the raspberry pi.

      For those who don’t know anything about docker… it’s kind of like a software publishing system where make sure your production server always has the files it is supposed to have and you can throw copies of that production server out super quick. This is a super lame description… but it was the reason I couldn’t solve my path issue. Because the “copy” of MagicMirror didn’t have a compliments.json in any of the folders that I tried to put it, that compliments.json was being removed every time I started up magic mirror from that Docker instance.

      So in short I redid my sd card with a manual install and didn’t use any of the alternative methods (no docker image).

      I also am able to set my compliments remote file to
      remoteFile: “…/…/…/config/compliments.json”
      and it works great.

      and I can now put it anywhere I want on the pi so long as the relative paths are correct. I can keep it from being replaced if I want to update the modules.

      1 Reply Last reply Reply Quote 0
      • A Offline
        Assassins
        last edited by Apr 28, 2022, 4:08 PM

        You can look here

        1 Reply Last reply Reply Quote 0
        • K Online
          karsten13 @kayakbabe
          last edited by Apr 28, 2022, 8:50 PM

          @kayakbabe

          it is a good idea to put the compliments.json beside the config.js.

          In the config.js you have to use

          remoteFile: "../../../config/compliments.json"`
          
          K 1 Reply Last reply May 7, 2022, 2:31 AM Reply Quote 1
          • K Offline
            kayakbabe @karsten13
            last edited by May 7, 2022, 2:31 AM

            @karsten13 that is exactly what I did. I like having it outside the config.js so the config.js doesn’t grow to be a huge file. And so if I mess up when I add to the compliments.json, I won’t break the entire mirror.

            I’m adding a whole lot of birthdays and lots of family specific dates. I like having the remoteFile setting so I can keep this data out of config.js.

            A 1 Reply Last reply May 7, 2022, 5:51 AM Reply Quote 1
            • A Offline
              Assassins @kayakbabe
              last edited by Assassins May 7, 2022, 5:51 AM May 7, 2022, 5:51 AM

              @kayakbabe you Can put you file in to default/compliments
              And insert this to config.js

              {
              module: ‘compliments’,
              position: ‘bottom_bar’,
              config: {
              remoteFile: ‘youfiles.compliments.json’
              }
              },

              1 Reply Last reply Reply Quote 1
              • 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