Low Power with External Trigger

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.

Thanks. Understood regarding Erase Drive. That’s how I recovered from erroneously changing main.py to an endless disconnecting loop.

For some reason, after having erased the drive, I have a very green image now.

Can you print out the board info from pyb and check that it matches your camera version?

Here’s what appears to be one full dump:
(213 lines all free)
37c00: …
None
29.0014
ID=40002a00:0c513031:38383832
DEVID=0x0450
REVID=0x2003
S=480000000
H=240000000
P1=120000000
P2=120000000
_etext=81f5834
_sidata=81f583c
_sdata=30000000
_edata=30000458
_sbss=30000458
_ebss=300028b8
_sstack=0
_estack=10000
_ram_start=30000000
_heap_start=300028b8
_heap_end=3003bcb8
_ram_end=3003c000
qstr:
n_pool=1
n_qstr=1
n_str_data_bytes=7
n_total_bytes=103
GC:
229056 total
9392 : 219664
1=225 2=156 m=21
LFS free: 111616 bytes
GC memory layout; from 30003df0:
00000: h=hhhh=ShThhhBShTh=h====================h=Lhh=h=h=h=h=h=h=h=h=h=
00400: h=h=h=h=h==========h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h=h
00800: =======h=====h=h=h=h=h=h=h=h=h=h=h=h=h===Lhh=Lhh=Lhh=Lhh=Lhh=Lhh
00c00: =Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh
01000: =Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh
01400: =Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh
01800: =Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh
01c00: =Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh
02000: =Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh=Lhh
02400: =Lhh=Lhh=Lh…
(213 lines all free)
37c00: …
None
29.0603

What attribute do I need to look at to ensure its version matches the camera?

For whatever it’s worth, helloworld gave a good image before I erased the disk with 3.3V on pin 9.

Seems I have hit the limit of three responses to one post as a new member and may not be able to reply to your subsequent responses.

At limit on post so editing previous response with requested info:
omv.arch(): OMV4 H7 1024
picture of camera front attached

Hi, give me this method: omv — OpenMV Cam Information — MicroPython 1.15 documentation

And then also a picture of your camera. The issue you are having could be that you have H7 firmware on an H7 Plus.

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:

  1. Boot up the camera
  2. Put camera to sleep
  3. Detect external trigger signal on a GPIO pin and wake camera up
  4. Run a script and transmit serial data via the camera’s USB port
  5. 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

Hi, you have the wrong firmware on the board.

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.)

Yeah, so, when you sleep the camera it can’t talk to the IDE.

The IDE polls the camera and when the camera doesn’t respond it disconnects.

Your script literally controls the e camera completely. It’s not like a Linux system. What you ask the camera to do it does.

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…

Blink the main LED?