So, your script has control over the camera. Once you load it onto the camera it controls the camera.
So, when your script puts the camera into low power USB is lost. I.e. you need to be 100% right on your script code. Otherwise, it’s basically impossible to change it.
However, when the camera is booting you can use the IDE bootloader to erase the script on the camera. See Tools->Erase Drive and then run that and then plug the camera into your PC. The IDE can then reset the camera back to normal.
Not sure if you saw the output of omv.arch() and the picture I added to my last response.
To work around the (green) color issue, better for line detection anyway, I’m using grayscale (vs any color format). Which, puts me back on track to figure out how to sleep and wake the camera.
At a high-level, the steps I’m trying to execute are:
Boot up the camera
Put camera to sleep
Detect external trigger signal on a GPIO pin and wake camera up
Run a script and transmit serial data via the camera’s USB port
Put camera back to sleep and wait for the next GPIO external trigger
Starting from iabdalkader’s code from Jan '21 (above), I’m having trouble figuring if things are working properly. I don’t know if it’s because the IDE disconnects, if I’m hitting a time-out, or something else.
The camera takes a picture, seems to go to sleep and disconnects from the IDE. Far as I can tell the camera does not wake-up with the external trigger high (3.3V). There is only an initial (before sleeping) picture and no subsequent images taken with the external trigger.
The camera is not available for the IDE to reconnect and it will only reconnect after the camera is Reset (causing the OS error on improperly ejecting the disk).
Sorry for the pedestrian question, but I can’t quite tell what behavior to expect between the camera and IDE.
Thanks ever so kindly for the help. It’s a really nice product and can’t wait to sort this rudimentary stuff out.
Luis
Arch should have said H7 Plus. Not H7. The two MCUs board designs are very similar. But, basically the camera bus is misconfigured and SDRAM is not enabled.
To fix this unconnected the camera from the PC. Click the connect button and say that the board is bricked. Then select the H7 Plus from the firmware list. After you do that plug the camera in the right firmware will be loaded.
…
Sorry for the late response. I didn’t see the arch note.
Thanks. Arch now reports “OMV4P H7 32768 SDRAM” and the color issue is resolved. Woohoo!
I tried iabdalkader’s script (above, with the correct firmware) and still experience the same general behavior as previously described (e.g., takes one picture, goes to sleep, disconnects from the IDE and the camera will not reconnect until Reset). Any insight on what be going on?
(No worries. I totally appreciate the help. The system does not update the thread date and time when someone edits an existing post. Unless you checked manually, you had no way to know I added context. The delayed communications were strictly due the inability of a new forum user to post more than three messages to an existing discussion. The forum’s application logic recently promoted my status so I am no longer a completely new user.)
Got it. I understand why the IDE disconnects. What I’m still trying to figure out is how to tell if the camera wakes up with the GPIO signal.
Guess first step is to save something/anything to a file before going to sleep, and then look at the file details to evaluate when it was written.
It occurred to me, if the script is running in the IDE and not as main.py on the camera, of course it will not wake up - it doesn’t know to look for the signal. The last time I loaded a test script as main.py, something was wrong in the code and the camera was caught in an endless loop disconnecting.
Still chipping away at how to tell if the camera wakes up and does something with the IDE disconnected…