#Raspberry Camera Module 3 support?
1 messages ยท Page 2 of 1
I don't know. @woven viper do you know anything about the 6.1 or why did you mention it?
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...
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
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
I swapped spyglass to 8086 but didn't work for me
I'll try the spyglass branch
What is the error?
You have to do a bit tinkering to get it working
And we won't give any support on that branch
It's working for me on a fresh Mainsail install.
Started spyglass with port 8081, added the usb cam into the crowsnest.conf and added both cameras in the UI
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?
Yeah they're both installed as a service
Then please try to run ~/spyglass/run.py -p 8081 and send the output
Not sure why it would be detected when it was working before and all I did was install crowsnest
Well I don't know why but I disabled the legacy camera stack when it was never enabled and now it works
Crowsnest enables legacy camera as it's using the legacy camera stack for the old camera modules. But you don't need the legacy stack with USB cams, most of the times, so you can disable it without any negative effect.
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...
@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
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?
spyglass config sry
completely stock, wanted to get it working before I change anything
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
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'.```
journalctl -g spyglass -r after running systemctl would show you the newest entry first, never used journalctl ^^
weird its just some permission denied
show me ls -l /usr/local/bin
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 $ ```
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?
bullseye 64 bit
Ok then try uninstall and send output of git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean```
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.
lol wtf
just did make install again
and bam it magically worked now
but maybe it helped with all the boot config changes
Then you might have used sudo make install or the boot config changes did it.
I think boot config changes did it
Still weird that you got permission errors if the boot config changes were the problem.
yeah idk but happy to have it working
wish there was something more definite that was the issue
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.
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
Interesting. Your friends cams are now working too?
they have returned it too and they are waiting for a new one
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...??
What OS did you install?
Mainsail on klipper
On your Pi. MainsailOS or a Raspberry Pi OS?
cat /etc/os-release
Completely empty?
no, sorry, after reboot is not empty
I will be in 10min on my PC and then I can help you a bit better
That's normal
merci beaucoup... ๐
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
new install of MainsailOS with raspberry imager?
yes, i'll try...thanks
After you made a fresh install it can take like 10-20mins until your Pi starts completely. Before that it will reboot some times
Hi, after fresh install, i have a new error??
Can you please run python -v
pi@spider:~/spyglass $ python -v ??
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?
python 3.9.2
Then it should run with python3 run.py
ok, i try...
I'm wondering why it uses Python2 for you
from python --version or from python3 --version
only the necessary, klipperscreen, mjpgstreamer...
but not crowsnest...
Wait, why did you install mjpgstreamer?
in fact, I took over an old clean image (backup)
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
ok, I'm finishing my upgrade and I'm testing this...
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
I am desperate...
So you didn't use Raspberry Pi Imager?
Does libcamera-hello give you any output?
ERROR: the system appears to be configured for the legacy camera stack
Please send your /boot/config.txt and answer this question
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.
pi@spider:~/spyglass $ pi@spider:~/spyglass $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
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.
python3 -m pip install libcamera: don't work....
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement libcamera
ERROR: No matching distribution found for libcamera
ok, i think i'm going to do that tonight... i need to take a break...
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.
ok, merci Mr Yel... I'll keep you informed...
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`.
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
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 ...
Did you run sudo apt update && sudo apt upgrade and please send the output of libcamera-hello
But ./run.py isn't working?
yes
ok, thanks very much...it's work now!!!
@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.
hello to all, here, yesterday I had an image and today at the restart, I have a white screen??
What should I check?
Did you install spyglass as a service?
I don't know ๐ค ...
Execute sudo systemctl status spyglass.service
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
I have a normal camera module but i run it at 1080x1920 for portrait content. I will throw it back to 1920x1080 if thats going to make it better. But im not getting crashes or anything at the moment. Its more so the depth of field is fairly low on this module for this distance away away from the sensor.
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.
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.
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.
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.
You can wait a longer time for the release ^^
I guess it shouldn't be much work so I will do it real quick.
Honestly, don't worry about it if you have more pressing things to get on with ๐
I really appreciate your help!
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
Awesome! Thank you. I will give it a shot at some point tonight or tomorrow and let you know how i get on.
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.
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 ^^
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?
Yes, that should be it I guess.
Awesome. Thank you.
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?
Please send the output of ~/spyglass/run.py
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.
yes
The "finally working again" part threw me off a bit ^^
going from Cam2 to new cable with cam2 to same cable with cam3 to Spyglass....... xD
What Pi are you using and do you have a desktop environment installed?
4b 8gb and no. Bullseye Lite
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
I read somewhere that you can set it low because the browser on the PC just renders the GUI... Does it have to be higher because of the cam?
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
ok wait
nothing changed
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
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 ***
and ~/spyglass/run.py still says the same as before?
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.
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.
The output of vcgencmd get_camera was expected. It's a weird command
STREAM_URL="/webcam/?action=stream"
Mainsail same
Change it to STREAM_URL="/?action=stream"
full reboot or restart service
restart service
lol, that did it! But why? Haven't changed anything since yesterday and it was working... ๐ค ๐ตโ๐ซ
Did you install it yesterday?
no Saturday night (german time)
Weird then. I thought that you might haven't restarted the service since changing this setting
But in an attempt to fix the problem, I reinstalled Spyglass just before I asked here. And,... my printer is not running 24/7 so start instead of restart
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
Comparison of the config. The old one had /webcam/ on the ## line, the new one didn't
stopped everything
The default doesn't have it, so you might have added it there and then commented it out afterwards
but, it works now, so: ๐ฅณ
maybe ๐ตโ๐ซ . Even getting spyglass to work for the first time was a little bumpy for me as a beginner... I mean, I like digging into things, klipper macros, proxmox, pi-hole... but I'm far from an "experienced user"
so thanks a lot for the help
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
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
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.
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
Is it normal for Spyglass to absolutely toast my Pi? top reports ffmpeg at 93% CPU, and it hits 65+c normally..
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.
just test it, it work perfectly!, thnk you
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?
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.
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.
Hi!! One fast question, the spyglass support one pi camera + one usb camera at same time?
Sure, but for the usb cam you need crowsnest.
@potent iron If you want to try, you can use the zip in the message I responded to. There is the camera control ability branch merged into but you have to make the adjustments of the last commit yourself.
But you need to disable the legacy camera stack after installing crowsnest
Finally find out it was my resolution that was too high causing the flickering. I'm running now for 2 days at 720P resolution with no problems. Using Obico and timelapse with no problem. I only needed to add a rotation command in my moonraker-obico config file to get it rotated too.
Does this brnach will be soon merged in the main branch?
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.
add_exif_rotation
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.
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
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.
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
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!
Can you send the url you are using in the webcams tab in Mainsail?
/webcam/?action=stream
And you can see the stream in your browser under http://<ip>:8080/?action=stream?
What type of service are you using inside mainsail? mjpeg-streamer, uv4l,...?
Tried both mjpeg-streamer and uv4l. Former gives blank white screen, latter gives white screen with broken img icon
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
Pasting in the whole url gives same results
Ok, that's weird. Just to be sure, send an image of your webcam settings. For me it sounds like everything should work
From mainsail?
Yes, webcam settings in Mainsail
Change the service to uv4l when using the whole url
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.
I always get the fun problems ๐
Fresh MainsailOS install, spyglass working in separate browser tab but not in mainsail directly
Special Network setup? Port forwarding or anything like that?
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
What is your hostname set to?
for the mainsail install? just mainsail
Oh
geez
Webcam works now if I open mainsail with "http://mainsail.local"
I was using the my.mainsail.xyz from a previous install I did
Its not recommended to use my.mainsail.xyz anymore
Well alrighty then, nvm, just user incompetence lol
Thanks for the assistance though
Happens sometimes, all good. Happy Printing 
no lucky..
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?
The No signal screen comes from ustreamer
Ports dont differ
some progress
You have to put for ex. 8081 for spyglass and port 8080 for crowsnest
Dont use /dev/video0
taht will always tell crowsnest to use a "raspicam"
Reading carefully crowsnest readme which states:
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
๐
Please send a screenshot of your webcam tab in the settings
change the first one to /webcam4/?action=stream
Can you see the stream in another browser tab?
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
Then stop the spyglass service and start it with ~/spyglass/run.py
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
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?
yes
double check :p
tripple check :p
tk alรงot to you guys ๐
@wet lynx and @woven viper
๐
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?
you are talking with @woven viper or with me?
Me...
ok sorry :p
That is something I will not spend time to anymore because of camera-streamer and spyglass
No problem ๐
Ok, makes sense ^^
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...
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?
What OS version are you using? cat /etc/os-release
Please also run sudo apt update && sudo apt upgrade and libcamera-hello and send the output
pi@mainsailos:~ $ libcamera-hello
-bash: libcamera-hello: command not found
cat /etc/os-release?
pi@mainsailos:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Did you read the pinned message or the prerequisites on GitHub? You need an OS based on bullseye to use spyglass
where do i read it? ๐
Pinned message is above the chat the pin symbole, you can find the prerequisites on the GitHub page https://github.com/roamingthings/spyglass
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.
so i need to reinstall klipper?
im new to this ๐
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.
aa what is the easy way to reinstall my pi?
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
Do i backup all files and maps in /<root>
What do you have installed on this Pi? Did you already use klipper with it or something else?
just klipper
Did you already use it for some prints?
yee i print with it
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
so if i reinstal mainsailos and then i got Debian 11?
Yes, the newest currently released MainsailOS is based on Debian 11
aa ok i will try it tomorrow ๐ thanks for all ๐
sure, np
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.
You are using klipperscreen with the pin header on a touchscreen right? If I remember correct we already got another one with that problem and it seems more like a klipperscreen bug than spyglass as we can't do anything about that.
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.
hello! yes, i use the orginal rpi 7 inch touchscreen
Then try this and maybe it will work
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?
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).
We didn't find the problem for that error, it just worked then somehow.
@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
the orginal rpi 7 inch touchscreen
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
It's /webcam4/?action=stream and /webcam4/?action=snapshot
mainsail
That isn't your current config, is it?
yes
[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?
@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?
If this is your config atm change the 8080 port to something different than your spyglass port
You didn't follow the instructions in the pinned message to setup your MainsailOS.
Delete the two last camera_auto_detect lines
my spyglass port is8080 and usbcam 8083
This log says something different. Seems like your crowsnest install might be broken then (edit: crowsnest disabled, read 2 messages below)
I'm wondering how your cam is working as this config made some trouble in our tests
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
work well!!!
Everything still working after a reboot?
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 ๐
-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.
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.
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!
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?
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.
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
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.
Sorry for delayed responses.
- I did try upgrading everything.
- I've tried both wide angle and regular
The only thing that I did between when it was working and now was install this https://github.com/julianschill/klipper-led_effect
Im not using a screen currently
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.
Yeah I was thinking about backing up my configs and just starting fresh
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
damn, I didn't realize it was that sensitive. I'm wiping my install and starting fresh now
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
Ah, gotcha.
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
Did you already have some time to do it? If so, did it solve your problem?
Sorry! I had to leave time before the setup finished ๐ Iโll be back Monday but will report back here
Alright ๐
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!
Simply run sudo systemctl enable spyglass.service reboot after
I tried this 2x and no success ๐ฆ
I also noticed my klipper screen no longer logs in. Its stuck in Pi's console
You could check its state with sudo systemctl status spyglass.service ,look for vendor preset this should show enabled. For klipperScreen we cant help you, sorry. We ended supporting it due unresponsiveness of its developer. Please use github repo to get help.
I have a issue with my spyglass install.
it'll work less then 50% of the time
its on a pi 4 4GB
โ 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!
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 ๐
@grim flame Please send the output of ~/spyglass/run.py
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.
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.
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.
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.
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
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
I didn't look into that yet. My plan was to read the currently set values and show them on the page that you get after setting a value with url (expand_camera_control_ability branch).
I need to look into how to control it via the URL, not got to that yet.
seems like it sees the camera but doesn't want to do anything with it.
We had some similar issues already somewhere else. I will have to look for it real quick.
I think it occured with the bad batch cameras but I'm not completely sure about that
Are you using klipperscreen by any chance?
i am
It was actually Samuel235 that got this error ^^
it has to deal with klipperscreen?
hold on, i've been asleep since that entire crapstorm!
I genuinely can't recall how I fixed it completely
I think it was another issue at first. This whole thing was a bit weird ^^
I'm just quite confused that this has to deal with klipperscreen in the first place lol
There was also another issue with an Arducam getting this error relating to a bad driver or something like that.
We were also really confused. There are some settings that mess something up with the cam and klipperscreen depends on them
@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?
it does
@grim flame Can you send your /boot/config.txt?
The only thing I can think of is going through all my messages using Discord search to see where it started to work ๐
At first you got an issue with allocating memory. Only libcamera-hello through that error.
So maybe it could be something similar or something completely different
As it started to work randomly sometimes ^^
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?
Not yet. I think it's just something like http://<the-ip>:<port>/brightness=0.1
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
This will change in future as we got an open PR with some better url-parsing.
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
Can you try dtoverlay=vc4-kms-v3d instead of dtoverlay=vc4-fkms-v3d real quick. I think there were some issues about that setting
Want me to grab anything from my current setup at the moment before I run out the house for a few hours?
Your /boot/config.txt would be nice ๐
seems like we're headed in the right direction
oh and my screen is flipped lol
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
yes
The flipped screen comes from disabling the flip ^^
dtoverlay=vc4-fkms-v3d activates flip, dtoverlay=vc4-kms-v3d doesn't allow it
Can you run ~/spyglass/run.py? This output looks like it was working for like 1min and then broke
Ignore the .txt.txt, just grab it and open it in notepad ๐
To be precise on that. You screen isn't flippped anymore
Run systemctl stop spyglass first ^^
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
Use the correct url. Currently is /stream set and not /?action=stream
We will change the default in a future release
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.
looks like its working
Possibly was before I grabbed the new branch actually.
We shouldn't have changed anything on the new branch regarding that. Maybe a software update from something else fixed that
More than likely
That should be normal behaviour except for fluidd iirc
I regret not getting the wide angle version LOL
About that one the AfWindows option looks promising. I don't know if you can change it live or if you have to set it at startup but that could exclude something above a certain height for the autofocus.
Change your resolution
Anything with aspect ratio 16:9 should be good
The wide angle has a further distance of minimal focus, I'm going to get a wide angle to test soon.
Die you change the dtoverlay=vc4-kms-v3d back to the other?
no
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.
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
Here is the libcamera-hello output.
Yes i am using Klipper screen and it had an issue also.
However I got Klipper screen to work again by changing the GL drivers to legacy.
I had this issue when initially setting up klipper screen so I think it is unrelated to the spyglass install.
It's unrelated to the spyglass install but the settings for klipperscreen and camera module v3 hate each other somehow
"OSError address already in use"
How did that work now?!
The address already in use means that port 8080 is blocked by another application right now.
intresting
running, but no signal
And it's more like a guessing game for me as I don't own a klipperscreen device myself. It should be something about load order of the drivers that's causing issues
Are you using the correct url?
This should be right
Sry
It's /webcam2/stream
8080 is /webcam and 8081 is /webcam2, 8082 is /webcam3
seems like its working
What did you change in between your last 2 images?
First it didn't work and then it worked somehow
resolution
resolution in the config? That shouldn't matter for the ~/spyglass/run.py command
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
so the service for spyglass just fails on boot, but if i do it manually it works
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
seems like the spy glass service just fails on boot
its linked to "run.py" right?
Yes the service runs run.py with the settings set in the config
Can you send your config?
weird
Maybe you messed something up there
It should be something about the load order
No Your spyglass.conf in your ~/printer_data/config folder
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
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 ๐
It's basically the same, but without the MainsailOS thing and with the 64bit mode
Ahh okay, cool, thank you ๐
looks like its working now on boot!
all i did was change the port to avoid problems with port 8080
Back to you then. Can you send your /boot/config.txt?
Did you use the /boot/config.txt I sent?
yes
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?
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 ^^
ahh okay, awesome!
1 hour into trying to calibrate my focus.... My head is hurting ๐
Did you find something or just reading some things about it?
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
Like I said earlier. This isn't intuitive and we need to add an disclaimer describing it in more detail
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.
Nice table and ty for sharing 
I think it will get more exponential the closer you will get to zero.
I will pin it for easier reference in future
Sorry, Pretty n00b with this stuff ๐
Np
You said you are using klipperscreen right? Why did you comment out dtoverlay=vc4-kms-v3d?
Cant tell you honestly. Must have done it trying to troubleshoot with things i was finding online.
Should i enable it?
Is your klipperscreen working right now?
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.
Where can I find the GL driver option in raspi-config?
advanced options > A2 GL Driver
What Pi version are you using? And what OS version?
pi 3b
OS version: cat /etc/os-release
OS: Debian GNU/Linux 11 (bullseye)
Distro: MainsailOS 1.0.1 (bullseye)
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
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.
Only way i know how to access it is through mainsail, does that work?
Yes that works
Can you change your resolution to 1920x1080?
done, reboot the pi?
Yes
still a white screen instead of video
โ 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)
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.
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
Yes uncomment the videocore one.
webcam still disabled
Change your stream url in your spyglass.conf to /?action=stream
no change
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
which settings specifically? the webcam ones?
Yes
Please change it to /webcam/?action=stream
ok I expected that but now it should be correctly setup
Can you uncomment the dtoverlay=vc4-kms-v3d in your /boot/config.txt and restart your Pi again?
no change
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`
like this yes?
done and no change
it was weird,, i was able to start the service manually the other night, but today it wont start
I probably do
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
Think i should try a clean install?
I could in theory just copy all my configs over correct?
After a fresh install follow the steps described in the pinned messages to confirm that your spyglass module is working
Yes
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.?
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
Yes, if you are using MainsailOS make sure to read through the pinned messages and follow the steps described there.
edited my post. will do klipperscreen then spyglass. is that order acceptable.?
Normally there aren't issues but with some extra hardware like a touchscreen there can appear some weird problems
Please do spyglass first to ensure that your camera module is working correctly first and then try klipperscreen
If libcamera is working spyglass should work too without problems
no touch screen here but i started with pi os lite then kiauh install of everything with crowsnest(learned it doesnt support v3 yet) ..deleted, tried spyglass and other things. started to question if the lite version was missing some important stuff from the libcamera apps.
Normally not. Are you using a Bullseye OS?
Send your /boot/config.txt real quick. Maybe there is just a wrong setting there.
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.
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
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
Normally you should just install your OS and then run sudo apt update && sudo apt upgrade. Then libcamera-hello should work
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
Crowsnest ist changing one setting in your /boot/config.txt. This causes libcamera to fail
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
[all]
camera_auto_detect=1
camera_auto_detect=1
#camera_auto_detect=1
why are there three, is this correct
Before or after reinstall?
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
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
#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
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 #
it should be 0 or 1?
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
ok its set to 1. just your pinned message shows 0 so i wasnt sure
Yes it also say to comment that line out.
ahh yes i read that backwards
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.
ok it works under uv4l now
No problemo ๐
@wet lynx I just thought of something...
Does spyglass require crowsnest to be installed?
Yes and no... If you only use a raspicam, no if you want to use both variants yes..
After installing crowsnest you have to enable camera_auto_detect in /boot/config.txt again and maybe changing port as crowsnest is blocking 8080.
Did your raspicam work on a fresh installation?
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.
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.
@wet lynx i i have not had time to do it. Too busy with life, work, and a baby ๐ฆ will report back when i find the time.
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.
Only activate one of the camera_auto_detect. Please send your /boot/config.txt that everything is correct.
If you just reinstalled crowsnest that shouldn't have fix anything
You really have to make a fresh install atm
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
@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...
Nice ๐
@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.
And I would like to see the output of v4l2-ctl --list-devices
I have begun a fresh install.
I have installed mainsail OS 32 bit and updated it through the mainsail interface, and copied my configs from the last install over.
I am trying to install spyglass first but am unable to install it for some reason. It could be me.
Can you tell me the next step to take from a fresh mainsail install?
please read through the pinned messages
will do, ty!
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!!!
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
damn i overlooked that lol, should i start a fresh install again or is there an easy work around?
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
correct?
If there are no other camera_auto_detect uncommented it should be correct.
same error ๐ฆ
you haven't installed anything related to klipperscreen yet right?
no, just mainsail os, updated, and copied all the configs i had on the old SD card
libcamera-hello also throws the same error?
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?
i have a pi zero 2 w i can maybe use
and yeah i do have cables
Then try with different cables and on the pi zero 2
copy that
Just FYI MainsailOS 1.0.1 isnt fresh... We are at 1.1.1 (preparing 1.1.2 already...)
I was just quoting what is written in the pinned messages
Ok, might have overlooked that ๐
๐
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...
Please send output of cat /etc/os-release and your /boot/config.txt
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.
There should always only be one camera_auto_detect=1 at the same time
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.
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
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
You got another Pi too?
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?
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.
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?
Yes, and then use 1-6 for boot config direct below it
Thank you very much!
ok, complete fresh install... same... great... wasted half a day...
These new v3 cams are just b****** sometimes but if they work they are great ๐
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?
Inside Mainsail there should be a spyglass.conf
nvm found it
~/printer_data/config/spyglass.conf
and you just start stop it like a regular service
I think I am gtg thanks!
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
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.
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.
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
About the runtime error during installation I'm a bit confused right now as it's just copying files
i tried to uninstall all (spyglass + crowsnest) multiple times, to get a fresh install, but same..
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
oh something comes to me, no issues if i changed the hostname (pi) ?
i'll do it
Normally not, as it's using system variables for that
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
I just wrote something like that inside the pinned messages, as most users aren't using multiple cameras
So crowsnest is just making problems if it's running without being used
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
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?
It doesn't matter. Just make sure that you only have one camera_auto_detect=1 and no camera_auto_detect=0 above or under that
ok !
like it's explain in spyglass
Sry for repeating myself that often xD
hahah you have to ๐
Can you send the output of make install? Maybe I can find the issue?
i can't right now, i'm printing, but yes for sure ๐
but make install is fine if i remember correctly
Shouldn't make any problems during printing ๐ but take your time. Not that it suddenly crashes something somehow
i must reinstall all the things, and reconnect the V3 ๐
(and so reboot 1 or 2 times ๐ )
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
it's when i exec ./run.py
Oh, then I really misunderstood something ig ^^
hahah np
also, i saw that commented #dtoverlay=vc4-fkms-v3d could cause issue, is it right ?
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
it's commented "#" and i'm using klipperscreen
Can you send your /boot/config.txt?
this is my output:
This whole klipperscreen thing is pretty weird and sometimes just works after a complete fresh install
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
i'm still on the old IRcam, but i have the same output with the V3
and i rebooted but same
For the IRcam I guess crowsnest is interfering maybe
even without crowswnest ๐ because i tried with all stuff uninstalled
Never saw that problem actually ^^
You sure it's the device or resource busy error on the v3 too?
mmmh i'll retry after my print and let you know ๐ not sure ahaha
ok here we go again, i remove all webcams, i got only one camera_auto_detect=1 and just try to reinstall spyglass by running ./run.py, and i got this
spyglass.conf is in /config (it was not created before)
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?
mmmh it was not the case ๐
yes when i tried before
Can you send the output of v4l2-ctl --list-devices?
Send the output of libcamera-hello --list-cameras. The other command was the wrong one
or it automatically take the cam
It automatically takes the cam
Normally
If there is another libcamera device it could actually fail, ig
Send the output of libcamera-hello
There is only one libcamera device so it should take the correct one
./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?
Can you send your /boot/config.txt?
That's all pretty weird right now for me ^^
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.
rebooting
yeap could try
i run.pyagain ?
Yes
systemctl status spyglass
Is there nothing below that?
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
v4l2-ctl --list-devices
That explains a lot
oh no /dev/video this time
Restart again and see if it's there
reboot ?
yes
./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.
dmesg
maybe we can find something there
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```
so I2C related ?
Could be but it also could be just a problem with the module itself
because i think i enabled or unabled it (don't remember) the other day because i saw someone recommended that
Maybe this is changing somewhere else as in /boot/config.txt as that seems to be fine
#dtoverlay=vc4-fkms-v3d
Did you have to comment that line out? Maybe try to change it to the following dtoverlay=vc4-kms-v3d
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
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
Yes, always reboot after changes to that file
okok just to know if you had other things :p
ok so my screen is flipped ๐
run.pyagain ?
Just build it in upsidedown ๐
hahah
It could also be related to touchscreen-inverted-x=1,touchscreen-inverted-y=1
Yes
yeah i'm noob on that, i had not make research on that.
I'm noob on that too, don't worry ๐
Just thought the names sound like they mirror the screen
yeah it sounds like it for me too ๐
oh it's another error ?
systemctl status spyglass
Something is blocking the cam somehow. The only question is what process?
Can you send the output of dmesg
Yeah I think we get into the right direction
you agree that i still have crowsnest on !?
I think so as it blocked the access to the other camera. You can send the crowsnest.log if you want
oops i mean, yes i know i have it but it's ok for you ? or do i need to uninstall it ?
It's fine normally
okok
Just send the log, maybe crowsnest is just trolling
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.
last entry is like 7hrs ago
You can change delete_log: false to delete_log: true then the log get's a lot shorter ^^
ah yes thx ! ๐
So it's 22:11p.m. at your location?
nope 15:11
Then scroll down: Last entry is 14:58
oh ok discord is trolling ... i can't scroll that much, i was using discord viewer
ok so it's fine ๐
It makes sense to limit that. Showing 131769 lines would be a bit too much ^^
ahah i don't know, discord got the best features ! haha
Crowsnest seems to be fine and not using the v3 but your dmesg shows that something is trying to use it constantly
That's good, this way you won't have any trouble on restart if the device order changes somehow
Reboot and look at dmesg again, if it shows the same error we have to find the problem
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.
The installation as an app shouldn't make anything. That is only useful if you want to use it inside your own python program
that could be a problem actually