Coder Social home page Coder Social logo

hermanho / mmm-googlephotos Goto Github PK

View Code? Open in Web Editor NEW
159.0 17.0 60.0 3.04 MB

Display your photos on MagicMirror from Google Photos.

License: MIT License

CSS 3.92% JavaScript 96.08%
google-photos googlephotos magicmirror nodejs magicmirror2 photos javascript raspberry-pi

mmm-googlephotos's Introduction

MMM-GooglePhotos

Display your photos from album of Google Photos on MagicMirror².

Screenshot

screenshot

screenshot

Installation & Upgrade

INSTALL.md

Configuration

{
  module: "MMM-GooglePhotos",
  position: "top_right",
  config: {
    albums: [], // Set your album name. like ["My wedding", "family share", "Travle to Paris"]
    updateInterval: 1000 * 60, // minimum 10 seconds.
    sort: "new", // "old", "random"
    uploadAlbum: null, // Only album created by `create_uploadable_album.js`.
    condition: {
      fromDate: null, // Or "2018-03", RFC ... format available
      toDate: null, // Or "2019-12-25",
      minWidth: null, // Or 400
      maxWidth: null, // Or 8000
      minHeight: null, // Or 400
      maxHeight: null, // Or 8000
      minWHRatio: null,
      maxWHRatio: null,
      // WHRatio = Width/Height ratio ( ==1 : Squared Photo,   < 1 : Portraited Photo, > 1 : Landscaped Photo)
    },
    showWidth: 1080, // These values will be used for quality of downloaded photos to show. real size to show in your MagicMirror region is recommended.
    showHeight: 1920,
    timeFormat: "YYYY/MM/DD HH:mm", // Or `relative` can be used.
  }
},

Usage

albums

Now this module can access not only your owns but also shared. You can specify album title like this.

albums: ["My wedding", "family share", "Travle to Paris", "from Tom"],
  • Caution. Too many albums and photos could make long bootup delay.
  • Remember this. You can only show max 8640 photos in a day. Manage your album what to show, it will make better performance.

updateInterval

  • Minimum updateInterval is 10 seconds. Too often update could makes API quota drains or network burden.

sort

  • new, old, random are supported.

uploadAlbum

  • If you set this, you can upload pictures from MagicMirror to Google Photos through GPHOTO_UPLOAD notification.
this.sendNotification("GPHOTO_UPLOAD", path);
  • This album SHOULD be created by create_uploadable_album.js.
node create_uploadable_album.js MyMagicMirrorAlbum
  • At this moment, MMM-Selfieshot and MMM-TelegramBot can upload their pictures through this feature.

condition

  • You can filter photos by this object.
  • fromDate : If set, The photos which was created after this value will be loaded. (e.g: fromDate:"2015-12-25" or fromDate:"6 Mar 17 21:22 UT")
  • toDate : If set, The photos which was created before this value will be loaded. (e.g: toDate:"Mon 06 Mar 2017 21:22:23 z" or toDate:"20130208")
  • ISO 8601 and RFC 2822 is supported for fromDate and toDate.
  • minWidth, maxWidth, minHeight, maxHeight : If set, the photos have these value as original dimensiont will be loaded. You can use these values to avoid too big or too small pictures(like icons)
  • minWHRatio, maxWHRatio : With these values, you can get only portrait photos(or landscaped, or squared)
  • WHRatio is width / height. So =1 will be squared dimension. >1 will be landscaped. <1 will be portrait.
  • Example:
condition: {
  fromDate: "2018-01-01", // I don't want older photos than this.
  minWidth: 600, // I don't want to display some icons or meme-pictures from my garbage collecting albums.
  maxWHRatio: 1, // I want to display photos which are portrait.
}

showWidth, showHeight

  • Specify your real resolution to show.

timeFormat

  • Specify time format for photo info. You can also use relative to show more humanized.

debug

  • If set, more detailed info will be logged.

autoInfoPosition

  • For preventing LCD burning, Photo info can be relocated by condition.
    • true : automatically change position to each corner per 15 minutes.
    • false : not using.
    • callbackfunction (album, photo) : User can make his own position. It should return [top, left, bottom, right]
autoInfoPosition: true, // or false

