#Raspberry Camera Module 3 support?

1 messages ยท Page 2 of 1

foggy ivy
#

There is issue with kernel 6.1 ? I can try to update

wet lynx
#

I don't know. @woven viper do you know anything about the 6.1 or why did you mention it?

woven viper
#

This kernel is a release candidate model and might have issues. Was a question to rule that out as error source.

#

But tbh even I ran out of ideas, what to look for...

static pine
#

Is there a way to use multiple cameras with Spyglass or is it possible to use Spyglass with crowsnest? I tried using crowsnest+ Spyglass but from what I can tell crowsnest doesn't allow spyglass to grab pi cam 3

wet lynx
#

I thought you could use both at the same time but crowsnest is just blocking the 8080 port. Will test it real quick and let you know.
If you know a bit about linux and git, you could try to use the spyglass branch of crowsnest.

#

Or the add_usbcam_support branch of spyglass

static pine
#

I'll try the spyglass branch

wet lynx
wet lynx
#

And we won't give any support on that branch

wet lynx
static pine
#

I'll try again later

wet lynx
# static pine Just no image

If it's still not working later. Give me some more infos, like is it installed as a service, what is your config, did you already try to run it with ~/spyglass/run.py?

static pine
#

Yeah they're both installed as a service

wet lynx
#

Then please try to run ~/spyglass/run.py -p 8081 and send the output

static pine
#

Well I don't know why but I disabled the legacy camera stack when it was never enabled and now it works

wet lynx
woven viper
#

Also already testing to drop it completly, if we can use at least raspicam v2 with spyglass then we can drop it maybe. Ustreamer seems to not need it anymore with bullseye and raspios support is already marked as deprecated for crowsnest

#

For those, who are stay with buster there is a branch with feature freezes of crowsnest. It will not recieve fixes or new features for obvious reasons but it keeps buster images alive

#

Tbh, looking forward to use spyglass as an complete replacement for crowsnest. But we all are doing that in our spare time and there is no cash flow that would allow us doing it for fulltime, so patience is crucial here...

rich fractal
#

@wet lynx read it all now but was kinda less info than the dev channel on that issue of the service not working ```pi@ruby:~/spyglass $ sudo ./run.py -b 0.0.0.0 -p 8080 -r 1920x1080 -f 15 -l 0.15 -s fast
INFO:root:Spyglass 0.10.2
[0:01:12.474535804] [744] INFO Camera camera_manager.cpp:299 libcamera v0.0.3+40-9b860a66
[0:01:12.640427158] [745] INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media3 and ISP device /dev/media0
INFO:picamera2.picamera2:Initialization successful.
INFO:picamera2.picamera2:Camera now open.
[0:01:12.652235647] [744] INFO Camera camera.cpp:1028 configuring streams: (0) 1920x1080-XBGR8888
[0:01:12.653011481] [745] INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected unicam format: 2304x1296-pBAA
INFO:picamera2.picamera2:Configuration successful!
INFO:picamera2.picamera2:Camera started
INFO:spyglass:Server listening on 0.0.0.0:8080
INFO:spyglass:Streaming endpoint: /stream
INFO:spyglass:Snapshot endpoint: /snapshot

wet lynx
#

There isn't any info in both channels for that problem ig. Your spyglass is working but your service is failing somehow. Can you send the your config?

rich fractal
wet lynx
#

spyglass config sry

rich fractal
wet lynx
#

And open two terminals and send the end of the output of journalctl -g spyglass -b after running sudo systemctl restart spygass.service

#

One terminal with journalctl and other with systemctl

#

in journalctl you can scroll down with page down

#

one terminal would be enough too

rich fractal
#
Mar 02 13:31:18 ruby systemd[1]: spyglass.service: Failed with result 'exit-code'.
Mar 02 13:31:24 ruby systemd[1]: spyglass.service: Scheduled restart job, restart counter is at 7.
Mar 02 13:31:24 ruby systemd[1]: Stopped spyglass - Picamera2 MJPG Streamer.
Mar 02 13:31:24 ruby systemd[1]: Started spyglass - Picamera2 MJPG Streamer.
Mar 02 13:31:24 ruby systemd[1070]: spyglass.service: Failed to locate executable /usr/local/bin/spyglass: Permission denied
Mar 02 13:31:24 ruby systemd[1070]: spyglass.service: Failed at step EXEC spawning /usr/local/bin/spyglass: Permission denied
Mar 02 13:31:24 ruby systemd[1]: spyglass.service: Main process exited, code=exited, status=203/EXEC
Mar 02 13:31:24 ruby systemd[1]: spyglass.service: Failed with result 'exit-code'.```
wet lynx
#

journalctl -g spyglass -r after running systemctl would show you the newest entry first, never used journalctl ^^

rich fractal
#

weird its just some permission denied

wet lynx
#

show me ls -l /usr/local/bin

rich fractal
#
total 800
-rwxr-xr-x 1 root root 818112 Jan 18 23:24 klipper_mcu
lrwxrwxrwx 1 root root     34 Mar  2 12:22 spyglass -> /home/pi/spyglass/scripts/spyglass
pi@ruby:~/spyglass $ ```
wet lynx
#

Then restart your pi and run journalctl -g spyglass -r -b again. But I guess it won't change anything

#

If it's the same error after a reboot, try to uninstall with make uninstall && sudo systemctl stop spyglass.service

#

and then send the output of git status

#

The only thing left for me would be something wasn't updating the git repo on your side and corrupting your install somehow. As it is exactly the same on my setup but it's working for me

#

Wait, what OS are you running?

rich fractal
#

bullseye 64 bit

wet lynx
#

Ok then try uninstall and send output of git status

rich fractal
#
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean```
wet lynx
#

Did you use make install or sudo make install?

#

and send ls -l ~/spyglass/scripts/spyglass.

#

Easiest option might be to delete the folder and reclone it. Maybe something wrong with some execution rights and git doesn't show that afaik.

rich fractal
#

lol wtf

#

just did make install again

#

and bam it magically worked now

#

but maybe it helped with all the boot config changes

wet lynx
#

Then you might have used sudo make install or the boot config changes did it.

rich fractal
#

I think boot config changes did it

wet lynx
#

Still weird that you got permission errors if the boot config changes were the problem.

rich fractal
#

yeah idk but happy to have it working

#

wish there was something more definite that was the issue

wet lynx
#

That's always the problem if you troubleshoot, try a lot of different things, then just start over again and it's working somehow then.

rich fractal
#

yeah I tried to try one change at a time with boot config

#

but I did reclone the repo and do a new make install

#

so might of been just some weird fluke

foggy ivy
#

@wet lynx Just received new cam and it's working

#

So I think that was a bad batch

wet lynx
#

Interesting. Your friends cams are now working too?

foggy ivy
#

they have returned it too and they are waiting for a new one

reef belfry
#

Hi, I just installed my raspi module3 instead of v2.1. I have never installed crowsnest. So I installed spyglass, I updated my python (v3.9.9). I don't understand the error...??

wet lynx
#

What OS did you install?

reef belfry
wet lynx
#

On your Pi. MainsailOS or a Raspberry Pi OS?

reef belfry
#

MainsailOS

wet lynx
#

cat /etc/os-release

reef belfry
wet lynx
#

Completely empty?

reef belfry
#

no, sorry, after reboot is not empty

wet lynx
#

I will be in 10min on my PC and then I can help you a bit better

reef belfry
wet lynx
#

That's normal

reef belfry
#

merci beaucoup... ๐Ÿ˜€

wet lynx
#

python3 -m pip install picamera2

#

@reef belfry I'm on my PC now.
Did you already try python3 ~/spyglass/run.py? Picamera2 should be preinstalled on bullseye systems, so my guess would be that it's trying to run it with python 2

#

If there aren't that many things that you really need of this exact installation. I would suggest that you make a complete fresh install with MainsailOS

#

Especially as you have there a python3.9 folder that makes me a bit suspicious about your setup

reef belfry
#

new install of MainsailOS with raspberry imager?

wet lynx
#

Yes. Make a backup of your configs ofc first

#

Then you can follow the pinned message.

reef belfry
#

yes, i'll try...thanks

wet lynx
#

After you made a fresh install it can take like 10-20mins until your Pi starts completely. Before that it will reboot some times

reef belfry
#

Hi, after fresh install, i have a new error??

wet lynx
#

Can you please run python -v

reef belfry
#

pi@spider:~/spyglass $ python -v ??

wet lynx
#

It doesn't matter where you run it

#

Just run it and send the output

reef belfry
wet lynx
#

Sry my bad I meant python --version ^^ but that will return python2.7 or something like that

#

Try python3 --version

#

Did you already run sudo apt update && sudo apt upgrade? What else did you already install?

reef belfry
#

python 3.9.2

wet lynx
#

Then it should run with python3 run.py

reef belfry
#

ok, i try...

wet lynx
#

I'm wondering why it uses Python2 for you

wet lynx
reef belfry
#

but not crowsnest...

wet lynx
#

Wait, why did you install mjpgstreamer?

reef belfry
#

in fact, I took over an old clean image (backup)

wet lynx
#

So you didn't use Raspi Imager?

#

Anyways a quick and easy way could be, if you change the first line in the run.py file

#

Just add a 3 at the end of the first line that it's #!/usr/bin/env python3

#

Still weird that it's using python 2 as the default version

reef belfry
#

ok, I'm finishing my upgrade and I'm testing this...

wet lynx
#

And weird that you have it installed as it's deprecated for a few years now and not that many programs are using it anymore

#

I will push a fix to the repository as we just didn't think about someone still having Python2 on their Pi for klipper.

#

Ofc I will wait for your response first if it's working with that line change

wet lynx
#

Does libcamera-hello give you any output?

reef belfry
#

ERROR: the system appears to be configured for the legacy camera stack

wet lynx
reef belfry
wet lynx
#

Can you please run cat /etc/os-release? As this config seems to be of a buster OS image. Maybe you copied it from an old system

#

If you add camera_auto_detect=1 at the end of the file the libcamera-hello command should hopefully work after a reboot.

reef belfry
wet lynx
#

So you copied your buster config I guess

#

or upgraded directly your OS from buster to bullseye

#

That means that some dependencies might not be installed and you have to install them manually. Like libcamera for python.
python3 -m pip install libcamera

#

It would be a lot easier if you would just use a fresh install of MainsailOS and not using an old clean backup that got upgraded.

reef belfry
#

python3 -m pip install libcamera: don't work....

#

ok, i think i'm going to do that tonight... i need to take a break...

wet lynx
#

Ok I researched how to install libcamera for python. You can try it with that https://libcamera.org/getting-started.html but no guarantee that this will work flawlessly. I won't support you through this installation as this would be to time consuming for me and I don't get paid for this ๐Ÿ˜ฆ. So if it doesn't work then you have to install a fresh install of MainsailOS with Raspberry Pi Imager. Don't use an old backup.

