Quick Start for .NET Gadgeteer

The .NET Gadgeteer platform lets you make interesting embedded devices. The documentation is actually pretty good, but I did have some problems getting started. Here’s a no-nonsense summary. I don’t give you any URLs because they can change but I give enough information so you can do a Web search.

The first step is to install Visual Studio. Most of the demo code available on the Internet uses VS 2010 but I prefer to go up-to-date and use VS 2012 instead. I already had an old laptop running Windows 7 and the commercial Visual Studio 2012. You can also use the free Express version that includes C#.

The second step is to install the .NET Micro Framework SDK 4.3 (use 4.2 for VS 2010) from Microsoft. You save a .zip file to your machine, then unzip, then run the .msi installer file. I chose the “typical” option.

The third step is to download and install the software that is specific to your hardware because Gadgeteer can use several different companies’ hardware. I had GHI FEZ Spider (company-make-model) hardware and found the two downloads I needed for that hardware on their Web site (I searched for “GHI SDK”). The first download was “NETMF and Gadgeteer Package” (MF means Micro-Framework). It actually consisted of six sub-installs (an SDK, a second SDK, Core, a third SDK, a fourth SDK, and drivers). After installing all six, I downloaded and unzipped the configuration utility named FEZ_Config_vxxx.exe. (Update, January 2014: The installation process is in constant flux. I went through the installation process and the install package from GHI now contains seven sub-installs instead of six because the configuration utlity is included).

To test the system, I tried something super simple – just a device that has a button and responds to a press. I attached a red USB power module to Socket 1 on the main board, and a button module to Socket 4. I plugged in the power to a USB port on my laptop, and then ran the FEZ_Config utility to run the Firmware Updater tool (not sure if this last updater step is necessary). I had to try two different USB cables before I got a good connection. The Device name showed EMX_EMX which is the processor.

I launched VS 2012, created a new C#-Gadgeteer project and named it GadgeteerApp9. The UI asked me to select the mainboard (FEZ Spider in my case). Confusingly, the UI noted that FEZ Spider uses version 4.2 of the MF when I had just installed SDK 4.3 — apparently SDK 4.3 contains MF 4.2. From the VS Toolbox, I dragged a Button control onto the design surface, and then dragged a connection between the button and the image of Socket 4.

In file Program.cs, I edited ProgramStarted to get:

namespace GadgeteerApp9
  public partial class Program
    // when mainboard is powered up   
    void ProgramStarted()
      button.ButtonPressed +=
      Debug.Print("Program Started");

    void button_ButtonPressed(Button sender,
      Button.ButtonState state)
      Debug.Print("I'm alive!");

I hit F5 to build the project, deploy the project from VS over to the Gadgeteer device, and start the debugger running. After roughly 60-seconds the program started, I pressed the button control, and verified my Gadgeteer system was functional by looking for the I’m-alive message in the VS Output window.

There are lot of things that can go wrong. In early attempts I kept getting a “Device not found error” during the deploy process. It drove me batty for several hours until I gave up and got a new mainboard. That solved the problem: apparently my original was just defective. Also, after you connect the mainboard, you should go to Device Manager and make sure all devices have a working driver, otherwise you’ll likely get the deadly “Device not found” error.


This entry was posted in Machine Learning. Bookmark the permalink.