// User custom callback
autoInfoPosition: (album, photo)=> {
 return ['10px', '10px', 'none', 'none'] // This will show photo info top-left corner.
}

Tip

  • Not to show photo info : Add this into your css/custom.css.
#GPHOTO_INFO {
  display: none;
}
  • To move photo info to other position (e.g: top-left corner): Add this into your css/custom.css.
#GPHOTO_INFO {
  top: 10px;
  left: 10px;
  bottom: inherit;
  right: inherit;
}
  • Not to show blurred Background : Add this into your css/custom.css.
#GPHOTO_BACK {
  display: none;
}
  • To cover whole region with image : Add this into your css/custom.css.
#GPHOTO_CURRENT {
  background-size: cover;
}
  • To shrink image and be fully visible on smaller screens : Add this into your css/custom.css.
#GPHOTO_CURRENT {
  background-size: contain;
}
  • To display clock more clearly on showing in fullscreen_below : Add this into your css/custom.css.
.clock {
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
}
  • To give opacity to photos:
@keyframes trans {
  from {opacity: 0}
  to {opacity: 0.5}
}
#GPHOTO_CURRENT {
  background-size:cover;
  opacity:0.5;
}

Notice

  • First scanning will take a few (~dozens) seconds. Don't panic.
  • If there are 1000s of photos, this scan could take minutes(over 10). longer scans increase the probablity of an error happening. If a single error happens in the scan, it will retry after 1 hour. After first successful scan, subsequent startups should go very quickly(seconds).

Last Tested

  • MagicMirror : v2.26.0
  • node.js : required over v18.

mmm-googlephotos's People

Contributors

adi-miller avatar aneaville avatar bipulkkuri avatar chrisacrobat avatar ciaranj avatar culi831 avatar eouia avatar garcha avatar hermanho avatar jeroennc avatar mdissel avatar olafnorge avatar philcali avatar simonsolberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmm-googlephotos's Issues

File type and size restriction

Hi,

Once in couple days, the magicmirror will freeze. I read in the forum, this might due to the photo is too big to handle. Requesting to restrict the file type to just pictures and limit the file size to XX mb.

Thanks

Each client and/or refresh of the mirror adds amount of indexed images to the carousel

Hey mate. Thanks for this awesome plugin. I was looking a long time already for such a nice feature!!

Today I finally got the time to roll it out to one of my mirror instances and found something that confuses me. Whenever a new client connects to my mirror, which runs in server mode, the amount of images in the index gets added again. It's not easy to explain but maybe the logs help you understanding what I am currently facing.