reef belfry
#

ok, merci Mr Yel... I'll keep you informed...

wet lynx
#

The python2 problem should now be solved in the repository.
@reef belfry if you want to update the repository on your current version, you have to run the following commands:

cd ~/spyglass
git restore .
git pull
```The `git restore .` command will delete all your changes that you made in the spyglass folder so you can get the new version with `git pull`.
reef belfry
wet lynx
#

You didn't follow the instructions in the pinned message. Delete the camera_auto_detect=0 near the end of your /boot/config.txt and change the camera_auto_detect=1 to start_x=1 near the end of the file

#

raspi-config is a dumb tool and the piece of software that is reading it, is dumb too. That leads to the error of you.

#

This might be fixed in future releases of MainsailOS

reef belfry
#

pi@spider:~/spyglass $ ./run.py -st /?action=stream -sn /?action=snapshot
INFO:root:Spyglass 0.10.3
[0:18:12.963750009] [1744] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+47-0684c373
ERROR:picamera2.picamera2:Camera(s) not found ...

wet lynx
reef belfry
wet lynx
#

But ./run.py isn't working?

reef belfry
#

it's good?

wet lynx
#

yes

reef belfry
#

ok, thanks very much...it's work now!!!

wet lynx
#

@unborn karma If I remember correctly you were someone with a wide camera module right? You used a resolution above 1920x1080 in the last message I remember.
There is a bug in the raspi software atm that limits the resolution to 1920x1920. As the module is a 16:9 sensor, the maximum resolution is 1920x1080. To get the max FOV and highest resolution you have to use 1920x1080 and for the highest FOV something with 16:9 aspect ratio should be good.
Spyglass crashes and gives you an error in the newest version if you try to use any higher resolution.

reef belfry
#

hello to all, here, yesterday I had an image and today at the restart, I have a white screen??
What should I check?

wet lynx
#

Did you install spyglass as a service?

reef belfry
#

I don't know ๐Ÿค” ...

wet lynx
#

If it isn't installed you have to install it, that it's there after a reboot

#

You can read on GitHub how to install it as a service

unborn karma
wet lynx
#

Don't run it on 1080x1920 this should scale the picture down. With this setting it shouldn't crash and maybe you didn't execute git pull yet.
For portrait mode there is another branch actually, called add_exif_rotation. I could try to merge add_exif_rotation and expand_camera_control_ability real quick and send you a version, if you can't do it by yourself.

unborn karma
#

Sorry, this may seem like a stupid question but as I cant look at the branch at the moment i'm not sure, does this simply give the option to rotate the image or does it do what im currently doing but better? I have the camera module facing the normal orientation and im looking for portrait content, not trying to just rotate the normal 1920x1080. Does that make sense? Sorry if not.

wet lynx
#

Yeah, that was my bad sry. It's just rotating, so it wouldn't be of any use for you. But you won't get the max FOV this way, as you are limiting yourself with the smaller side being your height and the bigger side being you width.
The optimal solution for you would be to rotate your camera by 90ยฐ and then use the branch. Otherwise you can't optimize the FOV as it's just cropping and maybe scaling the image to fit the resolution.

unborn karma
#

Yeah, sorry my implementation is pretty bad too, I've just realized I have completely overlooked the even though the sensor has a max resolution of 4608x2592 my pixel selection is not from the center, it will scale until one axis hits the limit, so my 1080x1920 will basically take the full height and about 1/3 of the width of the sensor.

Its clear your suggestion would yield far superior quality! Would you mind attempting to merge those two for me to test out once I have remodeled the mounting solution to rotate my module 90 degrees please? If its a time consuming thing for you, please don't worry about it and I will wait for the release of it.

wet lynx
unborn karma
#

Honestly, don't worry about it if you have more pressing things to get on with ๐Ÿ™‚

#

I really appreciate your help!

wet lynx
#

As I need a tester for this features, it's ok for me.

#

@unborn karma here is the zip (reuploaded in another msg), let me know if it's working.

#

Most of the things were merged automatically, but somehow it failed things, that should have been solved automatically

unborn karma
#

Awesome! Thank you. I will give it a shot at some point tonight or tomorrow and let you know how i get on.

unborn karma
#

To uninstall my current spyglass i just disable and stop the service, cd ~/spyglss and then make uninstall, right? Need me to do anything else before going ahead and putting in the new version you sent and then doing the make install? Any additional cleanup tasks?

Sorry for lack of code formatting on commands here im on mobile.

wet lynx
#

Maybe unzip it in another folder than spyglass that you don't mess up anything and that you can easily switch back without having to override the merged version again

#

This is add_exif_rotation and expand_camera_control_ability merged together for anyone coming across this.
6 is 90ยฐ clockwise and 8 is 270ยฐ clockwise/90ยฐ counter clockwise
There is no folder inside the zip, so be careful where you unzip it.

#

Just reuploaded without my .git folder ^^

unborn karma
#

Shall do, thank you. So just disable and stop current spyglass then make uninstall within ~/spyglass and leave the previously unpacked files in ~/spyglass and then I can put these new files within ~/spyglass2 and then just cd ~/spyglass2 and make install, right? Am I missing anything?

wet lynx
#

Yes, that should be it I guess.

unborn karma
#

Awesome. Thank you.

hoary plaza
#

Hi

First of all, I'm a total Linux/Github beginner so please bear with me.

Yesterday I was happy that since the weekend my camera is finally working again (I only came across Spyglass at the weekend. I set everything up again with Bullseye a while ago), and today I only have a white area with a "defective image" icon .

An ExecStart= process belonging to unit spyglass.service has exited.
The process' exit code is 'exited' and its exit status is 1.
Mar 07 19:20:02 v01 systemd[1]: spyglass.service: Failed with result 'exit-code'.
Subject: Unit failed
Defined By: systemd

Can anybody help me with this? Could it be due to Bullseye updates?

wet lynx
#

Please send the output of ~/spyglass/run.py

hoary plaza
#

Sounds like "no connection" (legacy Cam is disabled!), but I haven't changed anything on the hardware.

INFO:root:Spyglass 0.10.3
[0:27:47.773323737] [2844] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+
ERROR:picamera2.picamera2:Camera(s) not found (Do not forget to disable legacy c
ERROR:picamera2.picamera2:Camera init sequence did not complete.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 242, in __i
self._open_camera()
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 436, in _op
if not self._initialize_camera():
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 400, in _in
raise RuntimeError("Camera(s) not found (Do not forget to disable legacy cam
RuntimeError: Camera(s) not found (Do not forget to disable legacy camera with r

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/v01/spyglass/./run.py", line 6, in <module>
raise SystemExit(main())
File "/home/v01/spyglass/spyglass/cli.py", line 42, in main
picam2 = init_camera(
File "/home/v01/spyglass/spyglass/camera.py", line 15, in init_camera
picam2 = Picamera2()
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 249, in __i
raise RuntimeError("Camera init sequence did not complete.")
RuntimeError: Camera init sequence did not complete.

wet lynx
#

Please send your /boot/config.txt

#

What cam are you using? A camera module v3?

hoary plaza
wet lynx
#

The "finally working again" part threw me off a bit ^^

hoary plaza
wet lynx
#

What Pi are you using and do you have a desktop environment installed?

hoary plaza
wet lynx
#

Any reason why you set the gpu_mem to 16?

#

Set it to gpu_mem=256 like it's default as you have enough memory on your Pi

hoary plaza
wet lynx
#

I'm not yet sure if you need it for the cam.

#

But still, it can only get you more problems than it's useful on a 8GB Pi, unless you are running something on it, that needs like 7.8GB of RAM

#

Anyway, try to increase it and see if it's working

hoary plaza
#

ok wait

hoary plaza
wet lynx
#

Then send the outputs of vcgencmd get_camera and v4l2-ctl --list-devices, also try to run libcamera-hello. I can already assume the output of this commands but I want to be sure first

hoary plaza
# wet lynx Then send the outputs of `vcgencmd get_camera` and `v4l2-ctl --list-devices`, al...

v01@v01:~ $ libcamera-hello
Preview window unavailable
[0:03:59.721339120] [1249] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+ 22-923f5d70
[0:03:59.752440795] [1250] ERROR V4L2 v4l2_device.cpp:352 'imx708': Unable to se t controls: Device or resource busy
[0:03:59.765830240] [1250] INFO RPI raspberrypi.cpp:1476 Registered camera /bas e/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media0 and ISP device /dev/m edia2
[0:03:59.766046702] [1249] INFO Camera camera.cpp:841 Pipeline handler in use b y another process
ERROR: *** failed to acquire camera /base/soc/i2c0mux/i2c@1/imx708@1a ***

wet lynx
#

and ~/spyglass/run.py still says the same as before?

hoary plaza
#

vcgencmd get_camera
supported=0 detected=0, libcamera interfaces=0
๐Ÿค”
v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
/dev/video10
/dev/video11
/dev/video12
/dev/video18
/dev/video31
/dev/media3

bcm2835-isp (platform:bcm2835-isp):
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video20
/dev/video21
/dev/video22
/dev/video23
/dev/media2
/dev/media4

unicam (platform:fe801000.csi):
/dev/video0
/dev/video1
/dev/media0

rpivid (platform:rpivid):
/dev/video19
/dev/media1

#

~/spyglass/run.py
INFO:root:Spyglass 0.10.3
[0:05:18.096048693] [1302] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70
[0:05:18.114016525] [1303] ERROR V4L2 v4l2_device.cpp:352 'imx708': Unable to set controls: Device or resource busy
[0:05:18.126455517] [1303] INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media0 and ISP device /dev/media2
INFO:picamera2.picamera2:Initialization successful.
[0:05:18.129145512] [1302] INFO Camera camera.cpp:841 Pipeline handler in use by another process
ERROR:picamera2.picamera2:Camera init sequence did not complete.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 242, in init
self._open_camera()
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 441, in _open_camera
raise RuntimeError(f"camera.acquire() returned unexpected code: {acq_code}")
RuntimeError: camera.acquire() returned unexpected code: -16

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/v01/spyglass/run.py", line 6, in <module>
raise SystemExit(main())
File "/home/v01/spyglass/spyglass/cli.py", line 42, in main
picam2 = init_camera(
File "/home/v01/spyglass/spyglass/camera.py", line 15, in init_camera
picam2 = Picamera2()
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 249, in init
raise RuntimeError("Camera init sequence did not complete.")
RuntimeError: Camera init sequence did not complete.

wet lynx
#

Please look at your ~/printer_data/config/spyglass.conf and see what url you have set there and compare it to the one you are trying to use for your camera.

wet lynx
hoary plaza
#

Mainsail same

wet lynx
#

Change it to STREAM_URL="/?action=stream"

hoary plaza
wet lynx
#

restart service

hoary plaza
#

lol, that did it! But why? Haven't changed anything since yesterday and it was working... ๐Ÿค” ๐Ÿ˜ตโ€๐Ÿ’ซ

wet lynx
#

Did you install it yesterday?

hoary plaza
#

no Saturday night (german time)

wet lynx
#

Weird then. I thought that you might haven't restarted the service since changing this setting

hoary plaza
wet lynx
#

Shutting it down and starting it again is the same as a restart. Maybe it was the gpu_mem thing then and it was more like bad luck that it wasn't working and then you messed up your config.

#

And not stopping the service after uninstalling might have still run the old config

hoary plaza
#

Comparison of the config. The old one had /webcam/ on the ## line, the new one didn't

wet lynx
hoary plaza
#

but, it works now, so: ๐Ÿฅณ

hoary plaza
#

so thanks a lot for the help

potent iron
#

Hi guys, I have a camera V3 and I can't rotate it physically on my setup. I see you created a branch exif for rotating it in spyglass. Does it work? can I test it? Which one should I test : add_exif_rotation or add_exif_rotation_decoded ?

Secondly, where do I put the command to rotate it 270CW ? On the link of EXIF Tags it say : 8 = Rotate 270 CW

TY

wet lynx
#

Please use add_exif_rotation, the other one is just another dev branch that clarifies what the exif header, we are using there, is exactly doing.
I actually forgot to put the exif rotation into the config on that branch. Atm you have to run it manually to use the argument.
I will look into it to see, if I can change it real quick

#

@potent iron I pushed a commit that it's in the config now. You might have to add it manually into your config ORIENTATION_EXIF="1". Just change the 1 with the value you want

potent iron
#

yes I understand thank you very much. I'll try that tonight and keep you updated.
In my case that would be ORIENTATION_EXIF="8" for a 270CW rotation.

wet lynx
#

Yes

#

If there is anything wrong, like memory leakage or performance problems, let me know. But I don't think there will be that much problems on the pi side, it should be more browser related, if there are any problems. Still let me know if you can find anything wrong

winged kernel
#

Is it normal for Spyglass to absolutely toast my Pi? top reports ffmpeg at 93% CPU, and it hits 65+c normally..

wet lynx
#

93% CPU usage shouldn't be the case, at least not on a Pi4, but I'm getting about the same temps after a while and I think it's something about the encoding on the GPU in a closed case with only passive cooling that is driving them that high.
Are you using the latest version of spyglass? Maybe you are using an old one that still uses the software encoder instead of the hardware encoder. CPU usage is about 15-20% at 1920x1080@10fps on a Pi4. Didn't test that much with higher framerates as 10fps is enough for basic monitoring.

#

I overread the ffmpeg part, make sure your spyglass is updated to the latest version. It looks like you are still on an old one if it uses ffmpeg. But I'm not completely sure if it really used ffmpeg in the early stages, can't remember anymore.

potent iron
#

memory is the same as before too

#

Now that I reposition my camera to the right place, the LED of my printer seem to make the camera flicker. Is there a way to adjust the exposure?

potent iron
#

I solve it by reducing my resolution from 1920x1080 to 1100x1080. At full resolution the camera will flicker when there is too much light, as soon as I close the led bar it stop flickering.

potent iron
#

Edit, later after that, I try to put back it to 1920x1080 and flickering was desapear with the led on (no other changes), seem to be related to something I don't understand.

frigid cliff
#

Hi!! One fast question, the spyglass support one pi camera + one usb camera at same time?

wet lynx
wet lynx
frigid cliff
#

Ok tk

#

I will need to install crowsnest again xp

wet lynx
#

But you need to disable the legacy camera stack after installing crowsnest

frigid cliff
#

Ok ๐Ÿ˜‰

#

I will try in a few hours

#

Tk ๐Ÿ™‚

potent iron
wet lynx
#

Which one do you mean? add_exif_rotation or expand_camera_control_ability?
For both I can't say any date as I haven't that much time atm to test them and expand them to the degree that I would say it's ready to release.

potent iron
#

add_exif_rotation

wet lynx
#

Don't cite me on the following few things. I'm not 100% if everything is right but it should give some information on that problem.
About the flickering, I guess it could be something with the framerate you are choosing. Higher framerates, mean less time to capture light, means lower exposure times.
Artificial light has a frequency that you normally don't see. It means, there is no light for a short amount of time. If you camera is operating on a higher frequency than you light source, it could start to flicker as your camera captures frames when the light is off.

potent iron
#

ok, my setting was 5fps 1080P when flickering. now reduced it to 5fps 720P and all is good. 1080P was taking too much memory maybe.

#

it is just a raspberry 2 zero

wet lynx
# potent iron add_exif_rotation

It depends on, if I can find something on the topic of exif headers and cameras. I'm not really deep into that topic yet as it was more like a spontaneous idea that just worked instantly and is more like a proof of concept and since then I hadn't time to look into it further.

potent iron
#

o no, I had this flickering before trying the add_exif_rotation branch

#

take your time, I was just asking, I'll continue to use this branch during this time because it work well

empty anvil
#

Hey there, so I'm working on a completely new install of mainsail os 1.0.1. After updating all the modules I followed the instructions for the spyglass install for mainsail 1.0.1+, then installed it as a service. I can get the pi cam to display using a separate browser window, but inside of mainsail is just a white screen. Is there something I could have possibly missed/ did wrong? Thanks!

wet lynx
#

Can you send the url you are using in the webcams tab in Mainsail?

empty anvil
#

/webcam/?action=stream

wet lynx
#

And you can see the stream in your browser under http://<ip>:8080/?action=stream?

empty anvil
#

http://<ip>/?action=stream

#

err yeah, the 8080 port is in there as well

wet lynx
#

What type of service are you using inside mainsail? mjpeg-streamer, uv4l,...?

empty anvil
#

Tried both mjpeg-streamer and uv4l. Former gives blank white screen, latter gives white screen with broken img icon

wet lynx
#

If you are using the ip of your browser inside the webcam tab and then use the uv4l service, do you get an image?

#

*the address you are using inside your browser

empty anvil
#

Pasting in the whole url gives same results

wet lynx
#

Ok, that's weird. Just to be sure, send an image of your webcam settings. For me it sounds like everything should work

empty anvil
#

From mainsail?

wet lynx
#

Yes, webcam settings in Mainsail

empty anvil
wet lynx
#

Change the service to uv4l when using the whole url

empty anvil
wet lynx
#

Ok, I don't know what's up with it.
@woven viper can you help? Stream showing in another browser tab but not in Mainsail. Tried both, with /webcam and with the complete url.

empty anvil
#

I always get the fun problems ๐Ÿ˜„

woven viper
#

??? What, who ? Why I am here?

#

Short overview please...

wet lynx
#

Fresh MainsailOS install, spyglass working in separate browser tab but not in mainsail directly

woven viper
#

Special Network setup? Port forwarding or anything like that?

empty anvil
#

Nope. Router all on automatic

#

Had to actually factory reset a few days back for something else, so shouldn't be anything special going on

woven viper
#

What is your hostname set to?

empty anvil
#

for the mainsail install? just mainsail

#

Oh

#

geez

#

I was using the my.mainsail.xyz from a previous install I did

woven viper
#

Its not recommended to use my.mainsail.xyz anymore

empty anvil
#

Well alrighty then, nvm, just user incompetence lol

#

Thanks for the assistance though

woven viper
#

Happens sometimes, all good. Happy Printing happy_printing

frigid cliff
#

the camera at left is the spyglass (raps 3 camera, is working before install the crowsnest) and the right the crowsnest (usb cam)

#

i make sure i put legacy camera disable on conf rasp

#

any clue?

#

well...

#

i dont kown what i have do

#

but...

#

same usb cam video

#

from crowsnest

#

no video from spyglass... what probably mistake im making?

woven viper
#

The No signal screen comes from ustreamer

woven viper
frigid cliff
#

some progress

woven viper
#

You have to put for ex. 8081 for spyglass and port 8080 for crowsnest

frigid cliff
#

config of crown

#

let me check the spy

woven viper
#

Dont use /dev/video0

frigid cliff
woven viper
#

taht will always tell crowsnest to use a "raspicam"

frigid cliff
#

ohhh :S

#

i dont...

#

what will be you sugestion?

woven viper
frigid cliff
#

i use thar id

#

the id i use is from my crownest.log

#

/dev/v4l/by-id/usb-Vimicro_Corp._HBVCAM_FHD_CAMERA-video-index0

#

i will check again the config files...

#

and tk for for help ๐Ÿ™‚ as usual

#

๐Ÿ™‚

woven viper
#

Remember crowsnest <- USB Cam, spyglass <- Raspicam v3

#

Ports have to differ

frigid cliff
#

and

#

from spyglass

#

no lucky...

#

im doing something dumb :S

wet lynx
# frigid cliff

Please send a screenshot of your webcam tab in the settings

frigid cliff
wet lynx
#

change the first one to /webcam4/?action=stream

frigid cliff
#

the rasp (from spyglass is white....)

wet lynx
#

Can you see the stream in another browser tab?

frigid cliff
#

no

#

i can see the stream from my test1 (usbcam)

#

but from rasp

#

the browser just "thinking..." and nothing happens

#

just give me a black screen

wet lynx
#

Then stop the spyglass service and start it with ~/spyglass/run.py

frigid cliff
#

ok

#

done

#

some error

#

it is use by another process?

#

how can i see what process?

#

what a moment...

#

IT IS RUUNINGGGGG

#

what happen?

#

i will restart the voron

#

its working!!!

#

yessss!!!!!

#

TK GUYSSSS

wet lynx
# frigid cliff

You started the process and didn't stop it there, so the service was blocking it ^^
Seems like the service wasn't running if it was working after you started it. Does the stream "survive" a reboot?

frigid cliff
#

yes

#

double check :p

#

tripple check :p

#

tk alรงot to you guys ๐Ÿ™‚

#

@wet lynx and @woven viper

#

๐Ÿ™‚

wet lynx
# woven viper taht will always tell crowsnest to use a "raspicam"

About that one, you already mentioned something in another thread, that your workaround might not work on bullseye.
My usb-webcam sometimes does get on the /dev/video0. I only use it for testing sometimes, does the workaround maybe get "unloaded" after unplugging the webcam or is it really not working on bullseye?

frigid cliff
frigid cliff
#

ok sorry :p

woven viper
woven viper
woven viper
#

For short I will drop the whole mimic in future. Raspicams v1 arent working at all in bullseye properly, they arent produced anymore so, screw it...

spring forge
#

Run ./run.py and i get Traceback (most recent call last):
File "./run.py", line 3, in <module>
from spyglass.cli import main
File "/home/pi/spyglass/spyglass/cli.py", line 10, in <module>
import libcamera
ModuleNotFoundError: No module named 'libcamera'
how can i fix it?

wet lynx
#

What OS version are you using? cat /etc/os-release

wet lynx
spring forge
#

pi@mainsailos:~ $ libcamera-hello
-bash: libcamera-hello: command not found

wet lynx
#

cat /etc/os-release?

spring forge
wet lynx
#

Did you read the pinned message or the prerequisites on GitHub? You need an OS based on bullseye to use spyglass

spring forge
#

where do i read it? ๐Ÿ˜…

wet lynx
wet lynx
# spring forge pi@mainsailos:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster...

Your OS is currently buster (Debian 10) and you need bullseye (Debian 11). That means you need to install a new system on the SD card to use spyglass.
There is also the option to make an upgrade directly in the OS but there seems to be an issue that requires a manual install of libcamera if you upgrade through the OS and that is something you would need to do on your own.
The easiest option would be to install a completely new system, sry for the inconvenience.

spring forge
wet lynx
#

You need a reinstall of your Pi. You could use MainsailOS that got everything important (except spyglass ๐Ÿ˜ฆ) already installed. After you installed MainsailOS make sure you follow the instructions in the pinned message located at the end of the first and beginning of the second message.

spring forge
wet lynx
#

Do you have anything important on it? Backup that with something like WinSCP
Then use RaspberryPiImager and flash MainsailOS onto the SD card of your Pi

#

Use the 32bit Image unless you have a Pi4 with more than 4GB of RAM

spring forge
wet lynx
spring forge
#

just klipper

wet lynx
#

Did you already use it for some prints?

spring forge
wet lynx
#

printer_data should be enough most of the times as there are all your configs, logs and so on.

#

You could also do a full image backup with Win32DiskImager (google for a tutorial) that you can restore everything if you mess something up or forgot anything

spring forge
wet lynx
#

Yes, the newest currently released MainsailOS is based on Debian 11

spring forge
wet lynx
#

sure, np

vivid widget
#

Hello!
I have a problem with my rpicam3. when i write "dtoverlay=vc4-kms-v3d" cam work but klipperscreen stay black after booting.
when i write "dtoverlay=vc4-fkms-v3d" cam dont work but klipperscreen works.

wet lynx
#

Hey all, I think I found my solution, for some reason I have had to add dtparam=i2c_vc_baudrate=50000 into the last [all] section of /boot/config.txt and now my touchscreen works and spyglass is happy.
@vivid widget That was the solution in the end I guess. You can read from the message I responded to upwards and maybe the informations can help you to fix it.
The message jumping of Discord might not work correctly and maybe have to scroll up a bit to find it.

vivid widget
wet lynx
vivid widget
wet lynx
# vivid widget do u speak german?

Yes I do but this server is english only. I could give you german support in private chat but I would prefer this server if it is possible for you even if my english isn't the best.
Didn't see that error yet. Does that appear every time spyglass starts or only occasionally?

wet lynx
#

We "fixed" it in private now. It worked on a fresh install of MainsailOS with dtoverlay=vc4-kms-v3d, the changes described in the pinned messages and without start_x=1 in /boot/config.txt (not sure if it's necessary to remove it).

wet lynx
worthy monolith
#

@vivid widget what screen you have? you need to add dtoverlay= for it as well to make it work if you use vc4-kms-v3d

wet lynx
reef belfry
#

Ok, hi everyone, I want to connect a usb cam in addition to my raspi-m3. I have just read the discussions but it is very difficult to navigate. What is the procedure?
I have a fresh install (mainsailos) I followed the pinned post and my raspi3 is working. I have a crowsnest and spyglass config file.
Thank you for your help

wet lynx
# reef belfry

It's /webcam4/?action=stream and /webcam4/?action=snapshot

reef belfry
#

nothing

wet lynx
#

Send your crowsnest.log

#

What is Flux-MJPEG? Something from Fluidd?

wet lynx
reef belfry
#

yes

wet lynx
#
[crowsnest]
log_path: ~/printer_data/logs/crowsnest.log
log_level: verbose
delete_log: false

[cam 1]
mode: mjpg
port: 8080
device: /dev/video0
resolution: 640x480
max_fps: 15
```That seems to be your current `crowsnest.conf` if the log file is new
#

