Issues with FEZ Spider Kit Getting Started Guide

I’m following all the steps in the getting started guide here:
http://www.ghielectronics.com/downloads/Gadgeteer/Mainboard/Spider_GettingStarted/

I’m able to compile and run the project, but I’m having two issues:

  1. The button barely responds, if at all
  2. Even when disabling the button and taking pictures directly, they are all incredibly blurry and I can’t seem to find a way to make them not blurry.

For the first problem, I know there is an update to the button driver that should fix this, but this link:
http://www.ghielectronics.com/downloads/Gadgeteer/Patch/Gadgeteer%20Button%20Module%20Patch.zip
doesn’t appear to work. The “Patch” folder doesn’t even appear to exist there, and I can’t find that file anywhere. Could anyone point me in the right direction? I also tried swapping the buttons and the ribbon cables to be sure it wasn’t faulty modules. I can make the button LED blink with no problem.

For the second problem, I tried removing the lens on the camera and wiping it down, but it didn’t fix anything. I can kind of make out colors on the pictures on screen, but most often they’re either mostly white or mostly dark with hints of other colors. Occasionally I’ll also get “camera busy” type errors. Does anyone know what the camera is doing that takes so long? It doesn’t seem to be focusing, if that’s even a feature of the camera…

Thanks!

Welcome to the forum!

  1. Did you see this post:

http://www.tinyclr.com/forum/21/5148/#/2/msg49106

  1. I am not sure about this one. I haven’t tried the camera since the update. Others might have some insights.

Have you tried to manually focus the picture by turning the lens?

Regarding the camera…a couple of things to try:

[ol]
Make sure the camera is mounted in a way that it does not move. The camera that comes with the starter kit is quite sensitive to motion, so if it’s moving at all, you will not get a clear picture.
If I recall correctly, the lens can be screwed in or out within a certain range, and this should allow you to focus at different distances. Try experimenting with that and see if it helps.[/ol]

As far as the “camera busy” errors, there’s an API that allows you to check if the camera is ready…you should always check that before attempting to take a picture. Remember that you’re not working on a multi-core, multi-Ghz processor here, so things will take longer than you’d expect on a PC.

Wow, thank you for the quick replies.

For the button, yes I tried to implement both the button pressed and button released handlers. This didn’t fix the issue. Is that updated dll still available somewhere?

For the camera, I tried turning the lens to focus it, but it didn’t appear to make a difference. I will try more with this, as it was my first thought as well. Also, the camera is sitting fixed on the desk, but if the lens focus is the issue, then that probably wouldn’t matter.

Additionally, I have implemented the check for the camera being busy. The problem is even on a 5 second interval, I get maybe 1 picture every 5-10 minutes (and just avoid “camera.TakePicture()” the rest of the time). I understand it’s not a super powerful processor, but that seems excessive. Especially since moments before that I had the 2 second interval working with no busy errors, which suggests something else is going on.

Thanks again

5-10 minutes between pictures does seem a bit excessive. That’s not what I’ve seen in my use of the camera, but I haven’t done a project with the camera recently.

Can you post the relevant code from your Program.cs file?

That post was referring to a recently released beta SDK, which can be found here.

http://www.ghielectronics.com/downloads/NETMF/Beta/GHI%20NETMF%20v4.1%20and%20.NET%20Gadgeteer%20Package.zip

And how exactly are you handling when you take a picture? Is it related to the button or is it on a timer?

All relevant code is below (explanation following)

Top of Program class:

 GT.Timer timer = new GT.Timer(5000); 

In ProgramStarted:


            camera.PictureCaptured += new Camera.PictureCapturedEventHandler(camera_PictureCaptured);
            timer.Tick += new GT.Timer.TickEventHandler(timer_Tick);
            timer.Start();

Handlers:


        void timer_Tick(GT.Timer timer)
        {
            if (camera.CameraReady == true)
            {
                camera.TakePicture();
                Debug.Print("Picture Taken");
            }
            else
                Debug.Print("Camera is still busy.");

            //button.ToggleLED();
        }

        void camera_PictureCaptured(Camera sender, GT.Picture picture)
        {
            display.SimpleGraphics.DisplayImage(picture, 5, 5);
            Debug.Print("Picture Displayed");
        }

I get the first “Picture Displayed” message (with accompanying picture on the display), but then I just get the “Camera is still busy.” message every 4 seconds in VS.

I tried both the button and the timer, as outlined in that getting started guide. JUST the button didn’t work due to aforementioned problem, and JUST the timer is the above case.

In a separate case, I put in extra debug code to blink the button’s LED every 200ms (100ms on/100ms off, using separate timer and handler) and that works fine. If it does happen to take a picture, I notice a delay in the blink rate (stuck on or off briefly), but I guess that can be expected. When the “Camera is still busy” occurs, the blink rate remains constant (also expected).

After re-programming that same code multiple times (with the same results), I tried unplugging the unit and letting it run on its own for a minute. It had the same issue, but after I plugged it back in and tried to program again, I had to hit the reset button on the unit itself for the debugger to get past the “Rebooting…” message. This appears to have corrected it, as I can now even get it down to a 1sec interval with only every 3rd or 4th one reporting camera busy (5 second interval had no issue). This allowed me to properly focus the camera, making sure I held it fixed to the desk while I did so.

Now if I can only get that button working, I can complete “Getting Started”, heh. If I install that beta package, will it have the button fix?

Thanks for the help!

Glad to hear you got it working! And yes the Beta does include the button fix. Just make sure you have both the Pressed and Released event handlers.

Excellent, thank you.

Further testing seems to reveal that the issue is worse when the debugger is connected (at least until the hard reset button is hit). Maybe the debugger uses a lot of the CPU resources?