• 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 with remote file doesnt work.

Scheduled Pinned Locked Moved Unsolved Troubleshooting
13 Posts 4 Posters 2.4k Views 3 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.
  • C Offline
    codac
    last edited by codac Oct 12, 2021, 12:34 PM Oct 12, 2021, 12:25 PM

    I would like to use an external compliments file. Therefore I use the following config:

    		{
    			module: "compliments",
    			position: "bottom_bar",
    				config: { 
        				remoteFile: "https://www.xxx.com/magicmirror/compliments_remote.json"
    				}
    		},
    

    I have checked the link, which is valid (entering in the browser displays the files content). Furthermore I have used a JSON validator in order to check if the content is json compliant. This is the content:

    {
        "anytime": ["Ich sehe viel von mir in dir",
                    "Verdammt. Du siehst gut aus!",
                    "Möge die Macht mit dir sein",
                    "Es gibt keinen Ort wie zu Hause",
                    "*Ich trug eine Wassermelone*",
                    "Dein Lächeln ist ansteckend",
                    "Du siehst heute großartig aus",
                    "Du bist ein schlauer Keks",
                    "Aufgeben ist keine Option!",
                    "Don't worry  -  be happy",
                    "Perfektion ist langweilig!",
                    "Du bist wundervoll",
                    "Ich liebe Kaktusblümchen",
                    "Smile every day",
                    "Never give up",
                    "Gib alles - nur nicht auf",
                    "Today is a good day",
                    "Wenn nicht jetzt - wann dann",
                    "You are your only limit",
                    "Dein lächeln steht dir gut",
                    "Everything is possible",
                    "Mit dir kann ich Pferde stehlen",
                    "Gegensätze ziehen sich an",
                    "Wake up and be awesome",
                    "*Mein Baby gehört zu mir*",
                    "Carpe Diem",
                    "Du bist mein Zuhause",
                    "*Bibe di babe di Buh!*",
                    "Du hast das schönste Lachen",
                    "Du bist ein großartiger Freund",
                    "Du erstrahlst den Raum",
                    "Du verdienst jetzt eine Umarmung",
                    "Du kannst stolz auf dich sein",
                    "Du bist hilfreicher als du denkst",
                    "Du bist ein großartiger Zuhörer",
                    "Ich wette du schwitzt Glitzer",
                    "Du bist wundervoll",
                    "Du bist einzigartig!",
                    "Du inspirierst"
                    ],
        "morning": ["Guten Morgen Sonnenschein!",
                    "Lass doch das Kissen im Bett",
                    "Du bist heute früh dran",
                    "Dein Haar ist mega heute!",
                    "Der fühe Vogel fängt den Wurm",
                    "Das wird ein schöner Tag!",
                    "Heute wird großartig",
                    "Carpe Diem"
                    ],
        "afternoon": ["Zeit für lecker Njam - Njam",
                    "Dieser Tag ist großartig",
                    "Beinahe Abendessenszeit!"
                    ],
        "evening": ["Zeit zu Schlemmen",
                    "Bis morgen!",
                    "Schlaf gut",
                    "Guten Appetit",
                    "Yeah, Freizeit",
                    "War das Essen gut?"
                    ],
        "snow": ["Schneeballschlacht!",
                    "Leise rieselt der Schnee",
                    "Baue einen Schneemann"
                    ],
        "day_sunny": ["Heute ist ein sonniger Tag",
                    "Sonne tanken",
                    "Time for a Dog Walk",
                    "Cora will spielen!",
                    "Die Sonne scheint heute!",
                    "Have a wonderful Day",
                    "Sunny Day Today"
                    ],
        "day_cloudy": ["Couch Time"
                    ],
        "rain": ["Ein Regenschirm wäre nützlich"
                    ],
        "night_clear": ["Die Sterne funkeln"
                    ],
        "....-01-01": ["Happy new year!"]
    }
    
    

    The remote file wont get loaded and/or displayed but instead the default and local compliments.js file shows the standard english sentences.

    Any idea on what I’m missing?

    S 1 Reply Last reply Oct 12, 2021, 12:30 PM Reply Quote 0
    • S Offline
      sdetweil @codac
      last edited by Oct 12, 2021, 12:30 PM

      @codac what is the actual content of the remote file?

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      C 1 Reply Last reply Oct 12, 2021, 12:33 PM Reply Quote 0
      • C Offline
        codac @sdetweil
        last edited by Oct 12, 2021, 12:33 PM

        @sdetweil

        {
            "anytime": ["Ich sehe viel von mir in dir",
                        "Verdammt. Du siehst gut aus!",
                        "Möge die Macht mit dir sein",
                        "Es gibt keinen Ort wie zu Hause",
                        "*Ich trug eine Wassermelone*",
                        "Dein Lächeln ist ansteckend",
                        "Du siehst heute großartig aus",
                        "Du bist ein schlauer Keks",
                        "Aufgeben ist keine Option!",
                        "Don't worry  -  be happy",
                        "Perfektion ist langweilig!",
                        "Du bist wundervoll",
                        "Ich liebe Kaktusblümchen",
                        "Smile every day",
                        "Never give up",
                        "Gib alles - nur nicht auf",
                        "Today is a good day",
                        "Wenn nicht jetzt - wann dann",
                        "You are your only limit",
                        "Dein lächeln steht dir gut",
                        "Everything is possible",
                        "Mit dir kann ich Pferde stehlen",
                        "Gegensätze ziehen sich an",
                        "Wake up and be awesome",
                        "*Mein Baby gehört zu mir*",
                        "Carpe Diem",
                        "Du bist mein Zuhause",
                        "*Bibe di babe di Buh!*",
                        "Du hast das schönste Lachen",
                        "Du bist ein großartiger Freund",
                        "Du erstrahlst den Raum",
                        "Du verdienst jetzt eine Umarmung",
                        "Du kannst stolz auf dich sein",
                        "Du bist hilfreicher als du denkst",
                        "Du bist ein großartiger Zuhörer",
                        "Ich wette du schwitzt Glitzer",
                        "Du bist wundervoll",
                        "Du bist einzigartig!",
                        "Du inspirierst"
                        ],
            "morning": ["Guten Morgen Sonnenschein!",
                        "Lass doch das Kissen im Bett",
                        "Du bist heute früh dran",
                        "Dein Haar ist mega heute!",
                        "Der fühe Vogel fängt den Wurm",
                        "Das wird ein schöner Tag!",
                        "Heute wird großartig",
                        "Carpe Diem"
                        ],
            "afternoon": ["Zeit für lecker Njam - Njam",
                        "Dieser Tag ist großartig",
                        "Beinahe Abendessenszeit!"
                        ],
            "evening": ["Zeit zu Schlemmen",
                        "Bis morgen!",
                        "Schlaf gut",
                        "Guten Appetit",
                        "Yeah, Freizeit",
                        "War das Essen gut?"
                        ],
            "snow": ["Schneeballschlacht!",
                        "Leise rieselt der Schnee",
                        "Baue einen Schneemann"
                        ],
            "day_sunny": ["Heute ist ein sonniger Tag",
                        "Sonne tanken",
                        "Time for a Dog Walk",
                        "Cora will spielen!",
                        "Die Sonne scheint heute!",
                        "Have a wonderful Day",
                        "Sunny Day Today"
                        ],
            "day_cloudy": ["Couch Time"
                        ],
            "rain": ["Ein Regenschirm wäre nützlich"
                        ],
            "night_clear": ["Die Sterne funkeln"
                        ],
            "....-01-01": ["Happy new year!"]
        }
        
        S 1 Reply Last reply Oct 12, 2021, 12:52 PM Reply Quote 0
        • S Offline
          sdetweil @codac
          last edited by Oct 12, 2021, 12:52 PM

          @codac ok, the original post had the module source

          anyhow

          open the developers window on mm

          ctrl-shift-i

          select the tab labeled ‘console’ and add a unique part of the module name to the filter field

          compl

          for example

          see if there are any errors…

          if the module is able to get and parse the contents, it changes the defaults to the remote content

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • C Offline
            codac
            last edited by Oct 12, 2021, 1:16 PM

            @sdetweil yes indeed there is:
            Reason: CORS header ‘Access-Control-Allow-Origin’ missing

            S M ? 4 Replies Last reply Oct 12, 2021, 1:21 PM Reply Quote 0
            • S Offline
              sdetweil @codac
              last edited by Oct 12, 2021, 1:21 PM

              @codac what is the address: in the mm config

              if “localhost” try “0.0.0.0”

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              C 1 Reply Last reply Oct 12, 2021, 1:31 PM Reply Quote 0
              • C Offline
                codac @sdetweil
                last edited by Oct 12, 2021, 1:31 PM

                @sdetweil I’m using clientonly so on the client itself, the config wont have any affect, right? Furthermore on the server side there already is set 0.0.0.0

                S 1 Reply Last reply Oct 12, 2021, 1:36 PM Reply Quote 0
                • S Offline
                  sdetweil @codac
                  last edited by Oct 12, 2021, 1:36 PM

                  @codac fun… yeh, client only , what are u using for the client? MM clientonly or chrome?

                  if the former, I would try the latter

                  this is what I use to start the chrome browser over server where electron doesn’t exist

                  chromium  -noerrdialogs -kiosk -start_maximized  --disable-infobars --app=http://$server:$port  --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null
                  

                  do

                  server=    mm server
                  port=        mm server port
                  

                  then the command above in a terminal window to test

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    MMRIZE @codac
                    last edited by Oct 12, 2021, 1:47 PM

                    @codac
                    Modern browser doesn’t allow cross-originated contents(code, data whatever) by default for security reason. I think there might be an option to turn it off(in browser or electron) I’m in out of my pc, so can’t test it by myself, but definitely exist, I know.

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      MMRIZE @codac
                      last edited by Oct 12, 2021, 1:53 PM

                      @codac
                      In chrome/chromium, it might be --disable-web-security flag on execution.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        1/13
                        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