Serial Camera Exception:

Can someone please tell me what is this exception that’s been thrown all over my program? :wall:

 takePicture()
        {
            
            Bitmap LCD = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);

            Program.camera.StartStreaming();

            while (!Program.camera.isNewImageReady)
            {
                Thread.Sleep(200);
            }

            Program.camera.DrawImage(LCD, 0, 0, SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);
            Program.camera.StopStreaming();
}

#### Exception System.Exception - 0x00000000 (20) ####
#### Message: 
#### Gadgeteer.Modules.GHIElectronics.SerCam::ReadBytes [IP: 002f] ####
#### Gadgeteer.Modules.GHIElectronics.SerCam::ReadFrameBuffer [IP: 0072] ####
#### Gadgeteer.Modules.GHIElectronics.SerCam::UpdateStreaming [IP: 003a] ####

A first chance exception of type ‘System.Exception’ occurred in GTM.GHIElectronics.SerCam.dl

There is a range of posts adressing this problem, no-one really have solved it yet.

https://www.ghielectronics.com/community/forum/topic?id=14685

I think we are waiting for GHI to have a look at it. :cry:

I am running fine with this exception it seems, sometimes it takes a while for the camera to recover, slowing down the framerate significantly, but it comes up again - streaming pictures…

@ njbuch - That’s exactly the problem I have encountered.

We have been able to reproduce the issue on 4.2 and it appears to be fixed in the beta 4.3 SDKs.

1 Like

Thanks for the update :slight_smile: