hermanho / MMM-GooglePhotos

Display your photos on MagicMirror from Google Photos.
MIT License
170 stars 65 forks source link

Photos not displayed on MagicMirror #154

Closed danielXengines closed 1 year ago

danielXengines commented 1 year ago

Observed behaviour : Photos from Google Photos library not displayed on MagicMirror

Expected behaviour : Photos from Google Photos library are displayed when MMM-GooglePhotos is enabled.

Additional Information : I just set up magic mirror 2 days ago on a RasPi 4

Distributor ID: Raspbian Description: Raspbian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye

To debug the issue:

Any suggestions welcome. Thank you !

Kind regards,

Terminal output log

> magicmirror@2.21.0 start
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js dev

[29.12.2022 07:33.43.629] [LOG]   Starting MagicMirror: v2.21.0
[29.12.2022 07:33.43.635] [LOG]   Loading config ...
[29.12.2022 07:33.43.640] [LOG]   Loading module helpers ...
[29.12.2022 07:33.43.642] [LOG]   No helper found for module: clock.
[29.12.2022 07:33.43.897] [LOG]   Initializing new module helper ...
[29.12.2022 07:33.43.899] [LOG]   Module helper loaded: MMM-GooglePhotos
[29.12.2022 07:33.43.900] [LOG]   All module helpers loaded.
[29.12.2022 07:33.44.007] [LOG]   Starting server on port 8080 ... 
[29.12.2022 07:33.44.030] [LOG]   Server started ...
[29.12.2022 07:33.44.032] [LOG]   Connecting socket for: MMM-GooglePhotos
[29.12.2022 07:33.44.033] [LOG]   Sockets connected & modules started ...
[29.12.2022 07:33.44.289] [LOG]   Launching application.
[29.12.2022 07:33.46.866] [LOG]   [GPHOTOS] Starting Initialization
[29.12.2022 07:33.46.871] [LOG]   [GPHOTOS] Getting album list
[29.12.2022 07:33.46.886] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 07:33.46.891] [LOG]   [GPHOTOS:CORE] Getting Album info chunks.
[29.12.2022 07:33.47.508] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 07:33.47.509] [LOG]   [GPHOTOS:CORE] Getting Album info chunks.
[29.12.2022 07:33.47.848] [LOG]   [GPHOTOS] Finish Album scanning. Properly scanned : 1
[29.12.2022 07:33.47.854] [LOG]   [GPHOTOS] Initialized
[29.12.2022 07:33.47.861] [LOG]   [GPHOTOS] Initialization complete!
[29.12.2022 07:33.47.861] [LOG]   [GPHOTOS] Start first scanning.
[29.12.2022 07:33.47.862] [LOG]   [GPHOTOS] Start Album scanning
[29.12.2022 07:33.47.864] [LOG]   [GPHOTOS] Prepping to get photo list from 'MagicMirror'
[29.12.2022 07:33.47.867] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 07:33.47.869] [LOG]   [GPHOTOS:CORE] Indexing photos now. total:  0
[29.12.2022 07:33.47.882] [LOG]   [GPHOTOS] successfully loaded cache of  3  photos
[29.12.2022 07:33.47.883] [LOG]   [GPHOTOS] num to ref:  3 , DesChunk:  5 , totalLength:  3 , Pntr:  0
[29.12.2022 07:33.47.886] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 07:33.47.887] [LOG]   [GPHOTOS:CORE] received:  3  to refresh
[29.12.2022 07:33.48.528] [LOG]   [GPHOTOS] refreshed:  3 , totalLength:  3 , Pntr:  3
[29.12.2022 07:33.48.528] [LOG]   [GPHOTOS] just sent  3  more pics
[29.12.2022 07:33.49.037] [LOG]   [GPHOTOS] Got 3 photo(s) from 'MagicMirror'
[29.12.2022 07:33.49.043] [LOG]   [GPHOTOS] Total indexed photos: 3
[29.12.2022 07:33.49.061] [LOG]   [GPHOTOS] Photo list cache saved
[29.12.2022 07:34.47.865] [LOG]   [GPHOTOS] Used last pic in list
[29.12.2022 07:34.47.867] [LOG]   [GPHOTOS] num to ref:  3 , DesChunk:  40 , totalLength:  3 , Pntr:  0
[29.12.2022 07:34.47.871] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 07:34.47.872] [LOG]   [GPHOTOS:CORE] received:  3  to refresh
[29.12.2022 07:34.48.353] [LOG]   [GPHOTOS] refreshed:  3 , totalLength:  3 , Pntr:  3
[29.12.2022 07:34.48.354] [LOG]   [GPHOTOS] just sent  3  more pics
[29.12.2022 07:35.47.866] [LOG]   [GPHOTOS] Used last pic in list
[29.12.2022 07:35.47.868] [LOG]   [GPHOTOS] num to ref:  3 , DesChunk:  40 , totalLength:  3 , Pntr:  0
[29.12.2022 07:35.47.871] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 07:35.47.873] [LOG]   [GPHOTOS:CORE] received:  3  to refresh
[29.12.2022 07:35.48.423] [LOG]   [GPHOTOS] refreshed:  3 , totalLength:  3 , Pntr:  3
[29.12.2022 07:35.48.423] [LOG]   [GPHOTOS] just sent  3  more pics
[29.12.2022 07:36.22.772] [LOG]   Shutting down server...

