Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to restart crowsnest service every time for camera to show #117

Closed
cpasoft opened this issue May 25, 2023 · 37 comments
Closed

Need to restart crowsnest service every time for camera to show #117

cpasoft opened this issue May 25, 2023 · 37 comments
Assignees
Labels
bug Something isn't working

Comments

@cpasoft
Copy link

cpasoft commented May 25, 2023

What happened

On boot, the camera is not working (black screen with FPS:00).
Go to services control, stop, start and working...

I've uploaded the log.
Version: v4.0.2-0-gb0c011b
crowsnest_fail on boot.log

Downgrade to 3.0.7.3 is working well, here is the log.
crowsnest_version v3.0.7-3-g20ed6a8.log

@KwadFan upload a test branch with a sleep in the init stream, but still not working.
Here is the log:
at boot _ not working.txt

But again, if I stop and re-run the service, then It starts working. Here is the log:
stop & start _ working.txt

comparing the two, there is a line that only appears in the boot, when it does not work.
This line is:
[05/25/23 22:01:14] crowsnest: DEBUG: ustreamer [cam 1]: [warn] getaddrinfo: address family for nodename not supported

Don't know if this is important or not...

What did you expect to happen

Working right away on boot

How to reproduce

Additional information

No response

@cpasoft cpasoft added the bug Something isn't working label May 25, 2023
@KwadFan KwadFan self-assigned this May 26, 2023
@LoganMD
Copy link

LoganMD commented May 27, 2023

Second, my camera doesn't work anymore

@meteyou
Copy link
Member

meteyou commented May 28, 2023

@LoganMD did you read any announcements or other issues?

@Senthiele
Copy link

i third my cam is down now

@DomiStyle

This comment was marked as outdated.

@cpasoft
Copy link
Author

cpasoft commented Jun 4, 2023

I confirm that the workaround of adding a pause at startup has worked...
Thanks @DomiStyle

Working with CrowsNest 4.0.2-2-g8b54eae

@cpasoft
Copy link
Author

cpasoft commented Jun 4, 2023

@KwadFan , what do you want to do with this issue??...

@KwadFan
Copy link
Member

KwadFan commented Jun 4, 2023

Currently working on a rewrite of some crucial parts. So, please be patient will take that into account.

Regards Kwad

@cpasoft
Copy link
Author

cpasoft commented Jun 4, 2023

Thank you Kwad... Let us know if you need help with a test or something...

Regards.

@komandrik
Copy link

I have the same problem. Do I need to add a pause, or is it better to wait for a fix?

@gerbenvandekraats
Copy link

Some issue, workaround fixed it for now :)

@mryel00
Copy link
Member

mryel00 commented Oct 27, 2023

Could it be that you are all using Ubuntu as your OS? Just realized this after #192

@mryel00
Copy link
Member

mryel00 commented Nov 7, 2023

@lin-ycv and everyone else having this issue. What image did you use? I'm trying to reproduce this but it seems like it might be connected to an old Linux kernel 4.9.191 or the specific LTS version of 20.04.6.
I currently have 3 logs about this issue. All 3 of them have those two versions I mentioned.
So I would really appreciate if someone could link me to that image or maybe some people could give me some more logs to get more data on this issue.
If I cannot reproduce it, I won't be able to fix it. As the only option of fixing this, without further information, is to just add a sleep for every Ubuntu user, therefore I most likely will not add such a delay for now.

@mryel00
Copy link
Member

mryel00 commented Nov 7, 2023

Or could it be that you are all using the Flsun SpeederPad?
Edit: If it's a Flsun SpeederPad, could it be that you've got a webcam.txt in your ~/printer_data/config folder too? If you got that file, try to delete that file and see if it might be the reason for this issue.

@lin-ycv
Copy link

lin-ycv commented Nov 7, 2023

I'm on speederpad. I'm away from the printers for a week, will check for webcam.txt when I'm back in the shop.

@mryel00
Copy link
Member

mryel00 commented Nov 7, 2023

I'm on speederpad.

That confirms my first assumption😄

I'm away from the printers for a week, will check for webcam.txt when I'm back in the shop.

Also I just got new infos, You might have to look under ~/klipper_config. So have a look at both folders please.
Looking forward to your answer 😄

@cpasoft
Copy link
Author

cpasoft commented Nov 7, 2023

I am also on the speeder pad, but there is not a webcam.txt under config path.
The linux version is 20.04.6 LTS and kernel 4.9.191.