And seems like it can't find your usbcam

#

Is it a Nozzle cam by any chance?

reef belfry
#

@wet lynx

wet lynx
#

Ok, just wanted to be sure, as there were issues with nozzle cam and the new camera stack.
Can you send your /boot/config.txt?

wet lynx
reef belfry
wet lynx
#

You didn't follow the instructions in the pinned message to setup your MainsailOS.
Delete the two last camera_auto_detect lines

reef belfry
#

my spyglass port is8080 and usbcam 8083

wet lynx
# reef belfry mainsail

This log says something different. Seems like your crowsnest install might be broken then (edit: crowsnest disabled, read 2 messages below)

wet lynx
wet lynx
# reef belfry mainsail

This is an old log, you disabled crowsnest. Re enable it with sudo systemctl enable crowsnest.service and then start it with sudo systemctl start crowsnest.service

#

Didn't look at the date of the log file

reef belfry
#

work well!!!

wet lynx
#

Everything still working after a reboot?

reef belfry
#

Merci beaucoup!! thanks! Grazie mille!

#

just after sudo reboot

reef belfry
chrome mango
#

Question about setting manual focus on the Pi Cam 3:

For some reason when I change AUTO_FOCUS="manual" in spyglass.conf it doesn't change the focus mode of the camera, even after restarting the server. If I pass it in when I start the server it works e.g. python3 ~/spyglass/run.py -af manual but when I try and set the lens position, it doesn't seem to change anything e.g. python3 ~/spyglass/run.py -af manual -l 0.09.

