I’m trying to run our old (and still working on our previous camera) code on a second unit, and I get the “Sensor control failed” popup on sensor.set_hmirror(True) (right after a set_transpose(True) which seems to work fine). It’s an H7 with the MT9M114 sensor. Unfortunately I can’t access the other (working) camera to check the sensor but it should be an H7 too.
That control should definitely work. What firmware are you on?
Latest, 4.3.2. Just tested the code on another H7 with the same sensor and I get the same error.
For context we’re doing some __write_regs before that, I guess that could differ between sensors?
This works on my H7 with the MT9M114 and firmware 4.3.2
# Sensor Horizontal Mirror Example
#
# This example shows off horizontally mirroring the image in hardware
# from the camera sensor.
import sensor, image, time
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000) # Wait for settings take effect.
clock = time.clock() # Create a clock object to track the FPS.
# Change this to False to undo the mirror.
sensor.set_hmirror(True)
while(True):
clock.tick() # Update the FPS clock.
img = sensor.snapshot() # Take a picture and return the image.
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
# to the IDE. The FPS should increase once disconnected.
That was indeed the issue - sorry for wasting your time!
Hello, I implement your proposal in Portenta H7 + Portenta Vision shield LoRa with a little changes:
# Untitled - By: oravl - mié. abr. 26 2023
# Sensor Horizontal Mirror Example
#
# This example shows off horizontally mirroring the image in hardware
# from the camera sensor.
import sensor, image, time
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.B320X320 ) # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000) # Wait for settings take effect.
clock = time.clock() # Create a clock object to track the FPS.
# Change this to False to undo the mirror.
sensor.set_hmirror(True)
while(True):
clock.tick() # Update the FPS clock.
img = sensor.snapshot() # Take a picture and return the image.
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
But the error “RuntimeError: Sensor control failed” is not resolved, can you help me?, please. I’m a beginner
That’s because the physical connection of the system isn’t locked tight. Alternatively, the camera is damaged.
There was an issue with the first batch of these boards where the sensor has a metal back plate that can short to the PCB. I don’t know if Arduino resolved this issue.
I checked the connection, but the new error is “RuntimeError: Frame capture has timed out”. I tried to adjust the parameter time, but i couldn’t resolved it.
Thanks for your help!
Hi, this is a hardware issue. If you can’t determine that anything is loose… then the unit is damaged and you need to contact Arduino.
Please look for burn marks on the back of the camera module. This will let you know if there was a short.