roamingthings / spyglass

A simple mjpeg server for Picamera2
GNU General Public License v3.0
57 stars 12 forks source link

Error during install as service - missing config directory #64

Closed strips closed 1 week ago

strips commented 6 months ago

Hi,

I am not using this with any printer software. It seems spyglass was made for some software that uses the path ~/printer_data/config

I assume there is a missing mkdir ~/printer_data/config somewhere. I might create a PR for this, but if I do I would also change the config dir to /etc/spyglass.

How to reproduce on vanilla raspian OS:

root@hakkebo:~# git clone https://github.com/roamingthings/spyglass.git
Cloning into 'spyglass'...
remote: Enumerating objects: 443, done.
remote: Counting objects: 100% (208/208), done.
remote: Compressing objects: 100% (103/103), done.
remote: Total 443 (delta 134), reused 131 (delta 96), pack-reused 235
Receiving objects: 100% (443/443), 104.73 KiB | 674.00 KiB/s, done.
Resolving deltas: 100% (232/232), done.

root@hakkebo:~# cd spyglass/

root@hakkebo:~/spyglass# make install

Copying systemd service file ...

Copying Spyglass launch script ...

Copying basic configuration file ...
cp: cannot create regular file '/home/root/printer_data/config': No such file or directory
make: *** [Makefile:27: install] Error 1

Regards Stian

mryel00 commented 6 months ago

Hey, thanks for the hint to this. We started this project for the 3D printing community, for klipper and moonraker machines to be precise. Imo this should stay the main target and therefore the default directory of ~/printer_data/config should stay like this. A check for the directory and the creation if it doesn't exist, can make sense. Another option might be to check for the ~/printer_data/config directory and if it doesn't exist, create and use the /etc/spyglass directory. @roamingthings what's your opinion on this?

roamingthings commented 6 months ago

Since Spyglass is targeted at Klipper which has a fixed filesystem layout I would not change the directory by default. In the other hand I'm happy, if this project is of any use outside the Klipper universe. Can we find a solution that keeps the current folder as a default and allows it to be changed as an option?

mryel00 commented 6 months ago

You mean e.g. make install INSTALL_DIR=/foo/bar?

strips commented 6 months ago

Thanks for the explanation. I'm actually intending to use this for Duet (RRF) to serve video / photos for 3d printing :)

If this software is targeted for Klipper I would suggest a change in the description of the software.

Maybe changing this in the readme, "A simple mjpeg server for Picamera2." to "A simple Picamera2 based mjpeg server for Klipper." At least some text so people get where the software is coming from and it's intended use. Then adding a line to say it can also be used standalone.

mryel00 commented 6 months ago

You are right. I thought there was maybe already a section like that, until your post. The README and installer need both an update anyway, but no one had time for it yet.

strips commented 6 months ago

I have forked the repo and might create a PR if I get it working satisfactory. Keeping the default config folder and adding a make install CONFIG_PATH= parameter. I'll write something on the readme as well.

mryel00 commented 1 week ago

Fixed with #73