darickc / MMM-BackgroundSlideshow

MIT License
135 stars 78 forks source link

Can't read folder - blank screen #104

Closed kritch83 closed 2 years ago

kritch83 commented 3 years ago

Having a issue where I'm using rclone to sync my google photos to a directory and then use that for the source of the images in BackgroundSlideShow. I'm just getting a black screen when I try loading my shared directory. If I change it to a different non shared folder it works fine.

I suspect it has something to do with the permissions of the directory/files. Rclone changed the ownership of the directory "pictureShares" to root:root initially. I changed the settings in rclone to force the UID&GID to 1000:1000 (pi:pi) but it still won't pull in any images even with the user/group set to the pi user. I am calling sudo when I launch it but I dont think thats needed & have tried without. If I just change the directory to a different one under my HOME folder it works. It lists the permissions as the same so not sure why this one works and the other directory doesn't. Ive played around with the --allow-other, --dir-perms 0777, --file-perms 0777, --gid 1000, --uid 1000 trying different combos. I've gone thru the rclone documentation and everything looks right with that and it is setting the permissions correctly. One interesting thing is the directories are list as "0" size...

pis of directory lists: https://photos.app.goo.gl/1m571k6cUHKMyVoU7

I view the logs and nothing is noted other than:

"Module helper loaded: MMM-BackgroundSlideshow" "Server started ..." "Sockets connected & modules started ..." "Launching application."

rclone config: sudo rclone mount remote:album /home/pi/pictureShare --daemon --gphotos-read-only --gphotos-read-size --dir-perms 0777 --file-perms 0777 --gid 1000 --uid 1000 --vfs-cache-mode full --attr-timeout 2s --buffer-size 256M --transfers 8 --cache-workers 12 --allow-other --allow-non-empty --noappledouble --max-read-ahead 1M --log-systemd --config /home/pi/.config/rclone/rclone.conf

rc.local starts the launch with:

#!/bin/sh 

/home/pi/scripts/./launch.sh

exit 0

here is the script (launch.sh) - starts unclutter, zenity, rclone, zenity, and pm2(MagicMirror):

#!/bin/bash

sleep 15s  #allow network to connect

unclutter &

sudo -u pi zenity --info --text="Starting Google Photo Sync..." --no-wrap --timeout="59" --width="500" --display=:0 &

sudo rclone mount remote:album /home/pi/pictureShare --daemon --gphotos-read-only --gphotos-read-size --dir-perms 0777 --file-perms 0777 --gid 1000 --uid 1000 --vfs-cache-mode full --attr-timeout 2s --buffer-size 256M --transfers 8 --cache-workers 12 --allow-other --allow-non-empty --noappledouble --max-read-ahead 1M --log-systemd --config /home/pi/.config/rclone/rclone.conf

sleep 60 # let google sync

sudo -u pi zenity --info --text="Starting PM2..." --no-wrap --timeout="5" --width="500" --display=:0 &

sleep 1

#cd

sudo -u pi pm2 start /home/pi/mm.sh --name pictureFrame

exit 0

I don't think I need the sudu in front of the rclone command since the system is running it but I have tried so many combos & nothing works.

Any input/ideas is appreciated!

kritch83 commented 2 years ago

Found part of the issue. in the modules config I had validImageFileExtensions: ['jpg,jpeg,png,gif'] as a option. If I disabled this everything works like a charm. I am not that familiar with js so this is as far as I can go with the issue I think.

darickc commented 2 years ago

If you want to pass this value in, it should just be a string, not an array: validImageFileExtensions: 'jpg,jpeg,png,gif'

kritch83 commented 2 years ago

ah thanks.