Any help is much appreciated ๐Ÿ™

wet lynx
#

-l 0.09 is focusing pretty far away. Try something bigger. I'm using -l 4.5 on my Ender 5, focusing about the mid of the bed (230x230 bed size)

#

If I remember correctly, the AUTO_FOCUS="manual" worked for me last time I tested it and we didn't change anything. Try with a high focal dist like FOCAL_DIST="20.0" and if the image get's blurry it should work.
That the changes take effect, you have to restart the server each time manually afaik as the direct integration into Mainsail would be more work as it would be beneficial for us for now.

wet lynx
#

It's annoying to do this to set the manual focus distance but I try my best to get the one branch done to support live changing some values, like focal_dist and brightness.

#

It's already working but still needs some improvements.

chrome mango
#

I think that was it. I thought a lower value would focus closer but in reality, it was doing the opposite like you said. ๐Ÿ˜†

Setting a high focus value on server startup seems to be doing the trick. I've got it mounted on a V0.2 so it needs to be focusing quite close.

Good to know about the live changing. Totally fine passing in the values on server start. I'm just happy I have something that works haha. Thanks for the help!

civic ridge
#

Hey all! I set up spyglass to get my camera module 3 working and it was great. But all of a sudden I now get just a black screen. When I try to manually start spyglass I get the following:

INFO:root:Spyglass 0.11.0
[0:08:41.050388165] [1277]  INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70
[0:08:41.177382132] [1283]  INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media0 and ISP device /dev/media1
INFO:picamera2.picamera2:Initialization successful.
INFO:picamera2.picamera2:Camera now open.
[0:08:41.191407874] [1277]  INFO Camera camera.cpp:1028 configuring streams: (0) 640x480-XBGR8888
[0:08:41.191846569] [1283]  INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected unicam format: 2304x1296-pBAA
INFO:picamera2.picamera2:Configuration successful!
INFO:picamera2.picamera2:Camera started
INFO:spyglass:Server listening on 0.0.0.0:8080
INFO:spyglass:Streaming endpoint: /stream
INFO:spyglass:Snapshot endpoint: /snapshot
[0:08:41.845110921] [1283]  INFO V4L2 v4l2_videodevice.cpp:1820 /dev/video0[16:cap]: Zero sequence expected for first frame (got 1)
[0:08:41.845414826] [1283]  INFO V4L2 v4l2_videodevice.cpp:1820 /dev/video1[17:cap]: Zero sequence expected for first frame (got 1)
[0:08:41.846000759] [1289] ERROR IPARPI cam_helper.cpp:217 Embedded data buffer parsing failed
[0:08:41.979135676] [1289] ERROR IPARPI cam_helper.cpp:217 Embedded data buffer parsing failed
[0:08:41.979253956] [1289] ERROR IPARPI cam_helper_imx708.cpp:247 PDAF data in unsupported format```
And it just continues repeating at that point.  Any thoughts?
wet lynx
#

Can you send your /boot/config.txt and maybe run sudo apt update && sudo apt upgrade?
Never saw that type of error. My guess would be an update for the cam drivers that broke something.
Also run libcamera-hello to be sure it's showing the same error.

civic ridge
# wet lynx Can you send your `/boot/config.txt` and maybe run `sudo apt update && sudo apt ...

Here's my boot/config.txt and this is what I get when trying libcamera-hello after stoping the spyglass service pi@v0:~ $ sudo systemctl stop spyglass pi@v0:~ $ libcamera-hello Preview window unavailable [9:27:50.653702220] [24125] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70 [9:27:50.824456857] [24126] INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media2 and ISP device /dev/media0 [9:27:50.826021479] [24125] INFO Camera camera.cpp:1028 configuring streams: (0) 2304x1296-YUV420 [9:27:50.827003970] [24126] INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected unicam format: 2304x1296-pBAA [9:27:51.315075794] [24126] INFO V4L2 v4l2_videodevice.cpp:1820 /dev/video0[13:cap]: Zero sequence expected for first frame (got 1) [9:27:51.315282824] [24126] INFO V4L2 v4l2_videodevice.cpp:1820 /dev/video1[14:cap]: Zero sequence expected for first frame (got 1) [9:27:51.315602613] [24130] ERROR IPARPI cam_helper.cpp:217 Embedded data buffer parsing failed

wet lynx
#

Did you already try the sudo apt update && sudo apt upgrade?

#

Are you using a wide angle camera?

#

What did you do since the camera was working? Installing something new on the Pi or addings some hardware? Just updating? Anything could be helpful right now as we already got some other weird issues with klipperscreen for example.

civic ridge
#

Sorry for delayed responses.

  • I did try upgrading everything.
  • I've tried both wide angle and regular
civic ridge
#

Im not using a screen currently

wet lynx
#

Do you have a second pi or another sd card to try it with a fresh install?
For me it sounds like a corrupt driver or something like that especially if both cameras aren't working anymore. The led plugin doesn't do anything in it's installation script that should affect the camera.
We already got other bugs that got solved with a fresh installation and we didn't find the cause of the problem.

