Using USB camera after reboot

Hi,

I want to do a deep learning project with the jetson. At the moment I need to collect as mutch image date as possible, which is why I wrote a programm to film things, which is activated with a button connected with the GPIOs. The programm is working fine, the problem is, that I want to film things in a production environment and so I don’t have to be there all the time, I want the program to start automaticly when the jetson boots, then the workers in the production can film things via the button. To realize that I use crontab @ reboot. That runs the programm, but somehow, when I start the program automaticly the jetson can’t read the images from my usb camera. When I then run the program in the terminal it works fine, even though I didn’t change anything. My first thought was that the camera is not initiated, but when I use the sleep function to wait a minute after reboot, the problem stays the same.

Does somebody has a idea how to solve this?

Do you mean using a GPIO to trigger a program and this program would capture the usb cam ?
What is the error you hit on camera when you use the program?

The program is running all the time (at least it should) and the button should start and stop the video, captured by the usb cam.
Because I use crontab to start the program at reboot, I don’t get an error. But the program writes empty video files, like it does when no camera is connected.
When I run the program from Terminal, it works fine.

Because I use crontab to start the program at reboot, I don’t get an error.

Not sure why crontab is mentioned here. I don’t think it is related. Is there any difference between running it through crontab and from terminal?

Do you see any error log in dmesg after you trigger the start in both successful and failed case?

And it would be better if you could share the program you are using and how you implement.

Yes, in terminal its running perfectly and doing exactly what its supposed to do.
Only when I let the program run at restart (via crontab) I get the problem.
In successful cases I don’t get an error message, and when I run it from crontab at reboot (the only case where the problem appears) I don’t see error messages, because there is no open terminal.

Hi,

when I run it from crontab at reboot (the only case where the problem appears) I don’t see error messages, because there is no open terminal.

I was asking the kernel log but not the log on your terminal. If your program has any problem opening the camera, the syslog or dmesg should show the error. It does not matter whether you open a terminal or not.

If it does not give out any log, then maybe you should share the code of your program. Actually, current information here is almost none. We only know you use crontab to run a program.