Spider + WifiRs21 + USB Cam module not working

I am trying to build a simple system to stream the video from USB cam module over Wifi.
[Designer image attached].

M[y camera code works on its own but as soon as I add the Wifi module in the designer, the camera module throws a Null pointer exception in camera.dll onconnected event handler.


Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (6)


Gadgeteer.Modules.GHIElectronics.Camera::OnDeviceConnected [IP: 003f]

GHI.Usb.Host.Controller::OnConnect [IP: 0050]

GHI.Utilities.InternalEvent::RaiseEvent [IP: 000d]

GHI.Utilities.InternalEvent::OnEvent [IP: 003e]


Camera video streaming code [trimmed for simplicity]

 void ProgramStarted()
            Debug.Print("Program Started");
            camera.DebugPrintEnabled = true;
            camera.CameraDisconnected += camera_CameraDisconnected;
            camera.PictureCaptured += camera_PictureCaptured;
            camera.CurrentPictureResolution = Camera.PictureResolution.Resolution176x144;
            camera.CameraConnected += camera_CameraConnected;
            camera.BitmapStreamed += camera_BitmapStreamed;
            camera.DebugPrintEnabled = true;

        void camera_CameraDisconnected(Camera sender, EventArgs e)
           Debug.Print("Cam disconnected");

        void camera_PictureCaptured(Camera sender, GT.Picture e)
           Debug.Print("Picture captured");
        void camera_BitmapStreamed(Camera sender, Bitmap e)
            Debug.Print("image streamed");

        void camera_CameraConnected(Camera sender, EventArgs e)
            Debug.Print("Cam connected");
            camera.StartStreaming(new Bitmap(camera.CurrentPictureResolution.Width, camera.CurrentPictureResolution.Height));

I am using .Net microframework 4.3 and I have tried powering the code externally using ucBattery4xAA battery module and USB [unpowered]. Any suggestions on what might be causing the error?

wqell no it doesn’t seem to be :slight_smile:

Good luck - I hate to break it to you but it is not going to be possible on a platform like this. The volume of data is going to kill you. There really would need to be a “pipeline” of data transfer from the cam to the wifi; a general purpose microcontroller will always struggle to deal with that.

@ Brett
Oops… sorry. I submitted the question by mistake before I completed drafting it. I have updated my question now.
And I am using the GHI USB Cam module over the lowest resolution of 160X120 and trying to achieve a framerate of anything over 1 fps. Which I assume should be possible.

Back to the question, I get a null pointer exception when I add the Wifi module in designer from the camera.dll module. Any suggestions?

@ deepakakkil - Does the issue persist if you remove the DisplayN18 and battery holder from the designer?

I do not know what changed, but today morning when i tried the same set up, the USB camera module started overheating and does not work any more :-(.

I tried connecting USB camera module directly in USBClient DP module and the device is detected as an UNKNOWN DEVICE by the windows and the heating problem persists. Do you think its broken?

@ deepakakkil - And the last time you touched or used the camera it was working fine with no heat problem? Nothing at all has changed since then?

Yes. It did work pretty well the other day I tried without any heating problem. I also got the video stream running when the Wifi module was not connected. And nothing much has changed after that. Except that I kept it the gadgeteer on battery power with the Serial camera plugged in running for 3 hours or so .

@ deepakakkil - How did you get the camera to work? You kept the serial camera plugged in? As in our SerCam? Or the USB camera?

oops… sorry. I mean the USB camera

The USB camera video stream was being displayed on the DisplayN18 module on a FEZ spider powered by UCBattery 4xAA Module. I forgot to power it off and it was running for a while. I am not sure if there was heating problem was already there at that point.

@ deepakakkil - What exactly on the camera is getting hot?

I am not sure what electronic component it is. It is the silver component highlighted in the image that is getting over heated.

As andre.m said, that is the crystal. If it is overheating then the module is pretty much not functional anymore.