Getting started with FEZ Spider Kit for Microsoft .NET Gadgeteer

I was pleased to see the new project posted that could help newbies to get going and have success. It has not worked as expected.

  1. I have updated the firmware in the new spider board.

  2. I typed the program in as indicated without a problem. It looked like things were going my way. i like the way this program is guided through with pictures and screen shots.

  3. I run the depot program and confirm that the spider board is connected and pinged back the correct response.

  4. I run the program without errors and the output screen exactly matches the example. I go to push the button and nothing happens.

  5. I confirm that the hardware is connected correctly and even ys the program gadgeteer screen to confirm it is correct.

  6. Reading trouble shoot stuff maybe the output from the USB is weak so I get a new regulated power supply and adjust the voltage to about 7.8 volts at the power supply and reading about 7.6 at the connector to the interface board.

  7. I run the program again and no change.

  8. The video screen displays:
    EMX
    Version: 4.1.7.0
    LCD: 320x240
    IP: 192.168.1.200
    MAC: 00.1A.F1.00.42.0D
    Managed heap size: 13041664
    Custom heap size: 1048576

  9. This doesn’t change when the bottom is pushed. The LED doesn’t light when the button is pushed. The LED on the push button does light up while the Spider is booting up.

  10. The screen does blink and a line appears then disappears while the program seems to be downloading, but the startup screen information does return.

  11. i have swapped out the push button with no change.

Do I have a defective piece of hardware?

This seems like it should have been a simple thing to get a feeling that the stuff works.

Here is the code i have typed in:


using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace GadgeteerCamera
{
    public partial class Program
    {
        void ProgramStarted()
        {
            /******************************************************************************************
            Access modules defined in the designer by typing their name:                            
            
            e.g.  button
                  camera1

            Initialize event handlers here.
            e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);             
            ***************************************************************************************** */

            // Do one-time tasks here

            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            camera.PictureCaptured += new Camera.PictureCapturedEventHandler(camera_PictureCaptured);

            Debug.Print("Program Started");
        }
        void camera_PictureCaptured(Camera sender, GT.Picture picture)
        {
            display.SimpleGraphics.DisplayImage(picture, 5, 5);
        }
        private void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            Debug.Print("Button Pressed");
            camera.TakePicture();

        }
    }
}

I added the Debug.Print(“Button Pressed”) as advised.

It takes multiple times about 20 and i do get a response back at the computer then this is what I get:

The thread ‘’ (0x2) has exited with code 0 (0x0).
Using mainboard GHIElectronics-FEZSpider version 1.0
Program Started
Button Pressed
Button Pressed
Camera ERROR : Unable to take picture. The camera is already busy taking a picture.

Why is the camera busy? Why do i not see a change on the screen? Why doesn’t the light on the button blink when pressed? Why does it take so many tries for the button to do anything?

The button is deffective. Both buttons are. I have tried using the joystick and it works better. i tried to download the button fix but the zip file errors and microsoft tells me "The Compressed (sipped) Folder is invalid or corrupted.

Please help! Are there some other very simple programs i could use to help test if the hardware is working?

It takes a little bit of time for the camera to take the picture, so try running the program again, and just pressing the button once, then waiting.

It may be that by pressing the button repeatedly, you’re attempting to call the TakePicture method again before the camera finishes with the first picture, and then you get the exception.

Yes i have tried pressing the putton once and waiting. I have tried many combinations over the last three or four days. It shouldn’t require such considerations. Should just work. When it requires some many pushes on button to get results and with the LED’s not working on the button you don’t know when it has been accepted until something shows up on the computer.

@ Curtis,

Keep in mind. This is not desktop programming, with multi-core, multi-ghz processors and gobs of RAM. There will be plenty of times that you may notice that things aren’t instantaneous.

Another thing to realize is that all of the Gadgeteer code is beta stuff. It still has room for tweaking and improvement.

The “digital camera” app was one of the first things I tried with my kit, and I did not run into the issues you’re describing. Let me run through it again, and see if there’s anything that might be missing from your setup to cause you the issues you’re seeing.

If you haven’t properly installed the button fix, that could definitely cause you issues with the button.

Just to clarify…you have downloaded and installed all the files from:

[url]http://wiki.tinyclr.com/index.php?title=Gadgeteer[/url]

and

[url]http://tinyclr.com/forum/21/4373/[/url]
?

Hi Dev Hammer,
I have tried to download the updated button driver but I get:
"The Compressed (zipped) Folder is invalid or corrupted"
message when i try to unzip it. I believe i have downloaded the files from the Gadgeteer site that i need. The C# software project file seems to run correctly I don’t get expected results from the hardware at this point. I think I could use a few very simple programs to test each piece of hardware in someway to check the hardware with.

