Serial Camera Error

Hello,

The following error occurs when using the serial camera:

#### Exception System.Exception - 0x00000000 (8) ####
#### 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.dll
#### Exception System.Exception - 0x00000000 (8) ####
#### 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.dll
#### Exception System.Exception - 0x00000000 (8) ####
#### 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.dll
#### Exception System.Exception - 0x00000000 (8) ####
#### Message:
#### Gadgeteer.Modules.GHIElectronics.SerCam::ReadBytes [IP: 002f] ####
#### Gadgeteer.Modules.GHIElectronics.SerCam::ReadFrameBuffer [IP: 006b] ####
#### Gadgeteer.Modules.GHIElectronics.SerCam::UpdateStreaming [IP: 003a] ####
A first chance exception of type ‘System.Exception’ occurred in GTM.GHIElectronics.SerCam.dll

Using VS 2010 and the latest SDKs.

See code below:

static Bitmap LCD = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);
void VideoStreamming()
{
    camRight.StartStreaming();
    LCD.Clear();
    while (true)
    {
        Thread.Sleep(25);
        if (camRight.isNewImageReady)
        {
            camRight.DrawImage(LCD, 0, 0, SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);
            display.SimpleGraphics.DisplayImage(LCD, 0, 0);
        }
    }
}

@ andre.m - Thanks for the recommendation. However, the error still occurs even when the t socket is disconnected.

@ TechDev -

If you are sure you are using correct socket, what I can say is check / replace other cable?
Did it not work at all or worked a while then show exception?

@ Dat - Whether the t socket is connected or not, the camera works a bit and then “freezes” when the error occurs.

@ andre.m - Computer USB port.

@ andre.m - Tried an external psu. It still appears to freeze when the error occurs. I can’t tell for sure because the system unfreezes in both cases after a few seconds and I no longer have access to debug logs when using an external psu. However the video streaming isn’t smooth (continuously freezes every apprx few seconds for several seconds). When connected to a PC on debug mode this “freeze” corresponds to the error I indicated earlier.

Does anyone else have any ideas on how to resolve this issue?

a number of things that will assist people trying to help you:
[ul]what mainboard are you using?
you obviously have a camera and a display attached to board. What display?
Your code labels the camera ‘right camera,’ is there a ‘left camera’?
Is anything else attached to board?
Have you tried to shorten your code (i.e. eliminate functioning) until the application is small enough to post in it’s entirety. (as opposed to a fragment)? (or is that fragment pretty much the whole program?, If so, please post the entire program).
How, where, and when is VideoStreaming invoked?
Is your program multi-threaded?[/ul]

@ Jeff - see below for details regarding setup

Fez Spider

T35

Yes, 2 serial cameras are attached. The error however is experienced regardless of the number of cameras (this is from previous testing).

There are currently plenty of other components attached. At some point I was testing without other components, the same problem still showed up.

[quote]Have you tried to shorten your code (i.e. eliminate functioning) until the application is small enough to post in it’s entirety. (as opposed to a fragment)? (or is that fragment pretty much the whole program?, If so, please post the entire program).
[/quote]

I did try to simply run the code that was attached above. Problem still exists.

From ProgramStarted in a new Thread.

Current iteration is multi-threaded. Problem persist event if VideoStreaming is the only thread that is launched.

Let me know if any other specific details would be helpful!

I am also having this issue using the camera. Why hasn’t anyone replied to this post yet? TechDev, did you solve this problem?

I did try to simply run the code that was attached above. Problem still exists.

From ProgramStarted in a new Thread.

Current iteration is multi-threaded. Problem persist event if VideoStreaming is the only thread that is launched.

Let me know if any other specific details would be helpful!
[/quote]

Have GHI ever used online remote debugging via Skype?