Console log

main.js:483 Initializing MagicMirror².
translator.js:128 Loading core translation file: translations/en.json
translator.js:146 Loading core translation fallback file: translations/en.json
loader.js:184 Load script: modules/default/clock/clock.js
module.js:509 Module registered: clock
loader.js:155 Bootstrapping module: clock
loader.js:184 Load script: vendor/node_modules/moment/min/moment-with-locales.js
loader.js:184 Load script: vendor/node_modules/moment-timezone/builds/moment-timezone-with-data.js
loader.js:184 Load script: vendor/node_modules/suncalc/suncalc.js
loader.js:160 Scripts loaded for: clock
loader.js:203 Load stylesheet: modules/default/clock/clock_styles.css
loader.js:162 Styles loaded for: clock
loader.js:164 Translations loaded for: clock
loader.js:184 Load script: modules/MMM-GooglePhotos/MMM-GooglePhotos.js
module.js:509 Module registered: MMM-GooglePhotos
loader.js:155 Bootstrapping module: MMM-GooglePhotos
loader.js:160 Scripts loaded for: MMM-GooglePhotos
loader.js:203 Load stylesheet: modules/MMM-GooglePhotos/MMM-GooglePhotos.css
loader.js:162 Styles loaded for: MMM-GooglePhotos
loader.js:164 Translations loaded for: MMM-GooglePhotos
loader.js:203 Load stylesheet: css/custom.css
clock.js:48 Starting module: clock
main.js:501 All modules started!
main.js:36 Uncaught TypeError: Cannot read properties of undefined (reading 'appendChild')
    at main.js:36:12
    at Array.forEach (<anonymous>)
    at createDomObjects (main.js:20:11)
    at Object.modulesStarted (main.js:504:4)
    at startModules (loader.js:55:6)
    at loader.js:38:6
    at stylesheet.onload (loader.js:210:7)
VM4 sandbox_bundle:53 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
  Policy set or a policy with "unsafe-eval" enabled. This exposes users of
  this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.