Mar 24 22:19:56 openhab systemd[1]: Started photos.
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.597] [LOG]    Starting MagicMirror: v2.10.1
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.607] [LOG]    Loading config ...
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.614] [LOG]    Loading module helpers ...
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.727] [LOG]    Initializing new module helper ...
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.728] [LOG]    Module helper loaded: MMM-GooglePhotos
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.728] [LOG]    All module helpers loaded.
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.729] [LOG]    Starting server on port 8383 ...
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.735] [LOG]    Server started ...
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.735] [LOG]    Connecting socket for: MMM-GooglePhotos
Mar 24 22:19:56 openhab photos[18284]: [22:19:56.736] [LOG]    Sockets connected & modules started ...
Mar 24 22:19:56 openhab photos[18284]: Ready to go! Please point your browser to: http://127.0.0.1:8383
Mar 24 22:20:10 openhab photos[18284]: [22:20:10.103] [LOG]    [GPHOTOS] Getting album list
Mar 24 22:20:10 openhab photos[18284]: [22:20:10.107] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:20:12 openhab photos[18284]: [22:20:12.507] [LOG]    [GPHOTOS] Finish Album scanning. Properly scanned : 1
Mar 24 22:20:12 openhab photos[18284]: [22:20:12.513] [LOG]    [GPHOTOS] Initialized
Mar 24 22:20:12 openhab photos[18284]: [22:20:12.517] [LOG]    [GPHOTOS] Start first scanning.
Mar 24 22:20:12 openhab photos[18284]: [22:20:12.517] [LOG]    [GPHOTOS] Start Album scanning
Mar 24 22:20:12 openhab photos[18284]: [22:20:12.519] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:20:39 openhab photos[18284]: [22:20:39.555] [LOG]    [GPHOTOS] Getting 721 photo(s) list from 'Testalbum'
-----> Mar 24 22:20:39 openhab photos[18284]: [22:20:39.669] [LOG]    [GPHOTOS] Total indexed photos: 721	<------ first client connected
Mar 24 22:20:57 openhab photos[18284]: [22:20:57.379] [LOG]    [GPHOTOS] Getting album list
Mar 24 22:20:57 openhab photos[18284]: [22:20:57.381] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:20:58 openhab photos[18284]: [22:20:58.517] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:21:00 openhab photos[18284]: [22:21:00.612] [LOG]    [GPHOTOS] Finish Album scanning. Properly scanned : 2
Mar 24 22:21:00 openhab photos[18284]: [22:21:00.618] [LOG]    [GPHOTOS] Initialized
Mar 24 22:21:00 openhab photos[18284]: [22:21:00.620] [LOG]    [GPHOTOS] Start first scanning.
Mar 24 22:21:00 openhab photos[18284]: [22:21:00.621] [LOG]    [GPHOTOS] Start Album scanning
Mar 24 22:21:00 openhab photos[18284]: [22:21:00.622] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:21:28 openhab photos[18284]: [22:21:28.056] [LOG]    [GPHOTOS] Getting 721 photo(s) list from 'Testalbum'
Mar 24 22:21:28 openhab photos[18284]: [22:21:28.059] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:21:55 openhab photos[18284]: [22:21:55.897] [LOG]    [GPHOTOS] Getting 721 photo(s) list from 'Testalbum'
-----> Mar 24 22:21:56 openhab photos[18284]: [22:21:56.207] [LOG]    [GPHOTOS] Total indexed photos: 1442	<------ second client connected
Mar 24 22:23:16 openhab photos[18284]: [22:23:16.242] [LOG]    [GPHOTOS] Getting album list
Mar 24 22:23:16 openhab photos[18284]: [22:23:16.245] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:23:17 openhab photos[18284]: [22:23:17.597] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:23:18 openhab photos[18284]: [22:23:18.859] [LOG]    [GPHOTOS] Finish Album scanning. Properly scanned : 3
Mar 24 22:23:18 openhab photos[18284]: [22:23:18.867] [LOG]    [GPHOTOS] Initialized
Mar 24 22:23:18 openhab photos[18284]: [22:23:18.868] [LOG]    [GPHOTOS] Start first scanning.
Mar 24 22:23:18 openhab photos[18284]: [22:23:18.868] [LOG]    [GPHOTOS] Start Album scanning
Mar 24 22:23:18 openhab photos[18284]: [22:23:18.869] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:23:47 openhab photos[18284]: [22:23:47.561] [LOG]    [GPHOTOS] Getting 721 photo(s) list from 'Testalbum'
Mar 24 22:23:47 openhab photos[18284]: [22:23:47.561] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:24:15 openhab photos[18284]: [22:24:15.197] [LOG]    [GPHOTOS] Getting 721 photo(s) list from 'Testalbum'
Mar 24 22:24:15 openhab photos[18284]: [22:24:15.199] [LOG]    [GPHOTOS:AUTH] Token is alive.
Mar 24 22:24:43 openhab photos[18284]: [22:24:43.359] [LOG]    [GPHOTOS] Getting 721 photo(s) list from 'Testalbum'
-----> Mar 24 22:24:43 openhab photos[18284]: [22:24:43.866] [LOG]    [GPHOTOS] Total indexed photos: 2163	<------ hit F5 (Ctrl + R) on one of the clients

I marked my findings with -----> ... <------. There are 3 in this snippet.

Cheers

Race condition when specifying multiple albums

I've run into a race condition when specifying multiple albums. I traced to the following areas:

Once a get some spare cycles I can try to fix and cut a PR.

No image getting displayed

Hi,

First of all a big thank you for devloping this module. Its awesome and brings life to MagicMirror.

My issue is that I followed all the steps but no image is getting displayed/ Following is the output from the logs and the config file setting. Any help will be appreciated.

[email protected] start /home/pi/MagicMirror
sh run-start.sh