civic ridge
#

Yeah I was thinking about backing up my configs and just starting fresh

wet lynx
#

I haven't done any research to just revert the driver or something like that yet. Maybe I should look into that at some point to make sure it's not any driver problems.

#

I will try your /boot/config.txt now and see if it's maybe one setting in there. Those settings are really weird sometimes

#

Could also be that changing some settings in there in a specific order cause that problem. Or just having them in a wrong order

civic ridge
#

damn, I didn't realize it was that sensitive. I'm wiping my install and starting fresh now

wet lynx
#

Not really "sensitive", the cam is just not that well tested and still pretty new in terms of raspberry pi firmware.

#

The best thing is that you have to disable the old camera stack to use the new camera BUT just change camera_auto_detect=1 and everything is working, new and old camera stack at the same time. At least it looks like that and you can use both cams as long as you have camera_auto_detect=1 and start_x=1 in the config

#

and sudo raspi-config is a really dumb tool messing everything up if you are unlucky

civic ridge
#

Ah, gotcha.

wet lynx
#

Your config is working on my device so it could be a bad update or maybe changing something in the wrong order or something like that

wet lynx
civic ridge
wet lynx
#

Alright ๐Ÿ˜„

queen nexus
#

Got my pi cam 3 working but the service does not automatically start after doing 'make install'. I must start the service anytime the pi reboots. HELP!

woven viper
queen nexus
woven viper
grim flame
#

I have a issue with my spyglass install.

#

it'll work less then 50% of the time

#

its on a pi 4 4GB

queen nexus
# woven viper You could check its state with `sudo systemctl status spyglass.service` ,look fo...