warnAboutInsecureCSP @ VM4 sandbox_bundle:53
MMM-GooglePhotos.js:95 https://lh3.googleusercontent.com/lr/url_that_opens_up_google_photos_replaced=w1080-h1920
MMM-GooglePhotos.js:118 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at hidden.onload (MMM-GooglePhotos.js:118:12)
hidden.onload @ MMM-GooglePhotos.js:118
load (async)
ready @ MMM-GooglePhotos.js:113
updatePhotos @ MMM-GooglePhotos.js:96
socketNotificationReceived @ MMM-GooglePhotos.js:64
(anonymous) @ module.js:245
(anonymous) @ socketclient.js:38
Emitter.emit @ index.mjs:136
emitEvent @ socket.js:278
onevent @ socket.js:265
MMSocket.socket.onevent @ socketclient.js:32
onpacket @ socket.js:235
Emitter.emit @ index.mjs:136
ondecoded @ manager.js:205
Emitter.emit @ index.mjs:136
add @ index.js:124
ondata @ manager.js:193
Emitter.emit @ index.mjs:136
onPacket @ socket.js:323
Emitter.emit @ index.mjs:136
onPacket @ transport.js:105
onData @ transport.js:97
ws.onmessage @ websocket.js:79
MMM-GooglePhotos.js:95 https://lh3.googleusercontent.com/lr/url_that_opens_up_google_photos_replaced=w1080-h1920
MMM-GooglePhotos.js:118 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at hidden.onload (MMM-GooglePhotos.js:118:12)
hidden.onload @ MMM-GooglePhotos.js:118
load (async)
ready @ MMM-GooglePhotos.js:113
updatePhotos @ MMM-GooglePhotos.js:96
(anonymous) @ MMM-GooglePhotos.js:55
MMM-GooglePhotos.js:95 https://lh3.googleusercontent.com/lr/url_that_opens_up_google_photos_replaced=w1080-h1920
MMM-GooglePhotos.js:118 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at hidden.onload (MMM-GooglePhotos.js:118:12)
hidden.onload @ MMM-GooglePhotos.js:118
load (async)
ready @ MMM-GooglePhotos.js:113
updatePhotos @ MMM-GooglePhotos.js:96
(anonymous) @ MMM-GooglePhotos.js:55
MMM-GooglePhotos.js:95 https://lh3.googleusercontent.com/lr/url_that_opens_up_google_photos_replaced=w1080-h1920
MMM-GooglePhotos.js:118 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at hidden.onload (MMM-GooglePhotos.js:118:12)
hidden.onload @ MMM-GooglePhotos.js:118
load (async)
ready @ MMM-GooglePhotos.js:113
updatePhotos @ MMM-GooglePhotos.js:96
socketNotificationReceived @ MMM-GooglePhotos.js:64
(anonymous) @ module.js:245
(anonymous) @ socketclient.js:38
Emitter.emit @ index.mjs:136
emitEvent @ socket.js:278
onevent @ socket.js:265
MMSocket.socket.onevent @ socketclient.js:32
onpacket @ socket.js:235
Emitter.emit @ index.mjs:136
ondecoded @ manager.js:205
Emitter.emit @ index.mjs:136
add @ index.js:124
ondata @ manager.js:193
Emitter.emit @ index.mjs:136
onPacket @ socket.js:323
Emitter.emit @ index.mjs:136
onPacket @ transport.js:105
onData @ transport.js:97
ws.onmessage @ websocket.js:79
MMM-GooglePhotos.js:95 https://lh3.googleusercontent.com/lr/url_that_opens_up_google_photos_replaced=w1080-h1920
MMM-GooglePhotos.js:118 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at hidden.onload (MMM-GooglePhotos.js:118:12)
hidden.onload @ MMM-GooglePhotos.js:118
load (async)
ready @ MMM-GooglePhotos.js:113
updatePhotos @ MMM-GooglePhotos.js:96
(anonymous) @ MMM-GooglePhotos.js:55
MMM-GooglePhotos.js:95 https://lh3.googleusercontent.com/lr/url_that_opens_up_google_photos_replaced=w1080-h1920
MMM-GooglePhotos.js:118 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at hidden.onload (MMM-GooglePhotos.js:118:12)
hidden.onload @ MMM-GooglePhotos.js:118
load (async)
ready @ MMM-GooglePhotos.js:113
updatePhotos @ MMM-GooglePhotos.js:96
(anonymous) @ MMM-GooglePhotos.js:55
MMM-GooglePhotos.js:95 https://lh3.googleusercontent.com/lr/url_that_opens_up_google_photos_replaced=w1080-h1920
MMM-GooglePhotos.js:118 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at hidden.onload (MMM-GooglePhotos.js:118:12)
hidden.onload @ MMM-GooglePhotos.js:118
load (async)
ready @ MMM-GooglePhotos.js:113
updatePhotos @ MMM-GooglePhotos.js:96
socketNotificationReceived @ MMM-GooglePhotos.js:64
(anonymous) @ module.js:245
(anonymous) @ socketclient.js:38
Emitter.emit @ index.mjs:136
emitEvent @ socket.js:278
onevent @ socket.js:265
MMSocket.socket.onevent @ socketclient.js:32
onpacket @ socket.js:235
Emitter.emit @ index.mjs:136
ondecoded @ manager.js:205
Emitter.emit @ index.mjs:136
add @ index.js:124
ondata @ manager.js:193
Emitter.emit @ index.mjs:136
onPacket @ socket.js:323
Emitter.emit @ index.mjs:136
onPacket @ transport.js:105
onData @ transport.js:97
ws.onmessage @ websocket.js:79
danielXengines commented 1 year ago

