ceeeeb / pibooth-nextcloud

Pibooth plugin for Nextcloud upload
MIT License
2 stars 1 forks source link

QR code file not found #3

Closed mike4054 closed 4 months ago

mike4054 commented 5 months ago

Hello Thank you for the very nice plugin. Unfortunately I can't use it because it throws a FileNotFound error:

FileNotFoundError: [Errno 2] No such file or directory: '~/Pictures/pibooth/QRCODE.png'

The login to nextcloud works and it creates the subfolder and share link but then it fails with the error above.

Here's the log:

[ INFO ] pibooth : Installed plugins: nextcloud-1.0.1 [ INFO ] pibooth : Starting the photo booth application on Raspberry pi 4B [ INFO ] pibooth : Configuring OpenCV camera ... VIDEOIO ERROR: V4L2: setting property #30 is not supported [ WARNING ] pibooth : No printer named 'defaultNONE' in CUPS (see http://localhost:631) [ INFO ] pibooth : Create the NextcloudUpload Instance [ INFO ] pibooth : Synchronize is (True)... [ INFO ] pibooth : Login Host (https://my.nextcloud.server/nextcloud)... [ INFO ] pibooth : Login User (pibooth)... [ INFO ] pibooth : Nextcloud Login OK !! (https://my.nextcloud.server/nextcloud) [ INFO ] pibooth : Create Directory and Share [ INFO ] pibooth : Create Directory and Album (suubdir)... [ INFO ] pibooth : rep_photos_nextcloud Already exist !! (/Photos/) [ INFO ] pibooth : Creation of the directory (/Photos/suubdir) failed , may be already exist !! [ INFO ] pibooth : Create Share Link... [ INFO ] pibooth : Nextcloud Create Share Link (/Photos/suubdir) [ INFO ] pibooth : Share Link Already Exist (/Photos/suubdir) [ INFO ] pibooth : Share remote Link Public (https://my.nextcloud.server/nextcloud/index.php/s/CZSmzj9bRSYKCE2)... [ INFO ] pibooth : Create Link Gallery (https://my.nextcloud.server/nextcloud/apps/gallery/index.php/s/CZSmzj9bRSYKCE2)... [ INFO ] pibooth : Create QrCode with URL Link Gallery (https://my.nextcloud.server/nextcloud/index.php/s/CZSmzj9bRSYKCE2)... [ ERROR ] pibooth : [Errno 2] No such file or directory: '~/Pictures/pibooth/QRCODE.png'

mike4054 commented 5 months ago

it raises the same error even if I create the QRCODE.png manually in that directory

ceeeeb commented 5 months ago

Hello,

Can you send me your pibooth.cfg

Thx

mike4054 commented 5 months ago

pibooth.cfg.txt many thanks for your quick support!

ceeeeb commented 5 months ago

Can you try to replace relative path by absolute Path for directory config

Path to save pictures (list of quoted paths accepted)

directory = ~/Pictures/pibooth replace by directory = /home/pi/Pictures/pibooth

mike4054 commented 5 months ago

Yeah, looks much better. But now there's another issue: when it tries to upload the file it doesn't find the "nextcloudcmd"

... [ INFO ] pibooth : Creating the final picture [ INFO ] pibooth : Use OpenCvPictureFactory to create background [ INFO ] pibooth : Use OpenCvPictureFactory to concatenate images [ INFO ] pibooth : Use OpenCvPictureFactory to assemble final image [ INFO ] pibooth : Use OpenCvPictureFactory to draw texts [ INFO ] pibooth : Save image '/home/[user]/Pictures/pibooth/2024-04-10-11-15-38_pibooth.jpg' [ INFO ] pibooth : Synchronize Directory local to Remote (/home/[user]/Pictures/pibooth/2024-04-10-11-15-38_pibooth.jpg)... [ INFO ] pibooth : Os Command (nextcloudcmd -u [username] -p [topsecretpasswd] -s /home/[user]/Pictures/pibooth https://my.nextcloud.server/nextcloud/remote.php/webdav/Photos/suubdir) sh: 1: nextcloudcmd: not found [ INFO ] pibooth : In state_wait_enter (/home/[user]/Pictures/pibooth/2024-04-10-11-15-38_pibooth.jpg)

ceeeeb commented 5 months ago

Yes , There is a problem with nextcloud synchronyse.

Work around 👍 Try to set useSynchronize to False

mike4054 commented 5 months ago

that works! thx a lot! but the upload is very slow. I think this might be the reason for the synchronise function... :) if I upload the same file (of a size of around 200kB) via the browser to Nextcloud it is done within a second...

ceeeeb commented 5 months ago

What does slow mean, 2 or 3 seconds?

No, the synchronize option allows you to synchronize the directory, which means that if there is an internet outage, you can upload all the photos at once, but for this to work, you need to install an additional nextcloud command. I forgot to mention this in the documentation.

mike4054 commented 5 months ago

No, very slow. 2-3 minutes or even more for 200kB. When I use the browser on the same raspberry at the same time the upload of the same file finishes within seconds. What do I need to install for the sync function?

ceeeeb commented 5 months ago

That's strange, what type of Raspberry are you using?

Maybe it's the making of the image that takes time.

I'm not sure that the synchronize option speeds up the upload.

below to install nextcloudcmd wget http://ftp.de.debian.org/debian/pool/main/n/nextcloud-desktop/nextcloud-desktop-cmd_3.1.1-2+deb11u1_armhf.deb sudo dpkg -i nextcloud-desktop-cmd_3.1.1-2+deb11u1_armhf.deb sudo apt install --fix-broken

mike4054 commented 5 months ago

A Pi4. I think the speed is not an issue but the thing is, after the photo has been taken, the screen stays on "processing image..." until the upload has finished. Also I'd like the other approach with the independent upload (synchronize) so in case of an instable internet connection the photo creation is not affected.

I'll try the installation of the package later. Thank you very much! Really appreciate!

mike4054 commented 4 months ago

Allright! now it works. But I had to install it from the Debian repo with apt-get due to tons of dependencies. However, the upload is now fast. once the photo is taken, it saves the image and then synchronizes the directory. this only takes some seconds, as expected for some kB. But the normal upload (without sync) takes minutes. Well... now it's OK for me. Many thanks for your support!