I was able to unzip the button update files on my big Mac and use a thumb drive to move them over and ran the exe and it indicated that the update was successful. I ran the program again and no change.

You need a new project to pull in the new libs

@ Curtis,

As Gus noted, the new button files don’t get pulled into an existing project automatically, as the old projects will still have a reference to the old version of the button DLL.

You can either start with a new project, which will automatically pull in the new patched version of the button DLL, or you can go into your existing project, find the References folder in the Solution Explorer pane, and manually remove the reference to GTM.GHIElectronics.Button, and then right click the References folder and select Add Reference (see picture below), then in the .NET tab, find the listing for GTM.GHIElectronics.Button, and add it back into your project.

That should get you all set with the button.

Hope that helps!

Gus and Devhammer,
Well I did what Gus said about starting a new project, I didn’t see Devhammer’s replay until after I did what Gus said, then I copied the code over and the button works now…but I still get no results and it takes pushing the button twice the first time and I get:

Program Started
Button Pressed
Button Pressed
Camera ERROR : Unable to take picture. The camera is already busy taking a picture.
Button Pressed
Camera ERROR : Unable to take picture. The camera is already busy taking a picture.

Well at least one more bug out of the way…

The LED on the button doesn’t light when pressed, but it does come on during boot up and downloading the program.

Should the screen go blank after the boot up and download? It still has the system info on the screen.

Why not test thd button itself and forget about the camera for a bit.

Subscribe to the up and down events and in events do a debug.print

I did add"


        private void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            Debug.Print("Button Pressed");
            camera.TakePicture();

To the code and on the computer output window it shows the button has been pushed. does this help?

Good. Now to test the camera, connect the camera module directly to the power module, no spider mainboards. Then connect USB to pc.

OK! I did this and the camera was recognize buy the pc. How to I test for an image?

So camera is good and button is good.

Lets test one last thing, the USB host function on spider.

Use the USB Host module and read a file from USB memory stick please. Actually, just detect a USB device, any device!

Good morning Gus,
I plugged the USB host controller in the place of the camera in socket 3 and nothing happens. Neither lights, on host controller board or USB memory stick indicates it is active.

The host controller plugged directly into the USB client works fine. I can read files off of the memory stick.

What else?

Thanks for the continual advice.

Curtis

You mean you plugged the USB Host “module” to socket type H on spider? And you did the same on the designer? Can you show us the “simple” code you use to detect the insertion on a USB device in USB Host module?

I didn’t code anything. I did 2 things:

  1. Just plugged the USB host into socket 3 on the spider and turned power on. I know I couldn’t get any information from the thumb drive but did notice that no lights came on on the USB host board nor any light on from the thumb drive as you would expect when it powers up.

  2. Then i plugged the USB host controller directly into the USB host client and when I plugged it into the PC, both LED’s one on the host board and the one on the thumb drive came on. I was able to read the thumb drive on the PC using windows explorer.

Again I didn’t do any code to have the spider read the drive. do you have a simple program I could run for diagnostics?
Curtis

You need to write some code to access a memory stick or USB mouse … Etc.

Since I’m new to this and don’t have enough experince to write the program I found one I thought would work and downloaded it but i get and error. The progarm I downloaded was:

Snippet-Spider Basic Storage Tests @ http://code.tinycir.com/project/400/spider-basic-storage-tests/

But there are six errors that come up…they are:

Error 1 The name ‘sdCard’ does not exist in the current context C:\Documents and Settings\Joy Martin\Local Settings\Application Data\Temporary Projects\spidersoragetest\Program.cs 22 13 spidersoragetest
Error 2 The name ‘sdCard’ does not exist in the current context C:\Documents and Settings\Joy Martin\Local Settings\Application Data\Temporary Projects\spidersoragetest\Program.cs 23 13 spidersoragetest
Error 3 The name ‘sdCard’ does not exist in the current context C:\Documents and Settings\Joy Martin\Local Settings\Application Data\Temporary Projects\spidersoragetest\Program.cs 24 13 spidersoragetest
Error 4 The name ‘usbHost’ does not exist in the current context C:\Documents and Settings\Joy Martin\Local Settings\Application Data\Temporary Projects\spidersoragetest\Program.cs 26 13 spidersoragetest
Error 5 The name ‘usbHost’ does not exist in the current context C:\Documents and Settings\Joy Martin\Local Settings\Application Data\Temporary Projects\spidersoragetest\Program.cs 27 13 spidersoragetest
Error 6 The name ‘usbHost’ does not exist in the current context C:\Documents and Settings\Joy Martin\Local Settings\Application Data\Temporary Projects\spidersoragetest\Program.cs 28 13 spidersoragetest

I bet there is a simple answer but I’m to inexperience to figure this out.