Starting MagicMirror: v2.4.1
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: newsfeed
No helper found for module: MMM-GooglePhotos.
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Sockets connected & modules started ...
Launching application.
Create new calendar fetcher for url: http://calendar.google.com/calendar/ical/sushanttheone%40gmail.com/private-587993a3d8425423c5e3bdc4fde12d0b/basic.ics - Interval: 300000
Create new calendar fetcher for url: http://www.calendarlabs.com/templates/ical/UK-Holidays.ics - Interval: 300000
Create new calendar fetcher for url: http://www.facebook.com/ical/u.php?uid=100000426753977&key=AQAHcGDaafQeFW7I - Interval: 300000
Create new calendar fetcher for url: http://www.facebook.com/ical/b.php?uid=100000426753977&key=AQAHcGDaafQeFW7I - Interval: 300000
Create new news fetcher for url: https://timesofindia.indiatimes.com/rssfeedstopstories.cms - Interval: 300000
Create new news fetcher for url: http://feeds.feedburner.com/ndtvnews-top-stories - Interval: 300000
Shutting down server...
Stopping module helper: updatenotification
Stopping module helper: calendar
Stopping module helper: newsfeed

{
module: "MMM-GooglePhotos",
position: "top_right",
config: {
albumId: "AGj1epWzJwv36L4KZ9sQB3ldrgG2z3BcotCDyCAZMlE0qgbFon13", // your album id from result of auth_and_test.js
refreshInterval: 100060,
scanInterval: 1000
60*10, // too many scans might cause API quota limit also.
//note(2018-07-29). It is some weird. API documents said temporal image url would live for 1 hour, but it might be broken shorter. So, per 10 min scanning could prevent dead url.

sort: "time", //'time', 'reverse', 'random'
showWidth: "800px", // how large the photo will be shown as. (e.g;'100%' for fullscreen)
showHeight: "600px",
originalWidthPx: 800, // original size of loaded image. (related with image quality)
originalHeightPx: 600, // Bigger size gives you better quality, but can give you network burden.
mode: "cover", // "cover" or "contain" (https://www.w3schools.com/cssref/css3_pr_background-size.asp)

}
},

Keeps requesting authentication

Today the modules keep trying to authenticate. It's overwhelming my raspberry pi and the magic mirror. All the tabs in the image are the same page getting requested again.
photo_2019-09-23_11-37-31

Blurry Background Image

Hi,

I recently set up my MagicMirror as a flexible image frame and like your google photos module. Is there a possibility to add a blurry copy of the same image as background to avoid having black bars (maybe as an additional mode)? Unfortunately, I'm not familiar with node so I don't know where to start for this.

Cheers,
Eugen

Getting index.js:29 error

I updated npm, updated my linux system, magicmirror is runnign fine, but after I installed MMM-Googlephotos, I cant seem to run it, I deleted MMM-GooglePhotos folder and reinstalled, but same issue. Can you please help? I did paste credentials.json after I installed MMM-GooglePhotos

node auth_and_test.js
/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/open/index.js:29
...options
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-GooglePhotos/auth.js:6:13)

There is no scanned photo currently.

Everything's OK but it doesn't show pictures.Magicmirror display is normal.No pictures displayed
The terminal displays the following prompts

[GPHOTO] Scan finished : 0
There is no scanned photo currently.
I created several new atlases and added pictures, but none of them responded.
Is it wrong for me to create an atlas in Google Album?

Google Photos stop working after two days

I have been experiencing this issue for about a little over a month now, my google photos stop displaying photos after about every two days, and I have to restart the pi for it to start again. Is anyone else seeing this?
Is there any logs i can refer to on the pi to figure out what is going on?

creating the albums

I realize this may be a stupid question but I am very inexperienced. Where do I create the albums?

Not seeing photos

I've setup my magic mirror on a raspberry pi zero w. I am able to auth_and_test.js with no issues. I've selected my album based on the album id but I am unable to see any photos. The album I've selected is my own album with my own photos. Any help would be greatly appreciated.

Thanks :)

Tim

