Closed leon-chen-wen-jia closed 1 year ago
@PaperCloud10
Nice catch on that error. It most definitely should not crash when you get a Permission denied
error. I'll start work on fixing that and add some documentation around this.
It looks like you're running in daemon mode. Can you confirm that?
To answer your question simply: yes, PaperPi can pull images from anywhere. It doesn't care one bit where the files are located. The solution to your problem is in the error message PermissionError: [Errno 13] Permission denied: '/media/pi/Pendrive'
The PaperPi daemon does not have read access to the path that you have specified. You have two options to fix this:
/media/pi/Pendrive
-- I'm not quite sure how to do this if you're mounting through the GUI. I'll see if I can round up some information on how to change this for you.
additional unhandled exception:
Traceback (most recent call last):
File "/usr/local/paperpi/paperpi.py", line 759, in <module>
exit_code = main()
File "/usr/local/paperpi/paperpi.py", line 735, in main
exit_code = update_loop(plugins=plugins, screen=screen, max_refresh=config['main'].get('max_refresh', 5))
File "/usr/local/paperpi/paperpi.py", line 571, in update_loop
priority_list = _update_plugins()
File "/usr/local/paperpi/paperpi.py", line 530, in _update_plugins
plugin.update()
File "/usr/local/paperpi/library/Plugin.py", line 165, in update
is_updated, data, priority = self.update_function(*args, **kwargs)
File "/usr/local/paperpi/plugins/slideshow/slideshow.py", line 336, in update_function
image = _add_border(current_image, frame)
File "/usr/local/paperpi/plugins/slideshow/slideshow.py", line 103, in _add_border
im = Image.open(image)
File "/usr/local/paperpi/.venv/lib/python3.9/site-packages/PIL/Image.py", line 3186, in open
raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file '/media/drive/._140011-untitled shoot_5x7, Annemieke, Patti, Voorlinden, Wassenaar.jpg'
@PaperCloud10
How are you mounting the pen drive? Are you using the GUI window interface, or actually issuing sudo mount /dev/sda1 /media/pi/Pendrive
or something similar?
@PaperCloud10 OK. I've been on an odyssey of learning the RaspberryPi GUI, but I have a solution if you're using the Graphical Interface to mount your drive:
WARNING These steps will make it so any user on the Pi can read the USB drive. If you're OK with this, proceed.
PCManFM, the default file manager, will only mount external USB devices with permissions that make it impossible for other users to read your USB drive.
pcmanfm
from a terminal windowsudo apt install usbmount
/media/pi' by running
ls -alh /media/You should see output like below. The important thing is that the permissions are set as
drwxr-x-rxfor the
pidirectory. If they are not run
sudo chmod 755 /media/pi` to fix them.
$ ls -alh /media
drwxr-xr-x 3 root root 4.0K Dec 10 12:42 .
drwxr-xr-x 18 root root 4.0K Sep 22 02:25 ..
drwxr-xr-x 3 root root 8.0K Jan 1 1970 pi
Let me know if that helps. I'll work on fixing the exceptions you caught.
Resolved with ec1aa52663894106873f85c9dedf7a50d8075583
@PaperCloud10 I think this is resolved, I'll add some documentation about removable USB drives and close this issue. Let me know if there are any additional problems/questions that you run into.
See the documentation here: https://github.com/txoof/PaperPi/blob/main/paperpi/plugins/slideshow/README.md#removable-media
@txoof I have just tested this today and it works! Thank you kindly, your help is much appreciated.
Amazing how much the GUI can do for you, and how much it can get in they way in unexpected ways!
I live mostly on the command line, so this was all new for me. Learned a whole lot!
Hello,
It seems that when specifying a mounted drive as a directory for the slideshow plugin permission is denied. When specifying the default directory it works fine. This is my first raspberry pi project and I'm not sure how to proceed from here, is it possible to enable permissions for the slideshow plugin to access images from mounted drives?