imagen

@mryel00
Copy link
Member

mryel00 commented Nov 7, 2023

@cpasoft Have you already tried to run it on a different port than 8080? Please try out 8089 if possible and have a look at your log, if the same issue appears. Ofc without the fix within the service file.
If the error then still appears, it's about the startup behaviour of crowsnest and the SpeederPad and I will add a sleep specifically for SpeederPads in the service file. This fix would only apply for new installations and I would like to avoid this one.
If it doesn't appear then anymore, then there might be still something else blocking it at startup.

@cpasoft
Copy link
Author

cpasoft commented Nov 7, 2023

For sure, I'll test this... Let me 15 minutes...

@cpasoft
Copy link
Author

cpasoft commented Nov 7, 2023

@cpasoft Have you already tried to run it on a different port than 8080? Please try out 8089 if possible and have a look at your log, if the same issue appears. Ofc without the fix within the service file. If the error then still appears, it's about the startup behaviour of crowsnest and the SpeederPad and I will add a sleep specifically for SpeederPads in the service file. This fix would only apply for new installations and I would like to avoid this one. If it doesn't appear then anymore, then there might be still something else blocking it at startup.

Same behaviour on port 8089...
Here is the log...
crowsnest.log

If you want me to try/test anything else, just let me know.

@mryel00
Copy link
Member

mryel00 commented Nov 7, 2023

Ok, thank you for the quick test.
Then I will add the sleep inside the service file for the SpeederPad. Like written above, this will only fix it for fresh installations, but you can manually copy the service file to the directory or just reinstall crowsnest as soon as this will be implemented.

@cpasoft
Copy link
Author

cpasoft commented Nov 8, 2023

Thanks, this workaround has worked well for me for a while, so I think it is a good solution.
I'd like to know what's causing this, as it worked perfectly with previous versions, but who knows?

@mryel00

This comment was marked as outdated.

@cpasoft
Copy link
Author

cpasoft commented Nov 11, 2023

@cpasoft As you already asked for it I would kindly ask you to test a specific change for me.

For sure, let me 15 minutes and I'll let you know how it works

@cpasoft

This comment was marked as outdated.

@mryel00
Copy link
Member

mryel00 commented Nov 11, 2023

I should have tested it before sending 😅
I'm not really a bash dev, so I'm very thankful for debugging and fixing it ❤️
What about the startup time? Is 60 fine or should I raise it? I don't know how fast the SpeederPad is, but I would assume 60s should be enough?

@cpasoft
Copy link
Author

cpasoft commented Nov 11, 2023

No problem. I like to be helpful.

I think this value is perfect. I've tested several times and work well.

@mryel00
Copy link
Member

mryel00 commented Nov 11, 2023

Just to be sure that there is no misunderstanding 😅
So 60 works well or 160?

@cpasoft
Copy link
Author

cpasoft commented Nov 11, 2023

60 is fine, sorry...
You could put 100 if you want to feel more confident.

@mryel00
Copy link
Member

mryel00 commented Nov 11, 2023

To give some explanation for that PR and how to correctly use it.
After the PR will be merged into the master branch with the next update (v4.1.0), there will be a new shell parameter. That shell parameter can be used inside the environment file ~/printer_data/systemd/crowsnest.env.
Just add -s at the end of the file. It should then look similar to:
CROWSNEST_ARGS="-c /home/pi/printer_data/config/crowsnest.conf -s"
Make sure it's before the last ".
This will add a 5s delay to the crowsnest start, but only at the intial boot of the SpeederPad/Linux device. You can also increase/decrease the sleep timer by adding a number behind the -s, e.g.:
CROWSNEST_ARGS="-c /home/pi/printer_data/config/crowsnest.conf -s 10"
After adding that parameter, you can remove the ExecStartPre=/bin/sleep 5 from your service file at /etc/systemd/system/crowsnest.service.

P.S. If it's shown as merged, it's not released. Wait until you see an update in your update manager. This issue should get automatically closed at that time too.

@mryel00
Copy link
Member

mryel00 commented Nov 15, 2023

This parameter is now integrated with v4.1.0. This will be automatically added on new installations.

@gralves2

This comment was marked as outdated.

@mryel00

This comment was marked as outdated.

@brdi

This comment was marked as resolved.

@mryel00

This comment was marked as resolved.

@brdi

This comment was marked as resolved.

@shubenets

This comment was marked as off-topic.

@mryel00

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests