I am working on a Raspberry Pi based face-recognition/photo-capture system.
Workflow:
Canon EOS 200D DSLR connects to Raspberry Pi over Wi-Fi.
Raspberry Pi runs a Flask application.
Python uses
gphoto2to detect the camera and perform tethered capture.The project was working previously, but after restarting the Raspberry Pi and reconnecting the camera, the connection is no longer functioning correctly.
My goal is to make this run automatically when the Raspberry Pi boots, without any manual intervention.I tried creating a systemd service and also a startup script. However, when the Pi starts, the camera shows "Searching for access point" and the tethering does not start correctly. It seems like the camera is not fully connected when gphoto2 starts. If I run the command manually later, it works. I dont want to connect it through USB port. I want a direct connection.
Questions:
1. How can I make gphoto2 start automatically only after the camera's Wi-Fi connection is ready?
Any examples using systemd, bash scripts, or other approaches would be appreciated.