No photo appears :( only loading...

Hi @eouia !
Thanks for your magnific module, but I cannot make to work. I configure everything but only I can see: "Loading" @ screen.
Can you help me?
I activate debug but nothing relevant.

Image Fullscreen

Hi eouia

Thanks for the great Photo module.

The Module works but once i change the showWidth & showHeight from px to % for fullscreen
the MagicMirror config screen displays.
{ module: "MMM-GooglePhotos", position: "top_right", config: { albumId: "MY Code ******************", // your album id from result ofauth_and_test.js`
refreshInterval: 100060,
scanInterval: 1000
60*10, // too many scans might cause API quota limit also.
//note(2018-07-29). It is some weird. API documents said temporal image url would live for 1 hour, but it might be broken shorter. So, per 10 min scanning could prevent dead url.

sort: "time", //'time', 'reverse', 'random'
showWidth: "100%", // how large the photo will be shown as. (e.g;'100%' for fullscreen)
showHeight: "100%",
originalWidthPx: 800, // original size of loaded image. (related with image quality)
originalHeightPx: 600, // Bigger size gives you better quality, but can give you network burden.
mode: "cover", // "cover" or "contain" (https://www.w3schools.com/cssref/css3_pr_background-size.asp)

}
},
`

MMM-GooglePhotos Not showing images.

I have installed MMM-GooglePhotos. I did npm install. I ran the authentication script and got my album code. I don’t get any error messages, I just don’t have any images loading. The album has several images in it.

Scanning does not complete

The module is scanning all over again:

pi@raspberrypi:~/MagicMirror $ DISPLAY=:0 npm start
>[email protected] start /home/pi/MagicMirror
>sh run-start.sh
Starting MagicMirror: v2.7.1
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: MMM-GooglePhotos
All module helpers loaded.
Starting server on port 8080 ... 
Server started ...
Connecting socket for: updatenotification
Connecting socket for: MMM-GooglePhotos
MMM-GooglePhotos started
Sockets connected & modules started ...
Launching application.
MMM-GooglePhotos initialized after loading.
[GPHOTO] Scan finished : 123
[GPHOTO] Scan finished : 123

MMM-GooglePhotos and MMM-MMM-GroveGestures

Hello eouia!
Sorry for my english. Can you please tell me how you can manage MMM-GooglePhotos with MMM-GroveGestures? I would like to realize flipping photos using gestures. Thanks for the help.

Syntax Error: Unexpected Identifier

Hi eouia!

I just tried to install this module but am not able to actually do so.
Everything worked fine but i can't start the mirror as i get the following syntax error:

`WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/open/index.js:16

const wslToWindowsPath = async path => {
^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:528:28)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-GooglePhotos/auth.js:6:13)
at Module._compile (module.js:556:32)`

I've read through the other problems and tried the things you suggested to do in the other threads but had no luck.

I'm running following versions:

  • Magic Mirror 2.9
  • Node v10.18.0
  • npm 6.13.4

I tried different Node versions: 8x, 10x or even 12x but still had no luck.
I hope that you might be able to help me with this problem.

Thanks in advance

Lukas!

SyntaxError: Unexpected identifier (Mac OS) - when node auth_and_test.js

Hello!
Receive the following error-message when I try to authenticate (Google-Apps account - Not GMAIL) on MagicMirror under MacOS

/Users/xxxx/MagicMirror/modules/MMM-GooglePhotos/node_modules/open/index.js:16
const wslToWindowsPath = async path => {
^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/xxxx/MagicMirror/modules/MMM-GooglePhotos/auth.js:6:13)
at Module._compile (module.js:570:32)

i cant see my photos from my album

i have followed all steps what you have mentioned in read me document. but photos not display in magic mirror. please give some suggestion for me...

Failed to load resource: the server responded with a status of 404 (Not Found)
:8080/modules/MMM-GooglePhotos//MMM-GooglePhotos.js

Unable to see photos

This is most likely a user error, and not a module issue.

I was able to follow the steps and get the auth, but no photos. I'm worried it may be the node.js issue you mentioned, but I am unable to determine if this is the case due to my lack of experience.

Is there any way to see where the break/failure is happening? I do not see any warnings or errors on my MM.

Pictures not displaying

Hi,
The pictures don't seem to be displaying on my screen. I double checked the album id, and I even messed around with the dimensions to no avail. I waited 2 minutes but nothing came up. Do I have to wait longer? Here is my code if you would like to check it.{
module: "MMM-GooglePhotos",
position: "top_right",
config: {
albumId: ["ABti5dbhErLiQmIyMOq6duWFJRFtO4je1FHzLKYG0uEOWV9qG6zh_35Mux_KvD_1xw28x2vrP], // your album id(s) from result of auth_and_test.js
refreshInterval: 1000 * 60,
scanInterval: 1000 * 60*10, // too many scans might cause API quota limit also.
//note(2018-07-29). It is some weird. API documents said temporal image url would live for 1 hour, but it might be broken shorter. So, per 10 min scanning could prevent dead url.

	    sort: "time", //'time', 'reverse', 'random'
	    showWidth: "1500px", // how large the photo will be shown as. (e.g;'100%' for fullscreen)
	    showHeight: "800px",
	    originalWidthPx: 800, // original size of loaded image. (related with image quality)
	    originalHeightPx: 600, // Bigger size gives you better quality, but can give you network burden.
	    opacity: 1, // target "opacity" property (https://www.w3schools.com/cssref/css3_pr_opacity.asp)
	    mode: "hybrid", // "cover" or "contain" (https://www.w3schools.com/cssref/css3_pr_background-size.asp)
	    //ADDED. "hybrid" : if you set as "hybrid" it will change "cover" and "contain" automatically by aspect ratio.
	  }
	},

안녕하세요.

캡처

11단계까지 순조롭게 잘되가가
코드 입력후 아무런 반응을 안하네요...

KakaoTalk_20200311_033557955

정상적이면 앨범 ID 나와야하는데 몇시간째 저상태입니다..

SyntaxError: Unexpected identifier

Hi, since the update to fix opn, I get the following error. Mirror won't start. removing the module from the config allows the mirror to start correctly. Tried to rollback but failed.

The ^^^^ is under 'path'.

Thanks

pi@PicturePi:~/MagicMirror/modules/MMM-GooglePhotos $ node auth_and_test.js
/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/open/index.js:11
const wslToWindowsPath = async path => {
^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-GooglePhotos/auth.js:6:13)

Screenshot samples

Hey,

Thanks for this awesome module! Could you publish some screenshot samples on readme file, please? :)

Google Auth Loop

I am getting stuck in a loop during the step where I select what google account I want to use. I get directed to a page saying that my app isn't verified (post sms verification also), I clicked advanced, see my app name, click it, and redirected back to the select account screen.
I have tried:
Rebuilding Electron
Creating new keys(2 sets)
Using both keys as the credentials.json file
Use multiple browsers
Use different google accounts to try and access the API

error after pasting auth code

I get the below error after I paste my authorisation code -- can you help me make sense of what I'm doing wrong

Paste your code: 4/ABC123.....
(node:7293) UnhandledPromiseRejectionWarning: Error: Error getting tokens:
at oauthClient.getToken (/home/pi/MagicMirror/MMM-GooglePhotos/auth.js:93:24)
at /home/pi/MagicMirror/MMM-GooglePhotos/node_modules/google-auth-library/build/src/auth/oauth2client.js:158:46
at
at process._tickCallback (internal/process/next_tick.js:182:7)
(node:7293) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:7293) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Config.js Issue

Here is the error:
`WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/config/config.js:164
module: "MMM-GooglePhotos",
^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected string
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:678:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
at Function.Module._load (internal/modules/cjs/loader.js:551:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:20:18)
`

Here is the part of the config.js file:

`
module: "weatherforecast",
position: "top_right",
header: "Weather Forecast",
config: {
location: "New York",
locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
appid: "YOUR_OPENWEATHER_API_KEY"
}
},

]

},
{
module: "MMM-GooglePhotos",
position: "top_right",
config: {
albumId: ["AEt1YzuZGt8nJSGfLaXwkg074eaO7PlwTcyEiA5e_waSeE0xCCsMAgW104vwOBtdcVm_deXB4cdN"], // your album id(s) from result of auth_and_test.js
refreshInterval: 100060,
scanInterval: 1000
60*10, // too many scans might cause API quota limit also.
//note(2018-07-29). It is some weird. API documents said temporal image url would live for 1 hour, but it might be broken shorter. So, per 10 min scanning could prevent dead url.

    sort: "time", //'time', 'reverse', 'random'
    showWidth: "800px", // how large the photo will be shown as. (e.g;'100%' for fullscreen)
    showHeight: "600px",
    originalWidthPx: 800, // original size of loaded image. (related with image quality)
    originalHeightPx: 600, // Bigger size gives you better quality, but can give you network burden.
    mode: "hybrid", // "cover" or "contain" (https://www.w3schools.com/cssref/css3_pr_background-size.asp)
    //ADDED. "hybrid" : if you set as "hybrid" it will change "cover" and "contain" automatically by aspect ratio.
}

};`

I double checked that that is the name of the file. I don't know what it is. I've been having problems with config.

Error with node generate token

Hi.
I'm noob with Magic Mirror and the eith MMM-GooglePhotos module. Now I'm trying to install this new version of MMM-GooglePhotos but when I execute the instruction at the terminal
node generate_token.js
Show the errors below:
`internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module 'open'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/pi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:5:13)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)`

The version of node (node -v) is 10.19.0

Thanks for your help in advance

node auth_and_test.js Error

Hi - I just installed MM2 and am working to get photos flowing through it. I seem to be hitting an error on the auth_and_test.js run. I've updated Node to the latest version - seemed to be what caused other folks problems in previous issues.

Any thoughts?

Thank You!

Terminal

XX@xxxxl:~/MagicMirror/modules/MMM-GooglePhotos $ node -v
v13.10.1
XX@xxxx:~/MagicMirror/modules/MMM-GooglePhotos $ node auth_and_test.js
/xxxxx/xxx/MagicMirror/modules/MMM-GooglePhotos/auth.js:32
  const oauthClient = new OAuth2Client(key.client_id, key.client_secret, key.redirect_uris[0]);
                      ^

TypeError: OAuth2Client is not a constructor
    at new Auth (/xxxxx/xxx/MagicMirror/modules/MMM-GooglePhotos/auth.js:32:23)
    at Object.<anonymous> (/xxxx/xxx/MagicMirror/modules/MMM-GooglePhotos/auth_and_test.js:16:14)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

"There is no scanned photo currently." for some albums

I have albums on Google Photos that are automatically updated based on people in the photos. I get the message "There is no scanned photo currently." for this type of album. Albums where I add specific photos work fine. Please let me know what other information I can provide.

Config:

{
    module: "MMM-GooglePhotos",
    position: "top_center",
    header: "Family Photos",
    config: {
        albumId: ["AAXspqDLD-0458bh2pVF7N3aCFd8_DAFTZ6IIdX0qFazHlFHXWSWbGv5_MGcaaSbShqAU0afpZ3S"],
        refreshInterval: 1000*20,
        scanInterval: 1000*60*10,
        sort: "time",
        showWidth: "800px",
        showHeight: "600px",
        originalWidthPx: 800,
        originalHeightPx: 600,
        opacity: 1
        mode: "hybrid",
        showDateLabel: true,
    }
},

Output:

[14:40:17.066] [LOG]    Starting MagicMirror: v2.10.1
[14:40:17.074] [LOG]    Loading config ...
[14:40:17.079] [LOG]    Loading module helpers ...
[14:40:17.659] [LOG]    Initializing new module helper ...
[14:40:17.660] [LOG]    Module helper loaded: MMM-GooglePhotos
[14:40:17.661] [LOG]    All module helpers loaded.
[14:40:17.662] [LOG]    Starting server on port 8080 ... 
[14:40:17.676] [LOG]    Server started ...
[14:40:17.677] [LOG]    Connecting socket for: MMM-GooglePhotos
[14:40:17.678] [LOG]    MMM-GooglePhotos started
[14:40:17.678] [LOG]    Sockets connected & modules started ...
[14:40:17.850] [LOG]    Launching application.
[14:40:19.594] [LOG]    MMM-GooglePhotos initialized after loading.
[14:40:39.601] [LOG]    There is no scanned photo currently.

Time Delay

Is there a way to configure the time each picture is shown? So far it seems to be random and I'm not very good with code to find a good way to delay such a thing. Any help would be greatly appreciated. Cheers.

Storing Google photos locally to minimize Internet bandwidth ??

Sorry, this is not an issue rather a feature question/request. Is there any way to store the photos from Google Drive locally to minimize Internet traffic?
I am building a pi_mirror for someone with limited bandwidth and it would be best to check for new photos in the album, download those to a local storage (partition or usb flash) and rotate/display images from that location on the Magic Mirror. This would limit Internet calls for each album update and image url. It may also reduce problems with number of API calls (could just update once or twice a day to get any new images).
I could probably spin off a new fork, but I wanted to see if anyone has already invented this wheel.
Thanks, Pete

401 Error: disabled_client

I followed the instructions to setup the module, but when I try to execute auth_and_test.js, the browser returns a 401.

it says that "This app is not yet configured to make OAuth requests..."

OAuth-Client-ID Error

Google updated the developer API so there is no "others" when it comes to selecting wich type of the OAuth-Client-ID i want to create.
Which one should I select now ? I´ve tried a few but not a single one was working.

Cover doesn't work as before

It still keeps the side (or top / bottom) black stripes (or blurry when enabled). Am I doing something wrong?

How to make text more readable

Installed your module and I love it. The white text that is the default for all of the modules is a little hard to read. What do you suggest to make text more readable?

Thanks...

Receiving Google Token does not work

Hi,
when I start auth and test the browser starts and I can sign in or choose an account. But when I choose an account the page refreshes and gets to the same page (choose account). It does not matter which account I choose. It is always the same.

Is there something wrong in calling the google api? Any other ideas?
Best regards,
KSE

stuck in node auth_and_test.js loop

This is probably a stupid user error but I've installed Magic Mirror and followed the MMM-GooglePhotos up through the node auth_and_test.js. When i run this, the browser opens like its supposed to and I select the account I am wanting to use. But then i get an error page saying "This app isn't verified" I tried going through the "advance" link to continue on to Magic Mirror but it just takes me back to the page where i select which account to use. I can't get past this point. Please help.
AppVerificationError

Play videos

Hi, is it also possible to include videos?

auth_and_test.js starts, but no album ids are pulled

I'm guessing this is a user error, but I cannot figure out how or why. I go through all of the steps to install MMM-GooglePhotos on MagicMirror. Everything goes exactly according to the directions until I get to running auth_and_test.js. I run "node auth_and_test.js" from /MagicMirror/modules/MMM-GooglePhotos $. When I do this, I see "auth_and_test started". Then the console just hangs. No more output occurs and I so I can't find my Google Photo album ids to continue through the setup.

Then if I close out of the terminal, reopen terminal and try to run the command again, it shows
"auth_and_test started" and then returns to the $ prompt.

Needless to say I'm stuck and not sure where to go from here. Any help would be greatly appreciated. Thank you in advance.

Raspberry Pi 3 Model B v1.2
Raspbian v 9.9
MagicMirror v2.7.1
node.js 10.16.0

Still not producing images.

Thank you so much for the module. I am still having issues with the MMM-GooglePhotos mod.
Still not producing images..
I find no syntax errors, but no images.
What log do you need to look at? and Where in the tree would I find it?
Thank you so much for your help with this.
Mike

Photo Refresh ar 5 sec and 55 sec

When starting up, the first photo will show for 5 sec and the next photo for 55 sec, and that will be the refresh cycle the rest of the time. I have reinstalled complete system, MagicMirror2 & GooglePhotos from scratch 3 times. When I CTRL+M out of MagicMirror, there are two instances of it runing in the top task bar . . . . . is that okay? With MMM-GooglePhotos updating so often, and there not being very much (or very good) update instructions. It seems as though I will have more opportunities to fix this.

My first installation of MagicMirror and GooglePhotos did not have this problem, but then there were updates to MagicMirror and GooglePhotos . . . .

Rediscover This Day

Is it possible to access Google's auto generated Rediscover this Day albums, or possibly apply a date filter to the request?

Display multiple images on same Mirror

Hey very nice module!

I was wondering if it is possible to display more images on the same mirror, for example one on top bar and one on bottom bar?

I tried to create two diffrent modules with different album id but it does'nt work. If it is possible how do I set it up?

Thank you

Best regards

Sajuran

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.