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.

    8kb "compliments module" works. 204kb "compliments module" fails to display. how to fix?

    Scheduled Pinned Locked Moved Solved Troubleshooting
    7 Posts 3 Posters 2.0k 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.
    • S Offline
      Steed
      last edited by Steed

      @lavolp3

      i have been trying my best but i cant seem to link the file.
      heres what i got.
      compliments.js >
      odule.register(“compliments”, {

      // Module config defaults.
      defaults: {
      	compliments: {
      		anytime: [
      			"Don't forget to laugh often, and smile always!"
      		],
      		morning: [
      			"Good morning!",
      			"Enjoy your day!",
      			"Rise and shine, the early bird gets the worm!",
      			"You are loved!",
      			"Each and every day brings it's own blessings!"
      		],
      		afternoon: [
      			"All work and no play? Must be the middle of the day!",
      			"Live, Laugh, Love!",
      			"Mirror, Mirror on the wall...",
      			"Looking good today!"
      		],
      		evening: [
      			"Another day is coming to a close!",
      			"Dinner time!",
      			"Bed time is the best time of the day!"
      		]
      	},
      	updateInterval: 30000,
      	remoteFile: "~/home/pi/MagicMirror/modules/default/compliments/remote_compliments.json",
      	fadeSpeed: 4000,
      	morningStartTime: 3,
      	morningEndTime: 12,
      	afternoonStartTime: 12,
      	afternoonEndTime: 17
      },
      

      ‘’‘’‘’
      the program is just ignoring the .json file and doing the regular compliments.
      i have the book broken into 4 sections anytime morning afternnon and evening.

      when i delete the default compliments up there ^^^^ it says undefined. even without comments in the compliments.js the remote_compliments still isnt being called.

      i spend a lot of time putting 1590 lines of a book into quotations and stuff so i dont want to give up.

      bheplerB lavolp3L 2 Replies Last reply Reply Quote 0
      • bheplerB Offline
        bhepler Module Developer @Steed
        last edited by bhepler

        @steed - You should not be modifying the compliments.js file. Any compliments you wish to insert into the module should be specified in the config.js file. In your case, you want to modify the config.js file to point to your large compliments JSON file.

        Roughly:

        {
        	module: "compliments",
        	position: "lower_third",	
        	config: {
        		remoteFile:'/home/pi/bookCompliments.json'
        	}
        }
        
        1 Reply Last reply Reply Quote 2
        • lavolp3L Offline
          lavolp3 Module Developer @Steed
          last edited by

          @steed Although I think your way should have worked out if not for a small error (below), @bhepler 's advice is much better, because otherwise you will have a problem as soon as you want to update the mirror software.
          The module’s own .js files themselves are part of the git workflow, if you change them locally and are not common to using git, you’ll be in a fine mess later on and will not know what to do.
          Therefore, it’s ideal to use the config.js or custom.css for changes because they will be ignored by the git workflow.

          However in your approach you have only one small mistake

          	remoteFile: "~/home/pi/MagicMirror/modules/default/compliments/remote_compliments.json",
          
          

          should read

          	remoteFile: "/home/pi/MagicMirror/modules/default/compliments/remote_compliments.json",
          
          

          The “~” leads to your home/pi directory therefore it was redundant and the system was looking for /home/pi/home/pi/…

          OR just use this

          	remoteFile: "remote_compliments.json",
          
          

          How to troubleshoot modules
          MMM-soccer v2, MMM-AVStock

          S 1 Reply Last reply Reply Quote 1
          • S Offline
            Steed @lavolp3
            last edited by

            @lavolp3 thanks! got it working

            1 Reply Last reply Reply Quote 0
            • bheplerB Offline
              bhepler Module Developer
              last edited by

              Glad to hear it!

              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