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.

    MMM-GoogleDriveSlideShow

    Scheduled Pinned Locked Moved Entertainment
    37 Posts 10 Posters 17.0k Views 11 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.
    • J Offline
      Jupter1
      last edited by

      Hi,
      first of all, I really like the ideaof the module. But I am currently stuck at creating the authentification with google and then the token. In step 7 of your readme, I have no “other” option to choose, so I chose “web application”. But in step 9 (using VNC to access the magic mirror), the authentification fails.

      Do you have any idea what is my mistake?

      1 Reply Last reply Reply Quote 0
      • C Offline
        clegallic
        last edited by

        Hi Jupter,

        I don’t think you made a mistake, and that the “type” choice at step 7 has any importance.

        Can you check that your credentials.json file looks like that ?

        {"installed":{"client_id":"[something].apps.googleusercontent.com","project_id":"[something]","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"[something]","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}
        

        Can you send me the detail of the error while trying to authenticate at step 10 ?

        Regards,

        Charles

        A 1 Reply Last reply Reply Quote 0
        • J Offline
          Jupter1
          last edited by

          Hi,
          thank you for the overall looking of the JSON string. I checked it, it was not in this format. So I chose “Desktop” and now I got a credentials.json file that looks like your example. Then I tried again with a fresh module install from github. It still did not work.

          Here is the debug-log, that I get from npm. I hope you can help me with that.

          0 info it worked if it ends with ok
          1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'token:generate' ]
          2 info using npm@3.10.10
          3 info using node@v6.14.2
          4 verbose run-script [ 'pretoken:generate', 'token:generate', 'posttoken:generate' ]
          5 info lifecycle mmm-googledriveslideshow@0.0.1~pretoken:generate: mmm-googledriveslideshow@0.0.1
          6 silly lifecycle mmm-googledriveslideshow@0.0.1~pretoken:generate: no script for pretoken:generate, continuing
          7 info lifecycle mmm-googledriveslideshow@0.0.1~token:generate: mmm-googledriveslideshow@0.0.1
          8 verbose lifecycle mmm-googledriveslideshow@0.0.1~token:generate: unsafe-perm in lifecycle true
          9 verbose lifecycle mmm-googledriveslideshow@0.0.1~token:generate: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/pi/MagicMirror/modules/MMM-GoogleDriveSlideShow/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
          10 verbose lifecycle mmm-googledriveslideshow@0.0.1~token:generate: CWD: /home/pi/MagicMirror/modules/MMM-GoogleDriveSlideShow
          11 silly lifecycle mmm-googledriveslideshow@0.0.1~token:generate: Args: [ '-c', 'node generate-auth-token.js' ]
          12 silly lifecycle mmm-googledriveslideshow@0.0.1~token:generate: Returned: code: 1  signal: null
          13 info lifecycle mmm-googledriveslideshow@0.0.1~token:generate: Failed to exec token:generate script
          14 verbose stack Error: mmm-googledriveslideshow@0.0.1 token:generate: `node generate-auth-token.js`
          14 verbose stack Exit status 1
          14 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
          14 verbose stack     at emitTwo (events.js:106:13)
          14 verbose stack     at EventEmitter.emit (events.js:191:7)
          14 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
          14 verbose stack     at emitTwo (events.js:106:13)
          14 verbose stack     at ChildProcess.emit (events.js:191:7)
          14 verbose stack     at maybeClose (internal/child_process.js:920:16)
          14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
          15 verbose pkgid mmm-googledriveslideshow@0.0.1
          16 verbose cwd /home/pi/MagicMirror/modules/MMM-GoogleDriveSlideShow
          17 error Linux 4.19.66-v7+
          18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "token:generate"
          19 error node v6.14.2
          20 error npm  v3.10.10
          21 error code ELIFECYCLE
          22 error mmm-googledriveslideshow@0.0.1 token:generate: `node generate-auth-token.js`
          22 error Exit status 1
          23 error Failed at the mmm-googledriveslideshow@0.0.1 token:generate script 'node generate-auth-token.js'.
          23 error Make sure you have the latest version of node.js and npm installed.
          23 error If you do, this is most likely a problem with the mmm-googledriveslideshow package,
          23 error not with npm itself.
          23 error Tell the author that this fails on your system:
          23 error     node generate-auth-token.js
          23 error You can get information on how to open an issue for this project with:
          23 error     npm bugs mmm-googledriveslideshow
          23 error Or if that isn't available, you can get their info via:
          23 error     npm owner ls mmm-googledriveslideshow
          23 error There is likely additional logging output above.
          24 verbose exit [ 1, true ]
          
          
          1 Reply Last reply Reply Quote 0
          • C Offline
            clegallic
            last edited by

            Hi,

            I can’t see any clue in your logs that can explain the issue.
            My Node version is slightly more recent than yours (v10.17.0 when yours is v6.14.2), it may be a reason.

            Can you try to run the npm run token:generatecommand through SSH ?
            Do you have the same error ?

            Regards,

            Charles

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              Jupter1 @clegallic
              last edited by

              @clegallic
              Thank you for your support. I will try to update node and see if that fixes the problem and/or if running it via ssh changes anything when I am home again next week.

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jupter1
                last edited by

                @clegallic
                So I have tried to update node (v12.x) and voilà, now it works like a charm! Thank you for your support and this awsome module!

                1 Reply Last reply Reply Quote 0
                • C Offline
                  clegallic
                  last edited by

                  I’m glad to hear that your problem is now resolved. Have fun with the module.

                  Regards,

                  Charles

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    chen31
                    last edited by

                    Hello,
                    First of all thank you, great module.
                    I have a question regard the picture size, there is a way to automatic resize the picture to the max WxH that I config in the module setup?

                    S 1 Reply Last reply Reply Quote 0
                    • S Do not disturb
                      sdetweil @chen31
                      last edited by

                      @chen31 does the module readme give u any info on re/sizing image display?

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      C 1 Reply Last reply Reply Quote 0
                      • C Offline
                        chen31 @sdetweil
                        last edited by

                        @sdetweil
                        No.
                        I have been over this a few times, except the max W and H, nothing.

                        The max W/H cut the photo in my case.

                        C 1 Reply Last reply Reply Quote 0
                        • E Offline
                          emrah_asl
                          last edited by

                          Hi, after deleted my photo from google drive , it still show even I change

                          refreshDriveDelayInSeconds: 5000,
                          refreshSlideShowIntervalInSeconds: 15,

                          How can I clear cache ? any idea

                          thank you for your helping.

                          1 Reply Last reply Reply Quote 0
                          • E Offline
                            emrah_asl
                            last edited by

                            I changed code like below to fix my problem @sdetweil in node_helper.js

                            getPhotos: async function() {
                            
                            		// Check if need reload
                            		
                            		// Get cache if not already loaded and cache file exists (after a restart for example)
                            		if(!this.cache.created && this.cacheFileExists()){
                            
                            			let needReload = !this.cache || (new Date().getTime() - this.cache.created) / 1000 > this.config.refreshDriveDelayInSeconds;
                            
                            			// (re)create the cache if missing or expired
                            			if(needReload){
                            				this.log("No cache file, or expired, (re)creating it...");
                            				await this.createCache();
                            				this.cache.photos = await this.cache.photos.filter(photo=> !this.alreadySentPhotoIds.includes(photo.id));
                            			} else
                            
                            			this.log("No memory cache, loading it from disk");
                            			await this.loadCache();
                            
                            		} else this.createCache();
                            
                            		return this.cache.photos;
                            	}
                            
                            S 1 Reply Last reply Reply Quote 0
                            • S Do not disturb
                              sdetweil @emrah_asl
                              last edited by

                              @emrah_asl you should submit that back to the author

                              github fork the repo (top right button)
                              download the fork
                              change the forked code,
                              git add/git commit/ git push
                              then github create pull request to author

                              then U have your saved copy on fork, and have contributed to improved module

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              E 1 Reply Last reply Reply Quote 0
                              • E Offline
                                emrah_asl @sdetweil
                                last edited by

                                @sdetweil Sure. I will this tomorrow, I’m just testing the changes.

                                this time, client always sending request to google drive.

                                I am not sure that my tricks are correct way.

                                C 1 Reply Last reply Reply Quote 0
                                • C Offline
                                  clegallic @chen31
                                  last edited by

                                  Hi @chen31

                                  The module is designed to adapt the display size of the image based on your maxWidth and maxHeight configuration (see there)

                                  If it does not works, perhaps the display is cut by another module above on your MagicMirror ?

                                  If not, can you share a screenshot to let me understand the problem.

                                  Regards,

                                  Charles

                                  C 1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    clegallic @emrah_asl
                                    last edited by

                                    @emrah_asl
                                    Hi,

                                    @sdetweil is right, feel free to create a pull request.

                                    If you want to force cache reloading, you can also delete the .cache file in the module folder.

                                    The default cache lifetime is 24 hours (refreshDriveDelayInSeconds configuration parameter).

                                    Regards,

                                    Charles

                                    E 1 Reply Last reply Reply Quote 0
                                    • C Offline
                                      chen31 @clegallic
                                      last edited by

                                      @clegallic said in MMM-GoogleDriveSlideShow:

                                      Hi @chen31

                                      The module is designed to adapt the display size of the image based on your maxWidth and maxHeight configuration (see there)

                                      If it does not works, perhaps the display is cut by another module above on your MagicMirror ?

                                      If not, can you share a screenshot to let me understand the problem.

                                      Regards,

                                      Charles

                                      Hi Charles,
                                      I went through this one more time and these are pictures that are portait.
                                      I saw that it’s in your TO DO list.

                                      Thank you.

                                      1 Reply Last reply Reply Quote 0
                                      • E Offline
                                        emrah_asl @clegallic
                                        last edited by

                                        @clegallic I think there is an issue here,

                                        I deleted one image 2 days ago, from google drive also I deleted content from cache file.

                                        But I see, it 'is still showing.

                                        When I add new ımage, it automatically detecting in 10 seconds to show this, but when I delete this it is not working same style.

                                        Can we optimize it at least one hour to refresh caches ?

                                        1 Reply Last reply Reply Quote 0
                                        • A Online
                                          amanzimdwini @clegallic
                                          last edited by

                                          @clegallic - I am on a Rasp3A, but fully patched (npm 6.14.8, node 10.23.0, nodejs 10.23.0).
                                          As su, I fail npm run token:generate - with a

                                          Type Error: cannot read property '0' of undefined...
                                          

                                          (there is more). Upon inspection MY credentials.json file starts like

                                          {"web":{"client_id
                                          

                                          while your example begins

                                          {"installed":{"client_id
                                          

                                          (the rest looks similar to your example) Any idea what I did wrong? If I just replace my “web” with “installed”, I still fail.
                                          Thanks,
                                          K

                                          1 Reply Last reply Reply Quote 0
                                          • W Offline
                                            Wil
                                            last edited by

                                            Hello,

                                            I was trying to install this module but got an error at the npm run token:generate:

                                            pi@raspberrypi:~/MagicMirror/modules/MMM-googleDriveSlideShow $ npm run token:generate
                                            
                                            > mmm-googledriveslideshow@0.0.1 token:generate /home/pi/MagicMirror/modules/MMM-googleDriveSlideShow
                                            > node generate-auth-token.js
                                            
                                            /home/pi/MagicMirror/modules/MMM-googleDriveSlideShow/generate-auth-token.js:33
                                              const OAuth2Client = new google.auth.OAuth2(client_id, client_secret, redirect_uris[0]);
                                                                                                                                 ^
                                            
                                            TypeError: Cannot read property '0' of undefined
                                                at fs.readFile (/home/pi/MagicMirror/modules/MMM-googleDriveSlideShow/generate-auth-token.js:33:86)
                                                at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
                                            npm ERR! code ELIFECYCLE
                                            npm ERR! errno 1
                                            npm ERR! mmm-googledriveslideshow@0.0.1 token:generate: `node generate-auth-token.js`
                                            npm ERR! Exit status 1
                                            npm ERR! 
                                            npm ERR! Failed at the mmm-googledriveslideshow@0.0.1 token:generate script.
                                            npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
                                            
                                            npm ERR! A complete log of this run can be found in:
                                            npm ERR!     /home/pi/.npm/_logs/2021-01-19T20_03_53_720Z-debug.log
                                            

                                            and here is the associated log file:

                                            0 info it worked if it ends with ok
                                            1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'token:generate' ]
                                            2 info using npm@6.14.10
                                            3 info using node@v10.23.1
                                            4 verbose run-script [ 'pretoken:generate', 'token:generate', 'posttoken:generate' ]
                                            5 info lifecycle mmm-googledriveslideshow@0.0.1~pretoken:generate: mmm-googledriveslideshow@0.0.1
                                            6 info lifecycle mmm-googledriveslideshow@0.0.1~token:generate: mmm-googledriveslideshow@0.0.1
                                            7 verbose lifecycle mmm-googledriveslideshow@0.0.1~token:generate: unsafe-perm in lifecycle true
                                            8 verbose lifecycle mmm-googledriveslideshow@0.0.1~token:generate: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/MagicMirror/modules/MMM-googleDriveSlideShow/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
                                            9 verbose lifecycle mmm-googledriveslideshow@0.0.1~token:generate: CWD: /home/pi/MagicMirror/modules/MMM-googleDriveSlideShow
                                            10 silly lifecycle mmm-googledriveslideshow@0.0.1~token:generate: Args: [ '-c', 'node generate-auth-token.js' ]
                                            11 silly lifecycle mmm-googledriveslideshow@0.0.1~token:generate: Returned: code: 1  signal: null
                                            12 info lifecycle mmm-googledriveslideshow@0.0.1~token:generate: Failed to exec token:generate script
                                            13 verbose stack Error: mmm-googledriveslideshow@0.0.1 token:generate: `node generate-auth-token.js`
                                            13 verbose stack Exit status 1
                                            13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
                                            13 verbose stack     at EventEmitter.emit (events.js:198:13)
                                            13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
                                            13 verbose stack     at ChildProcess.emit (events.js:198:13)
                                            13 verbose stack     at maybeClose (internal/child_process.js:982:16)
                                            13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
                                            14 verbose pkgid mmm-googledriveslideshow@0.0.1
                                            15 verbose cwd /home/pi/MagicMirror/modules/MMM-googleDriveSlideShow
                                            16 verbose Linux 5.4.83-v7+
                                            17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "token:generate"
                                            18 verbose node v10.23.1
                                            19 verbose npm  v6.14.10
                                            20 error code ELIFECYCLE
                                            21 error errno 1
                                            22 error mmm-googledriveslideshow@0.0.1 token:generate: `node generate-auth-token.js`
                                            22 error Exit status 1
                                            23 error Failed at the mmm-googledriveslideshow@0.0.1 token:generate script.
                                            23 error This is probably not a problem with npm. There is likely additional logging output above.
                                            24 verbose exit [ 1, true ]
                                            
                                            

                                            Anyone have an idea how to solve this?

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • 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