Main Site Documentation

Camera ModuleTroubleshooting Guide


#1

There is now a wiki page dedicated to helping troubleshoot issues with the Camera module. This page should help you determine what is wrong if you have an issue with the module. It provides sample code for use of the camera, as well as common issues regarding usage.

http://wiki.tinyclr.com/index.php?title=Gadgeteer_Camera

We ask that you please read and try this page before posting about a camera issue, and have the debug output in your post to better help us solve the issue.


#2

Hi Gus,
I have updated my stuff and still have issues with the camera. Here is the debug output.

Using mainboard GHIElectronics-FEZSpider version 1.0
Displaying information about the connected display…
Display Resolution: Height: 240 Width: 320
Display Auto Redraw: True
Program Started
Camera was busy taking a picture. Number of times picture capture failed: 1
Camera successfully connected!
Displaying information about the connected camera…
Camera Resolution: Height: 240 Width: 320
Camera Ready: True
If you are experiencing blurry or unfocused images, try manually adjusting the camera’s focus, located on the end of the camera lens.
Camera reports that it is ready to take a picture. Attempting to take a picture
Camera was busy taking a picture. Number of times picture capture failed: 1
Camera was busy taking a picture. Number of times picture capture failed: 2
Camera was busy taking a picture. Number of times picture capture failed: 3
Camera was busy taking a picture. Number of times picture capture failed: 4
Camera was busy taking a picture. Number of times picture capture failed: 5
Camera was busy taking a picture. Number of times picture capture failed: 6
Camera was busy taking a picture. Number of times picture capture failed: 7
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Picture sent to the display.
Camera reports that it is ready to take a picture. Attempting to take a picture
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Picture sent to the display.
Camera reports that it is ready to take a picture. Attempting to take a picture
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
GC: 20msec 912720 bytes used, 12128328 bytes available
Type 0F (STRING ): 1356 bytes
Type 11 (CLASS ): 13896 bytes
Type 12 (VALUETYPE ): 1524 bytes
Type 13 (SZARRAY ): 235536 bytes
Type 15 (FREEBLOCK ): 12128328 bytes
Type 16 (CACHEDBLOCK ): 120 bytes
Type 17 (ASSEMBLY ): 33132 bytes
Type 18 (WEAKCLASS ): 240 bytes
Type 19 (REFLECTION ): 168 bytes
Type 1B (DELEGATE_HEAD ): 1080 bytes
Type 1C (DELEGATELIST_HEAD ): 108 bytes
Type 1D (OBJECT_TO_EVENT ): 216 bytes
Type 1E (BINARY_BLOB_HEAD ): 617436 bytes
Type 1F (THREAD ): 1536 bytes
Type 20 (SUBTHREAD ): 192 bytes
Type 21 (STACK_FRAME ): 2064 bytes
Type 22 (TIMER_HEAD ): 72 bytes
Type 23 (LOCK_HEAD ): 60 bytes
Type 24 (LOCK_OWNER_HEAD ): 24 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD): 48 bytes
Type 27 (FINALIZER_HEAD ): 120 bytes
Type 31 (IO_PORT ): 144 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
Type 36 (APPDOMAIN_ASSEMBLY ): 3576 bytes
Camera was busy taking a picture. Number of times picture capture failed: 1
Camera was busy taking a picture. Number of times picture capture failed: 2
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Picture sent to the display.
Camera reports that it is ready to take a picture. Attempting to take a picture
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
Camera reports that it is ready to take a picture. Attempting to take a picture
Picture sent to the display.
Camera was busy taking a picture. Number of times picture capture failed: 1
Picture successfully captured!
Picture encoding: 3
Attempting to print the picture to the display…
The program ‘[3] Micro Framework application: Managed’ has exited with code 0 (0x0).


#3

This doesn’t look right! Maybe there is an error in the SDK!

What your camera DLL version number?


#4

4.1.1.2


#5

I will let Joe look at the code since he knows better but from what I am seeing in output, it is working but filing every other image. If you see blurry image then adjust the focus. Maybe the problem is in teh test app on wiki not in drivers.

Joe, we need help.


#6

I don’t see a problem.
The thread in this application is trying to acquiring a image every second which is too fast and the camera is busy taking another picture. If you would like to capture an image very frequently then you should not use the TakePicture() method. There is another method to stream from the camera.

TakePicture() is used with event driven non periodic routines like buttonPressed event.
This application should be changed, it should not request a new picture till it is done taking the picture before.
or just ignore those messages

About the attached image. You need to adjust the focus manually by spining the lens.


#7

Thanks joe. We will update the code on Monday.

Post is locked till then.


#8

Thanks Joe and Gus. The Wiki app seemed like a good test and figured since it was posted and suggested to try to troubleshoot it would work :frowning: but it didn’t… so I wrote my own

I had to keep messing with the focus and such I have a working camera module. I have attached the code I used and an image of a picture on the wall in the room I am in.


using Microsoft.SPOT;
using GT = Gadgeteer;
using Gadgeteer.Modules.GHIElectronics;

namespace GadgeteerCameraApp
{
    public partial class Program
    {
        protected void ProgramStarted()
        {
            camera.CameraConnected += new Camera.CameraConnectedEventHandler(camera_CameraConnected);
            camera.PictureCaptured += new Camera.PictureCapturedEventHandler(camera_PictureCaptured);
            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            display.SimpleGraphics.AutoRedraw = true;
            Debug.Print("Program Started");
        }

        protected void camera_CameraConnected(Camera sender)
        {
            Debug.Print("Camera Cnnected!");
            Debug.Print("Connected Camera Information...");
            Debug.Print("Camera Resolution: " + " Height: " + camera.CurrentPictureResolution.Height + " Width: " + camera.CurrentPictureResolution.Width);
            Debug.Print("Camera Ready: " + camera.CameraReady.ToString());
        }

        protected void camera_PictureCaptured(Camera sender, GT.Picture picture)
        {
            display.SimpleGraphics.DisplayImage(picture, 5, 5);
        }

        protected void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            if (camera.CameraReady)
            {
                camera.TakePicture();
            }
        }
    }
}