Just realised this is a duplicate of https://github.com/hermanho/MMM-GooglePhotos/issues/153#issue-1503792171

aneaville commented 1 year ago

Can you try to add more than 5 pics in your album? It's trying to send a list of 5, but looks like you only have 3 in there.

danielXengines commented 1 year ago

Thank you for your reply. I did as suggested (6 photos), unfortunately the issue remains (same error messages).

If I look at the debug window under lh3.googleusercontent.com -> lr -> all pictures from the google album are there.

Kind regards,

> magicmirror@2.21.0 start
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js dev

[29.12.2022 20:42.46.181] [LOG]   Starting MagicMirror: v2.21.0
[29.12.2022 20:42.46.187] [LOG]   Loading config ...
[29.12.2022 20:42.46.192] [LOG]   Loading module helpers ...
[29.12.2022 20:42.46.194] [LOG]   No helper found for module: clock.
[29.12.2022 20:42.46.450] [LOG]   Initializing new module helper ...
[29.12.2022 20:42.46.452] [LOG]   Module helper loaded: MMM-GooglePhotos
[29.12.2022 20:42.46.453] [LOG]   No helper found for module: MMM-GrafanaChart.
[29.12.2022 20:42.46.454] [LOG]   All module helpers loaded.
[29.12.2022 20:42.46.563] [LOG]   Starting server on port 8080 ... 
[29.12.2022 20:42.46.580] [LOG]   Server started ...
[29.12.2022 20:42.46.582] [LOG]   Connecting socket for: MMM-GooglePhotos
[29.12.2022 20:42.46.583] [LOG]   Sockets connected & modules started ...
[29.12.2022 20:42.46.846] [LOG]   Launching application.
[29.12.2022 20:42.49.598] [LOG]   [GPHOTOS] Starting Initialization
[29.12.2022 20:42.49.616] [LOG]   [GPHOTOS] Getting album list
[29.12.2022 20:42.49.622] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 20:42.49.625] [LOG]   [GPHOTOS:CORE] Getting Album info chunks.
[29.12.2022 20:42.50.290] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 20:42.50.291] [LOG]   [GPHOTOS:CORE] Getting Album info chunks.
[29.12.2022 20:42.50.639] [LOG]   [GPHOTOS] Finish Album scanning. Properly scanned : 1
[29.12.2022 20:42.50.647] [LOG]   [GPHOTOS] Initialized
[29.12.2022 20:42.50.653] [LOG]   [GPHOTOS] Initialization complete!
[29.12.2022 20:42.50.654] [LOG]   [GPHOTOS] Start first scanning.
[29.12.2022 20:42.50.656] [LOG]   [GPHOTOS] Start Album scanning
[29.12.2022 20:42.50.658] [LOG]   [GPHOTOS] Prepping to get photo list from 'MagicMirror'
[29.12.2022 20:42.50.662] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 20:42.50.664] [LOG]   [GPHOTOS:CORE] Indexing photos now. total:  0
[29.12.2022 20:42.50.681] [LOG]   [GPHOTOS] successfully loaded cache of  6  photos
[29.12.2022 20:42.50.682] [LOG]   [GPHOTOS] num to ref:  5 , DesChunk:  5 , totalLength:  6 , Pntr:  0
[29.12.2022 20:42.50.685] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 20:42.50.686] [LOG]   [GPHOTOS:CORE] received:  5  to refresh
[29.12.2022 20:42.51.400] [LOG]   [GPHOTOS] Got 6 photo(s) from 'MagicMirror'
[29.12.2022 20:42.51.407] [LOG]   [GPHOTOS] Total indexed photos: 6
[29.12.2022 20:42.51.413] [LOG]   [GPHOTOS] Photo list cache saved
[29.12.2022 20:42.51.697] [LOG]   [GPHOTOS] refreshed:  5 , totalLength:  6 , Pntr:  5
[29.12.2022 20:42.51.698] [LOG]   [GPHOTOS] just sent  5  more pics
[29.12.2022 20:44.51.299] [LOG]   [GPHOTOS] Used last pic in list
[29.12.2022 20:44.51.304] [LOG]   [GPHOTOS] num to ref:  1 , DesChunk:  40 , totalLength:  6 , Pntr:  5
[29.12.2022 20:44.51.308] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 20:44.51.309] [LOG]   [GPHOTOS:CORE] received:  1  to refresh
[29.12.2022 20:44.51.810] [LOG]   [GPHOTOS] refreshed:  1 , totalLength:  6 , Pntr:  6
[29.12.2022 20:44.51.811] [LOG]   [GPHOTOS] just sent  1  more pics
[29.12.2022 20:44.51.814] [LOG]   [GPHOTOS] Used last pic in list
[29.12.2022 20:44.51.815] [LOG]   [GPHOTOS] num to ref:  6 , DesChunk:  40 , totalLength:  6 , Pntr:  0
[29.12.2022 20:44.51.817] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 20:44.51.817] [LOG]   [GPHOTOS:CORE] received:  6  to refresh
[29.12.2022 20:44.52.316] [LOG]   [GPHOTOS] refreshed:  6 , totalLength:  6 , Pntr:  6
[29.12.2022 20:44.52.317] [LOG]   [GPHOTOS] just sent  6  more pics
[29.12.2022 20:47.21.299] [LOG]   [GPHOTOS] Used last pic in list
[29.12.2022 20:47.21.300] [LOG]   [GPHOTOS] num to ref:  6 , DesChunk:  40 , totalLength:  6 , Pntr:  0
[29.12.2022 20:47.21.301] [LOG]   [GPHOTOS:AUTH] Token is alive.
[29.12.2022 20:47.21.302] [LOG]   [GPHOTOS:CORE] received:  6  to refresh
[29.12.2022 20:47.21.774] [LOG]   [GPHOTOS] refreshed:  6 , totalLength:  6 , Pntr:  6
[29.12.2022 20:47.21.775] [LOG]   [GPHOTOS] just sent  6  more pics
[29.12.2022 20:48.46.278] [LOG]   Shutting down server...
danielXengines commented 1 year ago

Hello there,

It appears that this module does not work if the screen position is set to "middle_third". When this position is used, main.js fails on line 36

wrapper.appendChild(dom);

I have no idea why this is so, but it appears to work with all other positions I have tested. I am not sure if this is an issue with this module or MagicMirror itself.

I have found a solution that works for me, but I don't know if I should close this issue?? Thanks.

Kind regards,

Daniel

danielXengines commented 1 year ago

My bad, there is no screen position "middle_third", just "middle_center". Closing this issue.