Can not detect the camera sensor connection/disconnection. (reason: The initialization functions for have no return type for error handling)
Hi @DevomechSolutions ,
May I know if you want to detect the connection of camera sensor during initialization or during runtime streaming? We do have API to check the camera sensor connection status at the start of video opening. Thanks.
We want the detection of the camera sensor during initialization.
Hi @DevomechSolutions ,
Thanks for the clarification. If the camera sensor is not connected properly during initialization, video opening process will be failed and the following error logs will be shown
[video_pre_init_procedure] START
hal_voe_send2voe too long 37899 cmd 0x00000206 p1 0x00000000 p2 0x00000000
VOE command 0x206 fail ret 0xff
VOE_OPEN_CMD command fail 98400400
hal_video_open fail ret=98400400, group=3
hal_voe_ready 0x0 0x1718
[VID Err]Please check sensor id first,the id is 1
We understand that you need a return value for the video open status, hence, we have created an API in Arduino SDK for video open status check, please apply the following patch to your Arduino SDK package. You can now call Camera.cameraOpenStatus() for the camera sensor connection check, 0: No video opened, 1: Video is opened.
We will update these changes in the upcoming pre-release version.
Please let us know if this fulfill your needs. Thank you.
arduino_patch_video_status.zip (13.2 KB)
I have replaced the patch files and encounter errors during build.
I am using arduino sdk 4.0.9
ArduinoIDE 2.3.6
Hi @DevomechSolutions ,
Would you mind to update your SDK to the latest pre-release version 4.1.0-build20251027 and apply the patch again? This could be due to the version incompatibility.
Thank you.
using 4.1.0-build20251027
encountered this error
c:/users/thinkpad/appdata/local/arduino15/packages/realtek/tools/ameba_pro2_toolchain/1.0.1-p1/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\thinkpad\AppData\Local\arduino\sketches\EF621C024634E69F79547D96C4E44F0D\sketch\camera_ops.cpp.o: in function ameba_camera_init()': camera_ops.cpp:(.text._Z17ameba_camera_initv+0x4): undefined reference to Video::cameraOpenStatus()’
collect2.exe: error: ld returned 1 exit status
It worked! thanks
I first initialized the camera and then used the Camera.cameraOpenStatus() function.
Hi KevinKL.
Is there a way that we can check the camera connection status before initialization ?
I will help you to verify and get back to you soon.
Thanks.
Hi @DevomechSolutions ,
The calling of Camera.channelBegin(CHANNEL) is necessary for sensor detection. Kindly make sure that you have called the API to update the connection status of the camera sensor.
Thank you.