โ— spyglass.service - spyglass - Picamera2 MJPG Streamer
Loaded: loaded (/etc/systemd/system/spyglass.service; enabled; vendor pres>
Active: failed (Result: exit-code) since Sat 2023-04-08 21:20:57 PDT; 19mi>
Docs: https://github.com/roamingthings/spyglass
Process: 1308 ExecStart=/usr/local/bin/spyglass (code=exited, status=1/FAIL>
Main PID: 1308 (code=exited, status=1/FAILURE)
CPU: 228ms

Apr 08 21:20:57 Ender6 systemd[1]: spyglass.service: Scheduled restart job, res>
Apr 08 21:20:57 Ender6 systemd[1]: Stopped spyglass - Picamera2 MJPG Streamer.
Apr 08 21:20:57 Ender6 systemd[1]: spyglass.service: Start request repeated too>
Apr 08 21:20:57 Ender6 systemd[1]: spyglass.service: Failed with result 'exit-c>
Apr 08 21:20:57 Ender6 systemd[1]: Failed to start spyglass - Picamera2 MJPG St>
...skipping...

This is what I get when i type "sudo systemctl status spyglass.service"
It repeats this process over and over and keeps failing

PS: Sorry for the delays. I appreciate your help very much!

GitHub

A simple mjpeg server for Picamera2. Contribute to roamingthings/spyglass development by creating an account on GitHub.

queen nexus
# woven viper You could check its state with `sudo systemctl status spyglass.service` ,look fo...

I also tried to start manually which was successful yesterday, however It is no longer working today
Here is what I got:

Ender6@Ender6:~/spyglass $ ./run.py
INFO:root:Spyglass 0.11.0
[0:01:01.868287943] [1207] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70
[0:01:02.043633829] [1208] INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media2 and ISP device /dev/media0
INFO:picamera2.picamera2:Initialization successful.
INFO:picamera2.picamera2:Camera now open.
[0:01:02.061685495] [1207] INFO Camera camera.cpp:1028 configuring streams: (0) 640x480-XBGR8888
[0:01:02.062603204] [1208] INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 1536x864-SBGGR10_1X10 - Selected unicam format: 1536x864-pBAA
INFO:picamera2.picamera2:Configuration successful!
[0:01:03.164712214] [1208] ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video1[17:cap]: Failed to start streaming: Input/output error
ERROR:picamera2.picamera2:Camera did not start properly.
Traceback (most recent call last):
File "/home/Ender6/spyglass/./run.py", line 6, in <module>
raise SystemExit(main())
File "/home/Ender6/spyglass/spyglass/cli.py", line 56, in main
picam2.start_recording(MJPEGEncoder(), FileOutput(output))
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1508, in start_recording
self.start()
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1031, in start
self.start_()
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1003, in start_
raise RuntimeError("Camera did not start properly.")
RuntimeError: Camera did not start properly.

PS: I am relatively novice with these devices. Please speak to me like a child ๐Ÿ˜„

wet lynx
#

@grim flame Please send the output of ~/spyglass/run.py

unborn karma
#

Would someone know or point me in the right direction for me to educate myself on how autofocus works on the PiCam Module 3's? I'm having my cam AF on the toolhead constantly moving and therefor not getting a consistently focused timelapse output.

#

I can use manual focus but my parts are different print to print and there the focus point is different each time.

wet lynx
#

I didn't find anything on that topic yet. It seems like it's thinking that the toolhead is the important thing in the picture as it's moving and then trying to focus that.
If you have your bed on the z-axis, you could try to position your camera that it doesn't see the toolhead. Maybe that could help.

unborn karma
#

The use case for my timelapse is to also include the toolhead at the moment. I'm trying to figure out this focal point as its not as the notes are stating it is (0.5 for 50cm), as doesnt seem to be. If I can work that out I can make a manual change to the focal point before the print.

wet lynx
#

We just copied the value from the official documentation. Also the values entering there are really counter intuitive and we should write a disclaimer there. 0 is infinite distance. According to the official documentation 0.5 is 50cm. Through my own testing I got 4.5 for ~20cm.

unborn karma
#

Yeah, thats what im getting too. Thank you for clarifying that for me

#

Do you happen to know if I have autofocus set to continuous, is there a way for me to get a read out of the focal reading? Not expecting so but worth a shot to ask

wet lynx
#

Creating a table with some testing and getting an approximate function would be the best case scenario. That you could enter a distance and get the appropriate value for lens-position

wet lynx
unborn karma
#

I need to look into how to control it via the URL, not got to that yet.

grim flame
#

seems like it sees the camera but doesn't want to do anything with it.

wet lynx
#

Are you using klipperscreen by any chance?

grim flame
#

i am

wet lynx
#

It was actually Samuel235 that got this error ^^

grim flame
#

it has to deal with klipperscreen?

unborn karma
#

hold on, i've been asleep since that entire crapstorm!

#

I genuinely can't recall how I fixed it completely

wet lynx
#

I think it was another issue at first. This whole thing was a bit weird ^^

grim flame
#

I'm just quite confused that this has to deal with klipperscreen in the first place lol

wet lynx
#

There was also another issue with an Arducam getting this error relating to a bad driver or something like that.

wet lynx
#

@grim flame Can you send the output of libcamera-hello just to confirm it throws the same error

#

@queen nexus are you using klipperscreen too? Could you send the output of libcamera-hello?

wet lynx
#

@grim flame Can you send your /boot/config.txt?

unborn karma
#

The only thing I can think of is going through all my messages using Discord search to see where it started to work ๐Ÿ™‚

wet lynx
#

So maybe it could be something similar or something completely different

#

As it started to work randomly sometimes ^^

unborn karma
#

Yeah, the randomness of it really got to me at one point. I remember that vividly.

#

I don't suppose there is any documentation on the control utility via URL is there?

wet lynx
unborn karma
#

Is there anything to allow focal distance do you know? Heading over to v4l2 docs now to see if I can see any setting for it

wet lynx
grim flame
wet lynx
# unborn karma Is there anything to allow focal distance do you know? Heading over to v4l2 docs...

I don't think there is something like that.
Here is the part about the lens-position out of the official documentation for picamera2: https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf

The lens position control (use picam2.camera_controls['LensPosition']) gives three values which are the minimum,
maximum and default lens positions. The minimum value defines the furthest focal distance, and the maximum
specifies the closest achieveable focal distance (by taking its reciprocal). The third value gives a "default" value, which
is normally the hyperfocal position of the lens.
The minimum value for the lens position is most commonly 0.0 (meaning infinity). For the maximum, a value of 10.0
would indicate that the closest focal distance is 1 / 10 metres, or 10cm. Default values might often be around 0.5 to 1.0,
implying a hyperfocal distance of approximately 1 to 2m.
In general, users should expect the distance calibrations to be approximate as it will depend on the accuracy of the
tuning and the degree of variation between the userโ€™s module and the module for which the calibration was performed.
#

But I see something at 5.2.5 in the documentation that might be useful

#
The other standard libcamera autofocus controls are also supported, including:
โ€ข "AfRange" - adjust the focal distances that the algorithm searches
โ€ข "AfSpeed" - try to run the autofocus algorithm faster or slower
โ€ข "AfMetering" and "AfWindows" - lets the user change the area of the image used for focus
wet lynx
# grim flame

Can you try dtoverlay=vc4-kms-v3d instead of dtoverlay=vc4-fkms-v3d real quick. I think there were some issues about that setting

unborn karma
#

Want me to grab anything from my current setup at the moment before I run out the house for a few hours?

wet lynx
#

Your /boot/config.txt would be nice ๐Ÿ˜„

grim flame
#

oh and my screen is flipped lol

unborn karma
#

But if you're anything like me, your klipperscreen will break, but hopefully not.

#

oh

#

spoke too soon

#

Is the touch working still?

#

o.O

grim flame
#

yes

wet lynx
#

The flipped screen comes from disabling the flip ^^

#

dtoverlay=vc4-fkms-v3d activates flip, dtoverlay=vc4-kms-v3d doesn't allow it

wet lynx
unborn karma
wet lynx
wet lynx
#

Run systemctl stop spyglass first ^^

wet lynx
#

So it seems like it's working without the dtoverlay=vc4-fkms-v3d. Can you physically rotate the klipperscreen maybe?

#

I have to report that issue with dtoverlay=vc4-fkms-v3d somewhere as it's really annoying

grim flame
#

I can flip it back software wise, that's no problem

wet lynx
#

Use the correct url. Currently is /stream set and not /?action=stream

#

We will change the default in a future release

unborn karma
#

And also, I get nothing on UV4l, mine has to be MJPEG-Streamer

#

no

#

ignore me

#

mine is now working

#

That was not this morning when I accidentally set it to that.

grim flame
#

looks like its working

unborn karma
#

Possibly was before I grabbed the new branch actually.

wet lynx
#

We shouldn't have changed anything on the new branch regarding that. Maybe a software update from something else fixed that

grim flame
#

i get the camera on both UV4l and MJPEG

#

not a issue here

wet lynx
#

That should be normal behaviour except for fluidd iirc

grim flame
#

I regret not getting the wide angle version LOL

wet lynx
wet lynx
#

Anything with aspect ratio 16:9 should be good

unborn karma
#

The wide angle has a further distance of minimal focus, I'm going to get a wide angle to test soon.

grim flame
#

fixed it thank you

#

I don't regret buying the v3 now lmao

#

spoke too soon

wet lynx
#

Die you change the dtoverlay=vc4-kms-v3d back to the other?

grim flame
#

no

wet lynx
#

Could you move your dtoverlay=imx708 below the dtoverlay=vc4-kms-v3d? Maybe it's about the load order or something like that

#

Maybe stopping klipperscreen and then starting spyglass could solve the issue too?

#

It's hard to say what's causing that problem.

grim flame
wet lynx
#

Can you run sudo service KlipperScreen stop and then run ~/spyglass/run.py? This will stop your klipperscreen. I just want to know if it might start without klipperscreen running

grim flame
#

showed the camera on my touchscreen for a few seconds

queen nexus
wet lynx
grim flame
wet lynx
grim flame
#

intresting

wet lynx
#

Change the port with -p 8081 for example

#

~/spyglass/run.py -p 8081

grim flame
#

running, but no signal

wet lynx
wet lynx
grim flame
#

"/webcam/stream" this?

#

"/stream" does the same thing

wet lynx
#

Sry

#

It's /webcam2/stream

#

8080 is /webcam and 8081 is /webcam2, 8082 is /webcam3

grim flame
#

seems like its working

wet lynx
#

What did you change in between your last 2 images?

#

First it didn't work and then it worked somehow

grim flame
#

resolution

wet lynx
#

resolution in the config? That shouldn't matter for the ~/spyglass/run.py command

grim flame
#

i try doing 1080p but once i run "run.py" it goes into 480p

wet lynx
#

you have to change it with -r

#

So command would be ~/spyglass/run.py -r 1920x1080

#

The config file is only for the service starting spyglass automatically

#

Please restart your Pi and see if it's working or not. If it's working every time after 5 reboots. It should be okay.

#

If not we have to try a bit around with the /boot/config.txt

grim flame
#

so the service for spyglass just fails on boot, but if i do it manually it works

wet lynx
#

And we don't know why ๐Ÿ˜„

#

Maybe try this instead of your /boot/config.txt. Make a backup of yours first and then replace it with the one I sent

#

It's basically the /boot/config.txt of Samuel235

#

but changed a bit

grim flame
wet lynx
#

Yes the service runs run.py with the settings set in the config

#

Can you send your config?

grim flame
#

weird

wet lynx
#

Maybe you messed something up there

grim flame
#

?

wet lynx
#

It should be something about the load order

#

No Your spyglass.conf in your ~/printer_data/config folder

grim flame
wet lynx
#

Yes you messed something up ^^
Delete the whitespaces in your resolution config. It should be "1920x1080" and not "1920 x 1080"

#

Reboot afterwards to see if it's working

unborn karma
#

Just out of curiosity, what did you change from mine to the one you posted? I can compare myself so just let me know if there is a lot changed and I'll do a compare on them myself ๐Ÿ™‚

wet lynx
#

It's basically the same, but without the MainsailOS thing and with the 64bit mode

unborn karma
#

Ahh okay, cool, thank you ๐Ÿ™‚

grim flame
#

looks like its working now on boot!

#

all i did was change the port to avoid problems with port 8080

wet lynx
wet lynx
grim flame
#

yes

unborn karma
#

Just a random/side question @wet lynx: How is the merge of Spyglass into Crowsnest looking, think this is on the table or is Spyglass a side project until the functionality gets put into Crowsnest with some other method?

wet lynx
#

I think the last thing to do would be the expand_camera_control_ability branch and the PR with the url parsing. Then it should be good enough to be merged into crowsnest. Atm there is another method on the dev branch using camera-streamer.

#

It's basically the same as spyglass but with webrtc and the url parsing already done

#

But it takes really long to build on a Pi ^^

unborn karma
#

ahh okay, awesome!

unborn karma
#

1 hour into trying to calibrate my focus.... My head is hurting ๐Ÿ˜‚

wet lynx
#

Did you find something or just reading some things about it?

unborn karma
#

I'm just doing it my own way with some consistent text on a card placed at set distanced from the lens and playing with focal_dist until I get the text into the best clarity

#

But im now so confused

#

The close the text, the higher the FOCAL_DIST needed. Why did I assume it was the other way around? o.O

wet lynx
unborn karma
#

Yeah thats fine, I'm just saying I'm surprised that the high the FOCAL_DIST the closer the focus, I must have got confused in my head and not realized it a while ago.

#

I'm getting around 0.56 FOCAL_DIST change per 10mm distance.

#

This is using a PiCam v3.

wet lynx
#

Nice table and ty for sharing mainsail_heart

#

I think it will get more exponential the closer you will get to zero.

#

I will pin it for easier reference in future

wet lynx
#

Please send the whole file

queen nexus
wet lynx
#

Np

#

You said you are using klipperscreen right? Why did you comment out dtoverlay=vc4-kms-v3d?

queen nexus
wet lynx
#

Is your klipperscreen working right now?

queen nexus
#

yes. It stopped working when i installed spyglass.
the screen would only boot to console.
When i go in raspi confic I change the GL drivers to legacy and the screen works again.

#

Also the touch screen wouldnt work.

wet lynx
#

Where can I find the GL driver option in raspi-config?

queen nexus
#

advanced options > A2 GL Driver

wet lynx
#

What Pi version are you using? And what OS version?

queen nexus
#

pi 3b

wet lynx
#

OS version: cat /etc/os-release

queen nexus
#

OS: Debian GNU/Linux 11 (bullseye)
Distro: MainsailOS 1.0.1 (bullseye)

wet lynx
#

Sry that it took that long. Had to search for something first. The pi4 doesn't have this option anymore so I had to search online what exactly it does.

#

Can you send your spyglass.conf real quick?

#

I need you to test something for me.

queen nexus
wet lynx
#

Can you change your resolution to 1920x1080?

queen nexus
#

done, reboot the pi?

wet lynx
#

Yes

queen nexus
#

still a white screen instead of video

wet lynx
#

A white screen?

#

Can you send the output of systemctl status spyglass

queen nexus
#

โ— spyglass.service - spyglass - Picamera2 MJPG Streamer
Loaded: loaded (/etc/systemd/system/spyglass.service; enabled; vendor pres>
Active: failed (Result: exit-code) since Sun 2023-04-09 15:11:47 PDT; 2min>
Docs: https://github.com/roamingthings/spyglass
Process: 1223 ExecStart=/usr/local/bin/spyglass (code=exited, status=1/FAIL>
Main PID: 1223 (code=exited, status=1/FAILURE)
CPU: 222ms

Apr 09 15:11:47 Ender6 systemd[1]: spyglass.service: Scheduled restart job, res>
Apr 09 15:11:47 Ender6 systemd[1]: Stopped spyglass - Picamera2 MJPG Streamer.
Apr 09 15:11:47 Ender6 systemd[1]: spyglass.service: Start request repeated too>
Apr 09 15:11:47 Ender6 systemd[1]: spyglass.service: Failed with result 'exit-c>
Apr 09 15:11:47 Ender6 systemd[1]: Failed to start spyglass - Picamera2 MJPG St>
lines 1-13/13 (END)

wet lynx
#

Then please change your /boot/config.txt. Comment out the first appearance of camera_auto_detect=1 with a #. Then uncomment the last appearance of #camera_auto_detect=1 with deleting the # at the beginning of the line. After that reboot again.

queen nexus
#

the videocore one correct? leave start_x=1 also?

Disable libcamera (interferes with ustreamer, when using raspicams)

#camera_auto_detect=1

Enable VideoCore at boot, needed for Crowsnest (Raspicams and DSI devices).

#camera_auto_detect=1
start_x=1

wet lynx
#

Yes uncomment the videocore one.

queen nexus
#

webcam still disabled

wet lynx
#

Change your stream url in your spyglass.conf to /?action=stream

queen nexus
#

no change

wet lynx
#

and then run systemctl restart spyglass

#

You are using the default settings inside Mainsail right? Can you send a screenshot of you settings just to confirm for me

queen nexus
#

which settings specifically? the webcam ones?

wet lynx
#

Yes

queen nexus
wet lynx
#

Please change it to /webcam/?action=stream

queen nexus
#

no change

#

not sure if this helps, but when i manually do run.py this is what i get.

wet lynx
#

Can you uncomment the dtoverlay=vc4-kms-v3d in your /boot/config.txt and restart your Pi again?

queen nexus
#

no change

wet lynx
#

Then last thing that is different. Add dtparam=i2c_vc_baudrate=50000 below

[all]

## SPI Interface is enabled by default for Input Shaper
## This colides with Hyperpixel Display!
## Hyperpixel Screen uses the same Pin for Backlight.
dtparam=spi=on
``` in your `/boot/config.txt`
queen nexus
#

like this yes?

wet lynx
#

yes

#

and reboot ofc

queen nexus
#

done and no change

wet lynx
#

Then I don't know what's wrong

#

Do you have a second sd card?

queen nexus
#

it was weird,, i was able to start the service manually the other night, but today it wont start

#

I probably do

wet lynx
#

I really hate the raspberry pi sometimes. If you fiddle a bit around it could be that you break your driver or something like that and then you have to reinstall everything

queen nexus
#

Think i should try a clean install?
I could in theory just copy all my configs over correct?

wet lynx
#

After a fresh install follow the steps described in the pinned messages to confirm that your spyglass module is working

queen nexus
#

ok thank you. i will report back. I plan on installing via raspi imager and mainsail OS. after i will do klipperscreen then spyglass.
Is that acceptable.?

native imp
#

Im catching up on this thread here. I got the picam3 not realizing there were issues. been trying all sorts of things over the past couple weeks. The best i got was using libcamera vid to rtsp to vlc. I think i need to start fresh again too

wet lynx
queen nexus
wet lynx
wet lynx
wet lynx
native imp
wet lynx
#

Normally not. Are you using a Bullseye OS?

#

Send your /boot/config.txt real quick. Maybe there is just a wrong setting there.

native imp
#

Yes, it was the latest bullseye 32bit lite os.... i also noticed originally after the fresh install i could not get test jpeg or vid from the cam which led me down the libcamera docs. currently i believe i have spyglass uninstalled.

wet lynx
#

After a fresh install you need to do sudo apt update && sudo apt upgrade

#

Can you run libcamera-hello? If that doesn't work, start over

native imp
#

yea i did that a bunch, which led me to believe something was missing from the lite version. i could not tell you what made it work but it one of the various attempts at me installing things.

#

the libcamera function do work now. ill follow the pinned message and try again

wet lynx
#

Normally you should just install your OS and then run sudo apt update && sudo apt upgrade. Then libcamera-hello should work

native imp
#

Yea thats what i thought. I didnt try it until after using kiauh though. I installed klipperscreen(thinking i may use it one day) and crowsnet(not realizing it wasnt supposed) that may have messed something up

wet lynx
#

It disables camera_auto_detect as it was using the old camera stack

#

At some point in future this shouldn't be the case anymore

native imp
#

[all]
camera_auto_detect=1
camera_auto_detect=1
#camera_auto_detect=1
why are there three, is this correct

wet lynx
#

Before or after reinstall?

native imp
#

its how it stands right now, its not a brand new install as its printing but i was reviewing your pinned message to comment one out

wet lynx
#

Short answer raspi-config is just a really dumb tool.

#

Send your whole /boot/config.txt and I can say if there are any more problems

#

This config is a bit weird sometimes

native imp
#

#dtoverlay=gpio-ir-tx,gpio_pin=18

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

dtparam=audio=on

Automatically load overlays for detected cameras

###camera_auto_detect=1

Automatically load overlays for detected DSI displays

display_auto_detect=1

Enable DRM VC4 V3D driver

dtoverlay=vc4-kms-v3d
max_framebuffers=2

Disable compensation for displays with overscan

disable_overscan=1

[cm4]

Enable host mode on the 2711 built-in XHCI USB controller.

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

otg_mode=1
gpu_mem=256

[all]

[pi4]

Run as fast as firmware / board allows

arm_boost=1
gpu_mem=256

[all]
camera_auto_detect=1
camera_auto_detect=1
#camera_auto_detect=1

[pi3]
gpu_mem=256

[pi0]
gpu_mem=160

wet lynx
#

If this is all, it shouldn't have any problems. Just delete those 3 camera_auto_detect at the bottom and uncomment the one at the top with the triple #

native imp
#

it should be 0 or 1?

wet lynx
#

If it's not working. A fresh install would be the best choice. As the driver likes to break as far as I can tell for now seeing how a fresh install with just the right commands can fix the problems most of the time

wet lynx
#

If you got one with 0 in there. Delete it

native imp
#

ok its set to 1. just your pinned message shows 0 so i wasnt sure

wet lynx
#

Yes it also say to comment that line out.

native imp
#

ahh yes i read that backwards

wet lynx
#

The default MainsailOS /boot/config.txt got the camera_auto_detect setting twice. Once at the top from the deafult config and one time at the bottom to overwrite that. So if you comment out the bottom one the top one comes in effect.

native imp
#

ok it works under uv4l now

unborn karma
queen nexus
#

@wet lynx I just thought of something...
Does spyglass require crowsnest to be installed?

woven viper
wet lynx
#

Did your raspicam work on a fresh installation?

civic ridge
# wet lynx Alright ๐Ÿ˜„

I'm finally back. A fresh install of everything seems to have fixed my issue but now my camera looks weird. Not sure if its related to anything or my cable isn't seated correctly.

wet lynx
#

This looks like really low resolution with really bad color depth. Try to reseat your cable first

#

And I really hate that fresh installation solves everything thingy. I really have to research something for driver reinstallation with some kind of script inside the spyglass repository that everyone can just use that to see if it's a driver issue. But it could be anything at some points.

queen nexus
wet lynx
queen nexus
# wet lynx Sure no stress. Take your time ๐Ÿ˜„

I just tried reinstalling crowsnest.
I now get a black screen that says no signal ๐Ÿ˜„
I enabled the first and last "camera_auto_detect", no change
tried to manually start spyglass, no luck.
I do not know how to change port or what port to try though.

wet lynx
#

If you just reinstalled crowsnest that shouldn't have fix anything

#

You really have to make a fresh install atm

wet lynx
#

We could try something that could break it further or maybe solves everything

#

I would send you my driver for the module v3 and you try to install that. If it's working again afterwards we found the culprit and a solution

#

Maybe I can find a more cleaner solution that would build the driver from scratch

#

@queen nexus please run uname -r that we can see your kernel version

#

and I need your pi verison

#

and output of cat /etc/os-release

woven viper
#

@wet lynx FYI I will ditch start_x and ca=0. Only gpu_mem will be left. With ustreamer 5.38 you dont need that anymore as I found out...

wet lynx
#

Nice ๐Ÿ˜„

wet lynx
#

@queen nexus I might have found a way to just build the correct driver (and a few more) and install it. But this is an advanced topic, could be a bit harder to do remotely and maybe break your OS installation or just do nothing and just waste your time. Easiest option is a fresh install of your OS.

wet lynx
#

The build process on my Pi already runs like 30min+

#

So this will take a while

wet lynx
#

And I would like to see the output of v4l2-ctl --list-devices

queen nexus
wet lynx
#

please read through the pinned messages

queen nexus
queen nexus
# wet lynx please read through the pinned messages

you should make this part show before the instructions to do it via raspi-config ๐Ÿ˜›
On a fresh install of MainsailOS v1.0.1+ you have to change your /boot/config.txt manually. Do not use raspi-config to disable the legacy camera stack!!!

wet lynx
#

My symbols are limited That's why I wrote If you have a fresh install of MainsailOS v1.0.1+, please skip the instruction below.

#

I made it fat now

queen nexus
wet lynx
#

Make sure to delete all the camera_auto_detect except for one in your /boot/config.txt

#

Make the last one camera_auto_detect=1

queen nexus
wet lynx
#

If there are no other camera_auto_detect uncommented it should be correct.

queen nexus
#

same error ๐Ÿ˜ฆ

wet lynx
#

you haven't installed anything related to klipperscreen yet right?

queen nexus
wet lynx
#

libcamera-hello also throws the same error?

queen nexus
wet lynx
#

If you run sudo apt update && sudo apt upgrade from the command line and after that it didn't work too, it should be something hardware related

#

Do you have another ribbon cable or another pi to try the cam?

queen nexus
#

and yeah i do have cables

wet lynx
#

Then try with different cables and on the pi zero 2

queen nexus
#

copy that

woven viper
queen nexus
woven viper
#

Ok, might have overlooked that ๐Ÿ˜‰

queen nexus
scenic crown
#

Hello, can someone help me? Pi Cam 3 on a Pi 3B+. Tried the tutorials, read here, but it doesn't start the service?!

#

I already did deactivate legacy camera in raspi config

#

FYI: I only have a Pi Cam 3.

#

I did the installation like on github and have seen now the pinned thread here... but still doesn't work...

wet lynx
wet lynx
#

I don't think you followed the pinned tutorial right? Please comment the camera_auto_detect=1 with a # near the bottom. Then run sudo apt update && sudo apt upgrade and reboot after that.

wet lynx
#

There should always only be one camera_auto_detect=1 at the same time

scenic crown
#

I tried tutorial from github, tried some things, then tried the sticky post... so yes and no :). Thanks. Did the # at the bottom for camera_auto_detect=1. no updates/upgrades available. reboot.

wet lynx
#

Can you run libcamera-hello?

#

After that shutdown your Pi, and try to reseat every cable. Also make sure that the small connector directly on the pcb of the cam is seated correctly. It also could be that you are unlucky and got one of the bad batch

#

There were already 3 in the past from different countries

scenic crown
#

pi@cerulean stormos:~ $ libcamera-hello
Preview window unavailable
[0:00:38.568114568] [885] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70
ERROR: *** no cameras available ***

#

ok i test cables etc... i have some cables

#

Thanks

wet lynx
#

You got another Pi too?

scenic crown
#

no, only an mks pi but no os and no 24v adapter right now lol

#

ok new cable, same error message. no camera available

#

and another cable and put out the cam of the printed case, checked everything.... it says no camera available

#

so camera module was maybe DOA? or can I check something like in raspi-config menu?

wet lynx
#

The only thing you can check is v4l2-ctl --list-devices but this won't show up the cam too. Your cam doesn't get recognized at all atm. So it could be either a bad camera or a bad pi connector. Maybe you did the impossible and corrupted your OS such that it can't recognize it anymore. So last option to make sure it's not a software problem, you could make a complete fresh install.

#

Like I said, there was already a bad batch in the past. So it could be that you were just unlucky and got one of a bad batch.

scenic crown
#

I am the man for impossible things :). I just reinstall Mainsail on a new SD. Regarding sticked post, I can skip 1-5 for raspi-config?

wet lynx
#

Yes, and then use 1-6 for boot config direct below it

scenic crown
#

Thank you very much!

scenic crown
#

ok, complete fresh install... same... great... wasted half a day...

wet lynx
#

These new v3 cams are just b****** sometimes but if they work they are great ๐Ÿ˜„

scenic crown
#

yes, maybe they send me a new one...

#

which works

dim comet
#

quick question if I do the make install in the spyglass folder to have it run as a service how do I change the settings?

wet lynx
#

Inside Mainsail there should be a spyglass.conf

dim comet
#

nvm found it

#

~/printer_data/config/spyglass.conf

#

and you just start stop it like a regular service

#

I think I am gtg thanks!

vocal island
#

hi ! trying to install spyglass for pi cam v3, it doesn't work but before i continue, can i set multiple cam ? i got a c922 which worked perfectly with a raspicam on crowsnest. just wanted to replace my rpi cam with the v3
edit: cam is detected as unicam and i'm on a pi4b

wet lynx
# vocal island hi ! trying to install spyglass for pi cam v3, it doesn't work but before i cont...

You can use spyglass and crowsnest together. If you just say it doesn't work I can't help sry. I need some more information, like what isn't working for example and what error comes.
Crowsnest doesn't support v3 yet. There is only the develop branch that already got support but that branch isn't officially supported yet. So spyglass is the way to go atm if you want some help with it.
If your module v3 isn't working even when you use ./run.py, I guess there is no camera_auto_detect=1 in your /boot/config.txt. I need your /boot/config.txt to check that. But it could also be just an address in use error as you already have crowsnest installed. Then you should just change your spyglass port to 8081.

vocal island
# wet lynx You can use spyglass and crowsnest together. If you just say it doesn't work I c...

Sorry i wasn't here to ask for help, just to know if i could use my c922 along with the v3, so good news ๐Ÿ™‚ . but for that matter, i stopped messing with it after 5hrs.. it bothered me. When i install spyglass, the output is not "succesfull" but i get a runtime error and kinda tells me to unable legacy cam in raspi config. which i did (for sure i did all the things possible). i noticed that i had 2 ``camera_auto_detect" and saw that i needed just one.
Also it was a fresh mainsail 1.0.1 + crowsnest. so i did the raspi config thing, but i read after that i shouldn't... i don't know if it plays here.

wet lynx
#

Yes it could be totally just the raspi config thing. But the fix is to just delete all the camera_auto_detect lines and have only a single one camera_auto_detect=1 in a [all] section. As I don't have nitro I don't have enough symbols in my messages to add this detail in the pinned messages

vocal island
#

oh ok so that's what i told me.

#

and what i did

wet lynx
#

About the runtime error during installation I'm a bit confused right now as it's just copying files

vocal island
#

i tried to uninstall all (spyglass + crowsnest) multiple times, to get a fresh install, but same..

wet lynx
#

After installing crowsnest make sure to change the camera_auto_detect=0 to camera_auto_detect=1 as crowsnest needed that in the past

#

This will be fixed in the next crowsnest version

vocal island
wet lynx
vocal island
#

but also, i thought that crowsnest and spyglass wasn't compatible, so everytime i uninstalled crowsnest, and it confuses me. but now that you clarify those things, it'll be better

#

ok

wet lynx
#

So crowsnest is just making problems if it's running without being used

vocal island
#

oh i see

#

also, do i need to disconnect the c922 during installation of v3 and spyglass (like for crowsnest+picam) ? and only after intall crownest + c922

wet lynx
#

How exactly are you running the make install? Are you using sudo or something like that maybe? Or a different user than the one with the spyglass installation inside the home directory?

wet lynx
vocal island
wet lynx
#

Sry for repeating myself that often xD

vocal island
#

hahah you have to ๐Ÿ˜„

wet lynx
#

Can you send the output of make install? Maybe I can find the issue?

vocal island
#

i can't right now, i'm printing, but yes for sure ๐Ÿ™‚

#

but make install is fine if i remember correctly

wet lynx
vocal island
#

i must reinstall all the things, and reconnect the V3 ๐Ÿ˜„

#

(and so reboot 1 or 2 times ๐Ÿ˜„ )

wet lynx
#

Spyglass installation should work even without anything attached. Just to be sure, is the error during make install or is it an error you see inside systemctl status spyglass or if you run ./run.py? Maybe I just misunderstood something

vocal island
#

it's when i exec ./run.py

wet lynx
#

Oh, then I really misunderstood something ig ^^

vocal island
#

hahah np

vocal island
wet lynx
#

Yes and no, only if you have it uncommented and are using it with klipperscreen ig. Maybe it's not doing anything on it's own. This whole topic is pretty weird

vocal island
#

it's commented "#" and i'm using klipperscreen

wet lynx
#

Can you send your /boot/config.txt?

vocal island
#

this is my output:

wet lynx
#

This whole klipperscreen thing is pretty weird and sometimes just works after a complete fresh install

wet lynx
# vocal island this is my output:

That error says that the camera is currently used by something else. Maybe in a locked state from a previous run or something like that

#

You currently have to reboot as we don't know the cause of that

vocal island
#

i'm still on the old IRcam, but i have the same output with the V3

#

and i rebooted but same

wet lynx
#

For the IRcam I guess crowsnest is interfering maybe

vocal island
#

even without crowswnest ๐Ÿ˜„ because i tried with all stuff uninstalled

wet lynx
#

Never saw that problem actually ^^

#

You sure it's the device or resource busy error on the v3 too?

vocal island
#

mmmh i'll retry after my print and let you know ๐Ÿ˜„ not sure ahaha

vocal island
#

spyglass.conf is in /config (it was not created before)

wet lynx
#

It get moved there if you run make install. The ./run.py command doesn't use the config

#

Have you run sudo apt update && sudo apt upgrade?

vocal island
#

mmmh it was not the case ๐Ÿ˜„

vocal island
wet lynx
#

Can you send the output of v4l2-ctl --list-devices?

vocal island
#

i think we get to it ๐Ÿ™‚

#

any way to specify a /device to spyglass ?

wet lynx
#

Send the output of libcamera-hello --list-cameras. The other command was the wrong one

vocal island
#

or it automatically take the cam

wet lynx
#

It automatically takes the cam

#

Normally

#

If there is another libcamera device it could actually fail, ig

vocal island
#

ok because as i have 2 one rpi and one usb

wet lynx
#

Send the output of libcamera-hello

#

There is only one libcamera device so it should take the correct one

vocal island
wet lynx
#

./run.py still got the same error as before? If so, it could be really bad ig

#

But it could also be just klipperscreen

#

Can you send your /boot/config.txt?

vocal island
#

not the same

wet lynx
#

Can you send your /boot/config.txt?

wet lynx
vocal island
#

ahahah for me too ...

wet lynx
#

Ok, we try changing your /boot/config.txt first, maybe it's a problem with driver loading order or something like that.
Move

display_lcd_rotate=2
dtoverlay=rpi-ft5406,touchscreen-inverted-x=1,touchscreen-inverted-y=1
```up above the `camera_auto_detect=1` and remove the `start_x=1`
#

and restart after that

#

It could also be an overall problem with the driver for the display and the cam maybe as we already had a lot of trouble with other displays. I always rant about that if there is someone with such a problem.
Most of the times I advice to reinstall as it seems like breaking the v3 driver for the cam sometimes if you do something wrong. So if you got another sd card to try out spyglass on a fresh OS to see if it's a hardware problem or maybe software problem that would already help a lot as there are some cameras out there from a bad batch that just don't work.

vocal island
#

rebooting

vocal island
#

i run.pyagain ?

wet lynx
vocal island
wet lynx
#

systemctl status spyglass

vocal island
wet lynx
#

Is there nothing below that?

vocal island
#

nope

#

just that

wet lynx
#

Just run systemctl disable spyglass && systemctl stop spyglass that will disable the autostart of spyglass and stop the currently running service that tries to restart

#

Then run ./run.py again

vocal island
wet lynx
#

v4l2-ctl --list-devices

vocal island
wet lynx
#

That explains a lot

vocal island
#

oh no /dev/video this time

wet lynx
#

Restart again and see if it's there

vocal island
#

reboot ?

wet lynx
#

yes

vocal island
wet lynx
#

./run.py

#

If you could try a few reboots later to see if the no /dev/video problem happens again would be nice. I would need the output of dmesg then to see what's going on there.

vocal island
wet lynx
#

dmesg
maybe we can find something there

vocal island
#

many many things!

#

oh seeing I2C, i changed it one time, maybe ?

wet lynx
#

Only 2 actually

[   23.527454] bcm2835-isp bcm2835-isp: dma alloc of size 8294400 failed
[   25.612657] cma: cma_alloc: linux,cma: alloc failed, req-size: 912 pages, ret: -12
[   25.614903] cma: cma_alloc: linux,cma: alloc failed, req-size: 912 pages, ret: -12
[   25.620125] cma: cma_alloc: linux,cma: alloc failed, req-size: 2025 pages, ret: -12
```and
```[  315.875159] bcm2835-codec bcm2835-codec: Failed setting ctrl 00990a67, ret -3
[  316.927094] i2c-bcm2835 fe205000.i2c: i2c transfer timed out
[  316.927116] imx708 10-001a: Failed to write reg 0xf003. error = -5
[  316.927124] imx708 10-001a: imx708_start_streaming failed to set common settings
[  316.927160] unicam fe801000.csi: stream on failed in subdev
[  316.929022] unicam fe801000.csi: Runtime PM usage count underflow!
[  318.079106] i2c-bcm2835 fe205000.i2c: i2c transfer timed out
[  318.079125] dw9807 10-000c: I2C write STATUS address fail ret = -110
[  318.079135] dw9807 10-000c: dw9807_ramp I2C failure: -110```
vocal island
#

so I2C related ?

wet lynx
#

Could be but it also could be just a problem with the module itself

vocal island
#

because i think i enabled or unabled it (don't remember) the other day because i saw someone recommended that

wet lynx
#

#dtoverlay=vc4-fkms-v3d
Did you have to comment that line out? Maybe try to change it to the following dtoverlay=vc4-kms-v3d

vocal island
#

i got a voron 2.4 LDO and they recommend to do that because otherwise the screen is flipped out

#

so to turn it i had to do that

#

but yeah i can try

wet lynx
#

Just as a note, most of my suggestions are only guesses as I don't have any touchscreen and didn't look into them yet

vocal island
#

yes :p

#

do i reboot ?

wet lynx
#

Yes, always reboot after changes to that file

vocal island
#

okok just to know if you had other things :p

#

ok so my screen is flipped ๐Ÿ˜„

#

run.pyagain ?

wet lynx
#

Just build it in upsidedown ๐Ÿ˜‰

vocal island
#

hahah

wet lynx
#

It could also be related to touchscreen-inverted-x=1,touchscreen-inverted-y=1

wet lynx
vocal island
#

yeah i'm noob on that, i had not make research on that.

wet lynx
#

I'm noob on that too, don't worry ๐Ÿ˜„
Just thought the names sound like they mirror the screen

vocal island
vocal island
#

oh it's another error ?

wet lynx
#

systemctl status spyglass

vocal island
wet lynx
#

Something is blocking the cam somehow. The only question is what process?

vocal island
#

haha !

#

but there are less errors ๐Ÿ˜„

wet lynx
#

Can you send the output of dmesg

wet lynx
vocal island
#

you agree that i still have crowsnest on !?

wet lynx
#

I think so as it blocked the access to the other camera. You can send the crowsnest.log if you want

vocal island
#

oops i mean, yes i know i have it but it's ok for you ? or do i need to uninstall it ?

wet lynx
#

It's fine normally

vocal island
#

okok

wet lynx
#

Just send the log, maybe crowsnest is just trolling

vocal island
#

log is too old wtf

wet lynx
#

Change the device in crowsnest.conf to /dev/v4l/by-id/usb-046d_C922_Pro_Stream_Webcam_C42658AF-video-index0. The /dev/video0 is reserved for picams before the module v3 as there was needed a workaround.

vocal island
#

last entry is like 7hrs ago

wet lynx
vocal island
#

ah yes thx ! ๐Ÿ˜„

wet lynx
vocal island
#

nope 15:11

wet lynx
#

Then scroll down: Last entry is 14:58

vocal island
#

oh ok discord is trolling ... i can't scroll that much, i was using discord viewer

#

ok so it's fine ๐Ÿ˜„

wet lynx
#

It makes sense to limit that. Showing 131769 lines would be a bit too much ^^

vocal island
#

ahah i don't know, discord got the best features ! haha

wet lynx
#

Crowsnest seems to be fine and not using the v3 but your dmesg shows that something is trying to use it constantly

vocal island
#

i just change the device as you told me btw

#

but dmesg is the same

wet lynx
#

That's good, this way you won't have any trouble on restart if the device order changes somehow

vocal island
#

yeap !

#

i could try rebooting and try again

wet lynx
#

Reboot and look at dmesg again, if it shows the same error we have to find the problem

vocal island
#

Also i tried to install as app with python -m pip install and don't know how to uninstall but i think it's with make uninstallso it's ok

#

i installed libcamera too manually.

wet lynx
#

The installation as an app shouldn't make anything. That is only useful if you want to use it inside your own python program

wet lynx