Tuesday, November 17, 2009

Microsoft .NET Micro Framework 4.0 Source Code

Microsoft .NET Micro Framework - Open Source Microsoft announced the availability of the source code for almost all of the components yesterday:

With this version of the product, we are including source code for almost all of the components under the Apache 2.0 license. This will allow you to debug through the full stack and make whatever specialized changes you need for your specific application. It also means that if you want to run .NET Micro Framework on a processor architecture that is not already supported, you don’t have to wait for Microsoft to build and release the porting kit built with the right tool chain – you can do that yourself.

Together with this release the started the Open Source step:

We want to make sure that people can adapt the product to their needs but at the same time, how do we make sure that there is a core implementation that continues to be sponsored by Microsoft and adheres to the original goals of a high quality platform for small embedded devices. We decided to develop what we are calling the Community Development Model. In this model, there will be a codebase that is shared by the Microsoft and external developers from which we will release versions just like any product team.

There will be a core technology team that is made up of both Microsoft and external participants who will be the gatekeepers of code that goes into the product. The Microsoft engineers will continue to focus on some of the things that only they can do – deep coordination with the rest of the .NET team and collaboration with other Microsoft product teams and some of the more elemental architectural changes. For external developers, we are throwing the door open for you to propose projects that you would like to take on. (I have some ideas already if you need some.) These will be evaluated by the core tech team which will also insure that the result meets the needed quality metrics.

We are developing a web site to manage this community interaction (http://www.netmf.com). The site will be up in about a week with the initial ideas of how we see this community working but like with any community endeavor, we expect that this process will change and refine with your input so please let us hear from you.

And the best thing for going towards production step:

It’s all still free. We announced the removal of the ‘per unit’ royalties from the runtime distribution licenses and the fees for the porting kit last Spring. We continue to follow that path. There will be no fees from Microsoft associated with the use of the platform.

Monday, November 16, 2009

Microsoft .NET Micro Framework 4.0 download available

Today Microsoft announced the availability of the first .NET Micro Framework release which came out since they moved to the Developer Division. The version has a number of neat features, have a look at the following list:

.NET Micro Framework 4.0 features:

  • HTTP and HTTPs: An object model is now provided for handing both HTTP clients and servers, similar to the .NET Framework, with the new types System.Net.HttpWebRequest, System.Net.HttpWebResponse, and System.Net.HttpListener from assembly System.Http.dll
  • Multi-touch: Basic support for multi-touch events, such as moving two fingers on a touch screen, is now provided in the object model and the emulator. Gesture support has been redesigned to be faster and more flexible.
  • Versioning: Versioning has been implemented to strictly identify assemblies by the version number at build time and on the device, and eventually re-deploying missing assemblies. Side-by-side load and bind for types belonging to the same assemblies with a different version number is supported. Support has also been added for assembly naming which includes the version number.
  • Emulator support for SSL and HTTPS: The emulator now explicitly supports SSL and HTTPs emulation.
  • Native XML Parser: The XML parser has been moved to native code for better performance.
  • Native collections: The collection classes have been moved to native code for performance, and have been enriched with Queue and Stack types.
  • Time sync: Devices can use the new Time Sync API to sync the system time with a specified server's time, automatically or manually.
  • Arbitrary display size: A custom heap and allocation area is now provided to support bitmaps larger than 760KB.
  • Large buffers: A new type, Microsoft.SPOT.Hardware.LargeBuffer, is provided for allocating buffers larger than 760KB, which would not fit in the managed heap.  This type is located in assembly Microsoft.SPOT.Hardware.
  • Watchdog and Power Level control: The power level and the watchdog behavior can now be controlled from the managed application using types Microsoft.SPOT.Hardware.PowerState and Microsoft.SPOT.Hardware.Watchdog from assembly Microsoft.SPOT.Hardware.dll.
  • Thick pens and gradient fills: A richer graphic model is now provided for designing widgets and controls.
  • TinyCore performance improvements: TinyCore performance has been enhanced in the area of event dispatching and layout.

The download is separated in several download packages (compared with older versions of the SDK). Here you can find the list of available downloads of .NET Micro Framework 4.0:

Hey, this is a great start in the new week, isn’t it?

Thursday, November 12, 2009

New .NET MF Development Kit available – Analog Devices BF518F FMC

ana-DRC-bf518f-fmc-dev Avnet Electronics Marketing has designed and offers a new .NET Micro Framework development kit with great features. The board is using an Analog Devices BF518F low-power Blackfin processor, has plenty of memory, 10/100 Ethernet with IEEE 1588 V2 support, UART, USB, Avnet TFT LCD, and more.

One of the most unique things about the board is the integration of FPGA through the FPGA Mezzanine board.  This supports robust signal processing applications in the target markets of Industrial Automation, Smart Energy Management, Network-enabled Instrumentation, and Test and Measurement equipment.

Have a look at the key features:

  • Operates as a standalone, or as a VITA 57 FMC Mezzanine Module
  • Microsoft .NET Micro Framework ported by Adeneo Embedded
  • 400 MHz ADSP-BF518F Blackfin processor
  • 64 MB Micron PC-133 SDRAM
  • 4 MB Numonyx parallel NOR Flash
  • 4 Mb SPI Flash (internal to CPU)
  • Flexible booting options
  • 10/100 Ethernet with IEEE 1588 support
  • SD/MMC card slot
  • One RS-232 port (DB-9F)
  • One USB 2.0 mini-AB port
  • Supports external TFT-LCD conforming to Avnet LCD Interface (ALI) specification
  • Optional add-on debug agent
  • The development kit includes everything you need to start with a real hardware device. And yes, it comes with the .NET Micro Framework 4.0 (which is currently in beta).

    Tuesday, October 13, 2009

    Microsoft .NET Micro Framework 4.0 (Beta Refresh)

    There is a new 10/12/09 refresh of the Microsoft .NET Micro Framework 4.0 beta SDK available.

    What’s new?

    • Improvements to debugging over TCP/IP
    • Moved entire DPWS stack to native XML
    • Removed dependency from ATL when rebuilding the emulator and runtime  in the PK (this allows using VS Express for the purpose)
    • Improvements for MDK3.80a support

    Known issues

    • Full GCC thumb build does not work with the TCP/IP stack on some platforms.
    • Projects and solutions needs to be updated to v4.0: there is no automatic way to do it, but generally a Find&Replace of “v3.0” to “v4.0” should do the job for the managed projects, while instead the native solutions of the PK are virtually identical, although some drivers and CLR libraries might have been removed or changed name.

    Please submit any feedback through Microsoft Connect!

    Tuesday, September 29, 2009

    GHI E-Book: Beginners Guide to C# and the Microsoft .NET Micro Framework

    Gus is working on a book for their customers and the .NET MF community:

    This is an in-progress book we are making for our customers and the NETMF community. We hope you like it and find it useful. We are open to suggestions and comments.

    Keep this in mind when using the book:

    1. It is incomplete, full of typos and may have false info
    2. The book points out a new device called FEZ. This is not available and we do not have any public info, so please do not ask
    3. The book will be updated frequently until it is complete so come back and check the top of this post for the release number.

    Following topics you will find in the E-Book : Introduction, To port or not to port!, Selecting a Device, Getting Started, C# Level 1-3, Digital Input & Output, Pulse Width Modulation, Glitch Filter, Analog Input & Output, Garbage Collector, Interfaces (UART, SPI, I2C, One Wire, CAN), Resources, Displays, Time, USB Host, File System, Networking, Expanding I/Os, Wireless (ZigBee, Bluetooth, Nordic, WiFi 802.11), Thinking Small, Graduation Projects (MP3 Player, Smart Alarm Clock, GPS Data Logger)

    The book is not yet finished, but you can get it for free on this post.

    Don’t forget to get a copy of the second edition of Expert .NET Micro Framework (Jens Kühner) which updates the significant changes of .NET Micro Framework version 3.0.

    Wireless LAN (WiFi) now available on ChipworkX and Embedded Master

    Long time ago I was searching for a WiFi module that could be used on .NET Micro Framework devices. Well, Digi announced that their Digi Connect Wi-series will be available for .NET MF, too, but until today I didn’t get any feedback if this is true.

    GHI-00127-large Some weeks ago GHI announced that they offer a .NET Micro Framework module to run WiFi 802.11 wireless networks on their .NET MF devices.

    GHI proudly announces the first .NET Micro Framework 3.0 hardware to run WiFi 802.11 wireless networks on ChipworkX and Embedded Master.

    This new feature supports WEP, WPA, WPA2 secure networks through hardware AES and RS4 cyphers.

    The wireless 802.11 hardware module is FCC, IC and WiFi certified and costs only about $30 in low quantities which makes it ideal for .NET Micro Framework devices.

    Wow, that really looks great to me and I have to order one to play around with WiFi on .NET MF.

    Embedded Master and ChipworkX with Power over Ethernet

    Gus Issa posted on his blog about power over ethernet support for their .NET Micro Framework devices Embedded Master and ChipworkX:

    In Some applications, a networked device can be placed at a distance connected to an Ethernet cable. It would be really beneficial if the Ethernet cable can be used for data and for power. You actually can do that. This is called "Power over Ethernet", PoE for short.

    A .NET Micro Framework device like Embedded Master and ChipworkX can easily be power and networked using the same cable.

    Great to see how easy it is to set-up power over ethernet.

    Saturday, July 11, 2009

    Rich Media Extensions for the .NET Micro Framework

    Jens Kühner has created a Rich Media Extension library with a set of complete WPF elements and controls for the .NET Micro Framework. All elements are based on existing UIElement class.

    What are the Benefits for the developer?

    • By providing cool and modern themes out-of-the-box, an embedded developer needs not to care about art design and skinning. Custom themes for corporate branding are also possible.
    • The controls are usable via buttons and/or a touch-display. When using a touch display, controls are usable without the need of a Stylus, but with your fingers.
    • Faster time to market and reduced development costs because of a complete set of ready-to-use elements.
    • Transfer your existing WPF knowledge from the PC and Web to small embedded devices.
    • A further benefit is the underlying .NET Micro Framework with all its advantages.

    Have a look at his introducing video on YouTube.

    0250_tabcontrol_green_png-550x0 2604_scrDialog_png-550x0 3250_messagebox_png-550x0 6661_comobox_png-550x0 7853_onscreenkeyboardcyr_png-550x0 8637_progressbars_green_png-550x0

    Hanselminutes on 9 - The .NET Micro Framework with Colin Miller

    Scott Hanselman talked to Colin Miller about the .NET Micro Framework:

    Check out the Video at Channel 9, it's short, sweet and to the point and Colin covers a lot of ground. It's also the first video that I filmed and posted in 16:9 720p without changing the aspect ratio, so let me know if you like the video quality.


    Thursday, May 7, 2009

    .NET MF moves to Developer Division

    Colin wrote an official statement on the team blog because of the blog rumors in the last hours. .NET MF moves to Developer Division, there are changes taking place on the team but they are all for the good:

    “First, the product is moving into the Developer Division (Server and Tools).  This is a great fit for the technology and we are really looking forward to it.  The move means that we will be fully aligned with the rest of the .NET groups and tools in building the uniform programming model from the sensors to servers.

    The announcement that we are moving to some form of community direction and development including code access is accurate.  We will investigate how to do that in the near term so stay tuned.  For now however, the current products are available and continue to be supported as before.

    I am really excited about the potential of really accelerating the changes in the industry that we see coming.  I hope that you are as excited as I am.  Please let me know if you have any questions.”

    Perfect, everything seems to be ok back!! Ok, now I go back working on my new .NET MF project…

    .NET Micro Framework Future (not a dead project!!)

    Well, you may have heard about changes (see links below) for the .NET Micro Framework. Currently there is NO  official statement from Microsoft available, but some details may already be the direction .NET MF moves to.

    It seems that it will not really by “Open Source” (at least not by any of the common definitions of Open Source). The idea is to move it to a business model where source is available for OEMs to add functionality and to better differentiate their platforms and port to new instruction sets and CPU families. Microsoft will maybe make source available so that silicon vendors and third parties can make those ports themselves with guidance from Microsoft and other peers in the community.

    This means that .NET MF will not end or be Open Source, as blogs rumors, it will start right now with more performance and more supported CPU families. I hope that I can give my best feedback from my community around .NET MF. There is another post on the .NET MF team blog about .NET MF on top of another OS, really interesting, too.

    .NET Micro Framework in the news today:

    "The company also acknowledged cuts and major changes in the .NET Micro Framework team. The remaining employees will move to the .NET Framework team, the company said. Microsoft said it will continue to support existing .NET Micro Framework customers under the terms of current agreements, eliminate distribution royalties, make a free porting kit available, and provide access to the underlying source code."

    "Microsoft will continue to support existing customers according to any agreements that we have in place with them, and will honor our lifecycle support pledge," Microsoft said. "Forums continue to be available at MSDN. After moving to the community model, new customers will be supported by the community."

    Keep watching the .NET MF blog for official story from Colin in the next couple of hours.

    The version 4.0 planning is currently in full swing. Make sure to provide your inputs on how Microsoft can make the .NET Micro Framework better and more suited to your needs! Take the feature survey now…

    Update: .NET MF moves to Developer Division

    .NET Micro Framework Future (Update)

    Yes, it seems to be true. Microsoft decided to change .NET MF future. Colin Miller will be posting some official announcement (well, for me it is not an announcement) on the team blog in the next hours.

    John Leier (which was my contact person in the past) has left Microsoft already in November 2008, I didn’t get this. Another couple of people in the .NET MF team I couldn’t contact. Pavel could just reach on of them and could confirm on this sad reality.

    I hope that no one in the .NET MF team will loose their job. Since years I’m very fascinated of the .NET Micro Framework and what is possible with it. Hopefully I could give my best to still keep this great project alive.

    Update: .NET MF moves to Developer Division

    Announcing Meridian/P from Device Solutions

    meridianp-lowres During the Embedded World 2009 in Nuremberg I could already play with one of the first prototyps of the new Meridian/P from Device Solutions. It was a pleasure for me to be in the boat. Some days ago Device Solutions has announced the Meridian/P official.

    The key features are:

    • Same i.MXS processor and memory (4MBytes Flash, 8MBytes RAM) as the Meridian CPU
    • USB connector for powering the board and application download and debug.
    • 0.1″ headers for expansion. Two of these have the same pin-out as the EXP connectors on Tahoe-II.
    • Kit includes USB cable and 0.1″ pin headers you can solder on as required
    • Schmartboard compatible form-factor for rapid prototyping with fine pitch surface mount components

    More details are available here. The Meridian/P will be available in less than 2 weeks at US $99, a really good price.

    Microsoft to turn .NET Micro Framework to Open Source?

    Where is Microsoft cutting jobs of its planned 5000 person layoff? Well, several sites are already writing about it that the .NET Micro Framework is one of the products Microsoft will change future. As far as I understand Microsoft will move the next releases to open source communities but still support older versions in the common support time-frame.

    One side effect will be that there will be no license fee in the future for the .NET Micro Framework. People currently working at the .NET MF team will move over to the common .NET Framework. Well, maybe it was a good decision to start with the MF Toolkit at CodePlex. I announced that the MF Toolkit will be added in the next .NET MF release on 1st April – this was a April fools’ Day joke that may get real, now.

    (I currently have no official statement from Microsoft.)

    Update: .NET MF moves to Developer Division

    .NET Micro Framework Porting Kit for free

    If you are owner of a MSDN subscription you are able to download the .NET MF porting kit form the MSDN subscriber downloads, now.

    To more aggressively promote the adoption of the .NET Micro Framework, we have entered into an arrangement with the MSDN team. Most MSDN subscriptions will now include the latest version of the .NET Micro Framework Porting Kit. While available only as an online download, this product is exactly the same as the one currently available through Microsoft Stores.

    Read the full story

    New Firmware for Tahoe-II released

    Microsoft has released a new Service Pack for the .NET Micro Framework 3.0. A lot of bugs are fixed in this Service Pack for the porting kit. Some of the bug fixes are SD card related, problems developer had often in the last time.

    Device Solutions has updated their firmware to include the Service Pack. More details on the Device Solutions blog.

    Wednesday, April 1, 2009

    MFtoolkit available soon in .NET MF 3.0 SP1

    Microsoft announced that parts of the MFtoolkit will be available in the first service pack for .NET Micro Framework 3.0. Missing http support (currently we have only simple WebServices) is one of the most requested features. Support for hardware devices / modules like XBee or common sensors are following right after. .NET MF 3.0 SP1 will be available around June 2009.

    Until then the MFtoolkit will be still available at CodePlex. This week we got some new features like NetBIOS lookup, C6820 camera driver, SHA1 and SHA256 support as well as more improvements for XBee and http server classes.

    Update: yes, today is April Fools' Day or All Fools' Day.

    Monday, March 23, 2009

    Drunken .NET MF Device

    AUG Elektronik was showing a .NET MF device at the GAST trade fair that was running under water. The drink dispenser is using Atmel QMatrix touch sensor ICs that detect touch using a scanned passive matrix of electrode sets.

    Have a look at this video on YouTube demonstrating the dispenser while water is running over the screen.


    BTW: AUG Elektronik is using a very clear 3.4" AMOLED display which looks really nice.

    And the MSDN Premium goes to…?

    Yesterday I had to find the winner of my MSDN Premium subscription. My last MSDN Premium winner was found by a really simple Console application. To have more winners I added two new prizes: one for a guaranteed book prize (.NET 3.5 related) for the next game and one with a double chance to win.

    Here are the winners:


    Congratulation Joe, you are the winner of the MSDN Premium subscription. Łukasz and Anheledir got the two other prizes. The next MSDN Premium is waiting for you… sure!

    Friday, March 13, 2009

    Talk to your .NET MF device with Live Messenger

    Some months ago I was working on a Live Messenger or Google Talk integration in an Web application. Before trying to implement all at my own I started playing with imified. imified is really cool! You can register an account and imified will send you arriving messages as a simple http POST request. As html output you return the text you want to reply.

    Using my simple Webserver for .NET Micro Framework you are able to build steps and reply to the chat partner.

    imageLook at this example:

    context.Response.ContentType = "text/html; charset=UTF-8";
    switch (context.Request.Form["step"])
        case "1":
            context.Response.Write("Hi, what's your name?");
        case "2":
            context.Response.Write("Hello " +
                                   context.Request["value1"]) + "!");

    This example will say "Hi, what’s your name?" when you start chatting with the account. If you enter your name and press enter the account will reply with "Hello" and your entered text.

    I put my Google Talk account interactive [at] bot.im and Live Messenger account imified [at] schwarz-interactive.de in the HttpConsole demo application. Simple add the corresponding account to your favorite messenger and talk to my Tahoe-II board. It will tell you i.e. the temperature in my kitchen using the XBee modules from Digi.

    Looking forward hearing from you what you think about this way talking to a .NET Micro Framework device.

    Tuesday, March 10, 2009

    How to use Cultures in Microsoft .NET Micro Framework

    I’m currently working on a .NET MF device that should support several languages. The problem I noticed was the missing support of mscorlib culture depending formatting. Well, you’ll find the solution how to get i.e. the correct DecimalSeparator for German in Jens Kühner’s book.

    What you have to do is a simple library project that contains a single embedded resource with all the separator / patterns inside. The root namespace of the project files must be System.Globalization.Resources.CultureInfo. That’s the trick!

    Next you have to add a reference to this file and you’re able to switch the culture:

    public class Program
        public static void Main()
            Debug.Print((1.23456).ToString());    // 1.23456
            Debug.Print((1.23456).ToString());    // 1,23456 comma instead of dot

        static void ResetResourceManager()
            FieldInfo fieldInfo = typeof(Resources).GetField("manager",
                                                    BindingFlags.NonPublic | BindingFlags.Static);
            fieldInfo.SetValue(null, null);

        static void SetCulture(string cultureName)
            ResourceUtility.SetCurrentUICulture(new CultureInfo(cultureName));
            // render screen with new culture

    I have created a very simple application that is creating those project files. You can download the mscorlibculturepack.zip containing all the project files.

    This evaluation version of the .NET Micro Framework runtime will expire

    Did you ever got this message in Visual Studio output when started debugging a real device?

    This evaluation version of the .NET Micro Framework runtime will
    expire in 29 days, 23 hours, 55 minutes, and 0 seconds.

    Well, the porting kit provides tools to build time-bombed runtime images. You get 720 hours of runtime – this means you could basically run the device for up to 2 years at 1 hour per day or a month (30 days) at 24 hours per day.

    When starting with a new prototype (or a new device) some companies don’t care about this. What they need is to sign a volume license agreement with Microsoft telling them the real number of .NET MF licenses to flash a not time-bombed image.

    If you own a device that will expire in some days simple download the latest firmware update on the company’s Web site and flash your device. The 720 hours will start again and again from the time of the last flash.

    Links from 10th March

    Ondrej wrote a blog post about an error in DPWS Metadata Response and how to create a work-around.  I didn’t stumbled over this error yet but I found the small tool DPWS Explorer really interesting.

    Pavel added some more photos taken at the Embedded World 2009.

    I found another cool article about how to implement LINQ on the .NET Micro Framework. As LINQ only requires version 2.0 of the CLR you’re now able to write lambda expressions, extension methods and list comprehensions.

    Kevin added a cool demo how to add little GUI elements with .NET Micro Framework which looks really nice.

    Blair is writing about his Dare to Dream Difference Challenge project. I’m very interesting in seeing his device using XBee in real live.

    And another Dare to Dream Difference Challenge project created an API for Facebook on the .NET Micro Framework.

    Monday, March 9, 2009

    New Release: .NET Micro Framework Toolkit

    There is a new release of the .NET Micro Framework Toolkit available. Following changes are in the new build:

    • Improvements in http server: mime content support when using forms including file uploads, http classes redesigned, cookie and http headers support fixed, uploading larger content now working, form posts and access to parameters, query string and form data added
    • DNS bugs fixed for .NET Micro Framework
    • Added a new NTP library to get the current DateTime from NTP servers
    • Added new uALFAT library from Elze Kool

    If there is something missing or not working as expected feel free to send me any comment.

    Friday, March 6, 2009

    Webserver now handling File Uploads, Form Elements and Querystring correct

    I’m currently working on the next release of the MFtoolkit including a tiny Webserver. Since the first release there are big improvements in handling http requests as correct POST and GET handling, parsing of http headers and body. Mime-coded POSTs (i.e. when you uploading a file) are handled and available directly in the HttpRequest class. Cookie support is included, too.

    The online demo is still available, give it a try. I have changed the page output when you’re running any POST or GET.


    Any feedback welcome! The release will be available during the next weekend. I hope I can add some more demo pages to show the full power of the Webserver.

    Embedded World 2009

    I had the chance to meet some other .NET MF developers as well as people from Device Solutions, AUG Elektronik and Microsoft. We had really interesting discussions about the .NET MF 3.0 and wishes for the upcoming version 4.0. Hopefully some of our ideas or questions will be answered in a first beta.

    Here are some pictures taken at the Embedded World this year in Nuremberg:

    IMG_0685 IMG_0687 IMG_0689 IMG_0690 IMG_0681 IMG_0682 IMG_0683 IMG_0684

    And don’t forget to note the date for next year’s Embedded World 2010: 2.-4. March 2010.


    Wednesday, March 4, 2009

    Windows SideShow Device SDK for .NET Micro Framework 3.0

    sideshow Windows SideShow delivers information from your computer to a secondary display that is either integrated into the computer, such as a small color display in a laptop lid; or separate from the computer, such as a remote control or mobile phone.

    There are a wide variety of uses for this technology, from using a mobile phone to control your media library, to viewing news and calendar appointments in a digital picture frame, to being able to manage your e-mail while you play a game on your computer.

    On the Windows SideShow Connect website, you can find the latest SideShow software betas, including tools to build SideShow-compatible devices and upcoming SideShow gadgets from Microsoft.

    To participate in the Windows SideShow Device SDK for .NET Micro Framework 3.0 RC or the Device Simulator 3.0 for Windows SideShow RC program visit the Windows SideShow Connect website.

    If you’re using SideShow on a Windows Mobile there is an update of the Windows Mobile Developer Preview.

    New features implemented in the Windows SideShow Device SDK for .NET Micro Framework 3.0 since the beta release:

    • Support for TCP/IP is provided in the Microsoft.AuxiliaryDisplay.DPWS assembly.
    • The Microsoft.SPOT.TinyCore assembly has been replaced with Microsoft.AuxiliaryDisplay.Framework assembly, which is optimized for screen update and event handling performance.
    • Sprite animation support. A new sample project demonstrates how to implement sprites.
    • A callback for displaying an appropriate disconnected message if the device is disconnected, is provided in the OEM class.
    • The default lock screen is now brought up by a press-and-hold, and unlocked with a tap in the upper-right followed by a tap in the upper-left.
    • On pages that support select event feedback, a callback is provided for handling select events, and gesture feedback is optional. SCF pages now treat a tap as a select action.
    • Context menus feature a “chevron” bitmap that the user taps to open the context menu. This bitmap can be modified as part of your theme.
    • Status icons such as power, wireless strength, and sound level are customizable in your theme.
    • Support for collapsing and expanding the area of the display that SideShow uses, so that in collapsed mode, the area below the SideShow portion of the display can be used as a touch pad for mouse navigation. The OEM project has been updated to show how to implement a collapsed mode SideShow display.
    • Support for debug messages that display event response times for touch events.

    Tuesday, March 3, 2009

    SocketException ErrorCode 10035 – Network Switch Problem

    Some days ago a customer had a problem with the Tahoe-II board. A simple demo application was accessing a http server using sockets and download the html source. Using the Microsoft or Tahoe-II emulator everything works fine, but deploying and running it from a real device I got following error message from time to time:

    #### Exception System.Net.Sockets.SocketException - E_FAIL (1) ####
    #### Microsoft.SPOT.Net.SocketNative::poll [IP: 0000] ####
    #### System.Net.Sockets.Socket::Poll [IP: 0011] ####
    #### System.Net.Sockets.Socket::Connect [IP: 0029] ####
    #### NetworkTester.Program::Main [IP: 00f7] ####
    #### SocketException ErrorCode = 10035 
    Exception (first chance) of type "System.Net.Sockets.SocketException" in Microsoft.SPOT.Net.dll
    #### SocketException ErrorCode = 10035
    #### SocketException ErrorCode = 10035
    #### SocketException ErrorCode = 10035
    SocketException: Exception was thrown: System.Net.Sockets.SocketException Error-code: 10035 
    The thread 0x1 exited with code 0 (0x0).

    While playing around I got the device running on a different switch. The first used switch was a Netgear switch with 100/1000 MBit auto selection. As the Tahoe-II board is using a 10 MBit network card I put this on a 100 MBit switch and everything works fine. I’m not sure if this is the real problem, but since using the slower network switch the customer is happy.

    Monday, March 2, 2009

    How to create PE files for .NET Micro Framework without Visual Studio?

    While I was searching for a solution to deploy an .NET MF application without Visual Studio I tried the first steps to build my application with the .NET Framework compiler from command line.

    I downloaded the .NET MF Framework SDK 2.5 and installed it on a Virtual PC. This download includes all the DLLs including the core library for .NET MF. The compiler itself comes with the standard .NET Framework 2.0.

    For testing purpose I created a new .NET MF project and copied Program.cs and GPIOButtonInputProvider.cs in a temporary folder. Next I created following batch file which will compile and start the .NET MF Emulator:

    SET NET_BIN=%windir%\Microsoft.NET\Framework\v2.0.50727

    SET MF_VER=v2.0.3036
    REM SET MF_VER=v3.0

    SET MF_BIN=%programfiles%\Microsoft .NET Micro Framework\%MF_VER%\Tools
    SET MF_LIB=%programfiles%\Microsoft .NET Micro Framework\%MF_VER%\Assemblies

    "%NET_BIN%\csc.exe" /noconfig /nostdlib+ /optimize- /r:"%MF_LIB%\mscorlib.dll" /r:"%MF_LIB%\Microsoft.SPOT.Native.dll" /r:"%MF_LIB%\Microsoft.SPOT.Graphics.dll" /r:"%MF_LIB%\Microsoft.SPOT.Hardware.dll" /r:"%MF_LIB%\Microsoft.SPOT.TinyCore.dll" /out:Program.exe /target:exe *.cs

    "%MF_BIN%\MetaDataProcessor.exe" -loadHints mscorlib "%MF_LIB%\mscorlib.dll"
    -loadHints Microsoft.SPOT.Native "%MF_LIB%\Microsoft.SPOT.Native.dll"
    -loadHints Microsoft.SPOT.Graphics "%MF_LIB%\Microsoft.SPOT.Graphics.dll"
    -loadHints Microsoft.SPOT.Hardware "%MF_LIB%\Microsoft.SPOT.Hardware.dll"
    -loadHints Microsoft.SPOT.TinyCore "%MF_LIB%\Microsoft.SPOT.TinyCore.dll"
    -parse Program.exe -minimize
    -compile HelloWorld.pe

    /load:HelloWorld.pe /load:"%MF_LIB%\mscorlib.pe" /load:"%MF_LIB%\Microsoft.SPOT.Native.pe" /load:"%MF_LIB%\Microsoft.SPOT.Graphics.pe" /load:"%MF_LIB%\Microsoft.SPOT.Hardware.pe" /load:"%MF_LIB%\Microsoft.SPOT.TinyCore.pe"

    Well, I found a solution to build my .NET MF projects and got my DLL and PE files. The only missing part is deploying the files to a real device which is not working outside of Visual Studio.

    How to deploy your .NET MF application?

    Some weeks ago I tried to deploy an .NET MF application using MFDeploy. I was searching for an solution how I could deploy my application without installing Visual Studio. Well, the problem was that I wasn’t with the customer and I couldn’t install Visual Studio on their PCs as they are using Visual Studio 2008 and I needed Visual Studio 2005 for the .NET MF 2.5 version.

    With MFDeploy you can extract the flashed image into HEX files. Those HEX files you can use to deploy / flash other hardware identical devices. Is there really no way to deploy an application without Visual Studio? What is the magic behind this flashing procedure?

    I asked the .NET MF newsgroup and got following answer:

    Then you'd need to get that device from the customer, test your application
    on it and create a master image from that.

    Hm, that’s not really nice for me (and the customer, of course). My solution: I have installed a Virtual PC with Visual Studio 2005 trial edition and have successfully installed my new application on that device. Hopefully there will be any tool in the future that let’s you flash your application remotely without Visual Studio.

    Friday, February 27, 2009

    MSDN Premium Subscription with Visual Studio 2008

    working file I have another free MSDN Premium subscription which I will give you for free.

    Well, what you have to do is to link to my blog and add a comment with a link to your page, that’s all. In about 2-3 weeks I will create a simple application that will run a lottery on a .NET Micro Framework device and tell me the lucky winner.

    For more details what is included have a look at the subscriptions comparison page at MSDN.

    Wednesday, February 25, 2009

    The .NET Micro Framework Home – Microsoft’s new start page

    Microsoft has released a new start page for the .NET Micro Framework.

    imageIf you are new to the .NET Micro Framework you will have a look at the Getting Started page. There you will find everything you need to start right now developing great devices.

    What hardware should I use? Have a look at the Get Turnkey Hardware overview. Jan has a more detailed overview on his hardware comparison.

    The Microsoft .NET Micro Framework team has its own blog which is available here. Developers should have a look at the MSDN section for .NET Micro Framework.

    And don’t forget to fill out the survey for next version 4.0.

    Tuesday, February 24, 2009

    Managed Driver for C6820 Camera Module

    imageFreesc Huang has started to build a C6820 camera module driver written in managed code. His project is available including source code at CodePlex. The C6820 camera offers JPEG images.

    There is another implementation for the .NET Micro Framework for the C328R camera.

    Serial Communication in .NET Micro Framework

    Celiker wrote a short demo how to use serial communication in .NET Micro Framework using the Tahoe-II device.

    public SerialPort c1 = new SerialPort("COM1", 9600);
    private void OnButtonUp(object sender, ButtonEventArgs e)
            switch (e.Button) // e is the event record
                case Button.VK_RIGHT:

                    byte[] gond = System.Text.UTF8Encoding.UTF8.GetBytes
                         ("Second : "+DateTime.Now.Second.ToString()+"\n");

                    c1.Write(gond, 0, gond.Length);
        catch (Exception ex)
            text.TextRuns.Add("HATA : "+ex.Message, Resources.GetFont
            (Resources.FontResources.small), Colors.Red);

    Read full story and download source code at CodeProject.

    Don’t forget to have a look at the SerialPortEx class on Pavel’s blog.

    HTTP Server running on .NET Micro Framework

    I have updated the source code files of my simple http server to support http post. You can find the sources at CodePlex project mschwarztoolkit.

    I’m currently running a simple web server live at http://www.control-my-world.com/.

    To use the http server you simple have to create a new instance of HttpServer with the port you want to listen on and implement a IHttpHandler (which will be very similar to IHttpHandler in ASP.NET development).

    using (HttpServer http = new HttpServer(new MyHttpHandler()))
        // http.OnLogAccess += new HttpServer.LogAccessHandler(http_OnLogAccess);
        Console.WriteLine("Shutting down http server...");

    Have a look on a very simple implementation of IHttpHandler:

    class MyHttpHandler : IHttpHandler
        public MyHttpHandler()

        #region IHttpHandler Members

        public void ProcessRequest(HttpContext context)
            context.Response.ContentType = “text/html”;
            context.Response.Write(“<body>” + context.Request.Path + “<br/>”);


    The demo above will simply return a html file containing the requested path and the current time on the device.

    I will add some more examples next to read some values from XBee modules (temperature sensor) and update those values using AJAX.

    SD Card Issue on Tahoe Boards – new release available soon

    Some developers have reported an issue with some SD cards used on a Tahoe-II board. The same happens to me that some SD cards are readable and other not. Martin Welford has confirmed this issue some minutes ago and announced a new release:

    We have found the SD card issue.  The cards that don't work are formatted with an MBR (which is not part of the SD spec, and hence not supported by the MS driver).  Re-formatting and removing this is not easy to do, and we are working on a solution to this now.  A new release wil follow as soon as this is sorted.

    Keep an eye on my blog or subscribe the Device Solutions blog.

    .NET Micro Framework SDK 3.0 February 2009 Documentation Update

    If you don’t have already updated your .NET Micro Framework SDK docs, here you’ll find the new version.

    This download provides an update to the .NET Micro Framework Platform SDK version 3.0 documentation. Please install the Micro Framework SDK v3.0 (see link below) before performing this update.

    image.NET Micro Framework 3.0 SDK must be installed.

    Did you had a look at the new video to see how the .NET Micro Framework is driving innovation by making small-device development easier and faster?

    What’s next with .NET Micro Framework 4.0?

    netmf4 Microsoft has opened a survey on Microsoft Connect concerning the next version of .NET Micro Framework:

    The purpose of this survey is to obtain inputs and feedback from valuable industry thought leaders like you to help design the next version of our product. Please respond to the following questions to the best of your ability. Thanks in advance for your participation!

    What is the .NET Micro Framework more commonly known as? How likely are you to use .NET Micro Framework for your next embedded development project? While selecting a platform for your next embedded project, which one of the following do you think will be the most important?

    I’m looking forward running first tests on .NET MF 4.0 and to see more .NET MF enabled devices. Currently I see that some companies that have started building .NET MF devices stopped at version 2.5, others are starting right now with the latest version and all the great features.

    Monday, February 23, 2009

    GM862 GSM and GPS Module Class

    image Else is using a GM862 GSM and GPS module from SparkFun in his Dare to Dream Different Challenge project. The GM862 is using AT commands (comparable with XBee modules) and could be easily used on .NET Micro Framework devices. He as uploaded an example program on his page.

    Here are some source code lines he is using for to talk with the modules:

    // Initialize GSM/GPS Device
    GM862 = new GM862GPS("COM1");

    // Make sure GM862 is in command state

    // Wait until GM862 is ready
    while (true) {
        try {
            GM862.ExecuteCommand("ATE1", 500);
        } catch {

    // Store new pinRequest Handler
    lock (GM862)    {
            GM862.getRequestedPIN = GM862_pinRequest;

    Tahoe and Tahoe-II – don’t mix firmware updates

    Last week I tried to update my Tahoe boards. While downloading updated SDKs I first started to flash the firmware on the newer Tahoe-II board (the one with the XBee connector). When finished I tried to publish my .NET MF application using Visual Studio 2008, but I could not get the screen working, it leaves black. Oh no, I need this device this week, please no hardware problem. I contacted Devices Solutions and while clicking on the Send button in my mail client I noticed that I have flashed my new Tahoe-II with the firmware of the older Tahoe board.

    Well, I could easily flash the correct firmware to the Tahoe-II board and my screen comes back. Martin told me that they will add a check maybe in further firmware updates.

    Wrong Date and Time on my .NET MF Device

    Since embeddedworld2008 in Nuremberg I'm playing in my free time with the .NET Micro Framework and the Digi Connect ME network device. I've created a small Web server and ported the Ajax.NET Professional library to the really cool and small .NET framework.

    When I reset such a device the current date and time gets wrong, too. This is very bad as I would like to have always the correct time, of course. Especially when you are working with Web servers it is very important to have the correct time because http headers contain date info when files should expire or how long they are allowed to be cached locally in Web browsers cache.

    I have created a simple method to query a NTP server and set the device date to the returned value. Here is the code:

    public static DateTime GetNetworkTime() {
        IPEndPoint ep = new IPEndPoint(
            Dns.GetHostEntry("time-a.nist.gov").AddressList[0], 123);

        Socket s = new Socket(AddressFamily.InterNetwork,
                                                            SocketType.Dgram, ProtocolType.Udp);


        byte[] ntpData = new byte[48]; // RFC 2030
        ntpData[0] = 0x1B;
        for (int i = 1; i < 48; i++)
            ntpData[i] = 0;


        byte offsetTransmitTime = 40;
        ulong intpart = 0;
        ulong fractpart = 0;

         for (int i = 0; i <= 3; i++)
            intpart = 256 * intpart + ntpData[offsetTransmitTime + i];

        for (int i = 4; i <= 7; i++)
            fractpart = 256 * fractpart + ntpData[offsetTransmitTime + i];

        ulong milliseconds = (intpart * 1000 + (fractpart * 1000) / 0x100000000L);

        TimeSpan timeSpan = TimeSpan.FromTicks((long)milliseconds *

        DateTime dateTime = new DateTime(1900, 1, 1);
        dateTime += timeSpan;

        TimeSpan offsetAmount = TimeZone.CurrentTimeZone.GetUtcOffset(dateTime);
        DateTime networkDateTime = (dateTime + offsetAmount);

        return networkDateTime;

    To set the returned DateTime as new time on the device use following utility method:


    Note, that the current time zone is often wrong, too. Use following method to set the time zone to the correct value, in my example I use the time zone here in Germany:


    I put this code in the Main() method of my applications to get always the correct date when I start my device.

    Newer devices have a battery on board that will hold the date and time information and don’t require a NTP request or manual set.

    Wake-on-LAN (WoL)

    Well, I love the easy development of embedded devices with the .NET Micro Framework. As the device I'm currently using is really small I tried to build a small Web site on it to start my private servers at home using Wake-on-LAN. You'll find a lot of helper methods samples on the Internet but I couldn't find on source code that was working on the .NET Micro Framework. The problem is that there are too many missing methods or enum values.

    Here is the source code I'm using now which is working.

    public static void WakeUp(byte[] mac) {
        using (Socket socket = new Socket(AddressFamily.InterNetwork,
                                                                               SocketType.Dgram, ProtocolType.Udp))
            IPEndPoint endPoint = new IPEndPoint(new IPAddress(4294967295), 40000);
            // IP


            byte[] packet = new byte[17 * 6];
            for (int i = 0; i < 6; i++) packet[i] = 0xFF;
            for (int i = 1; i <= 16; i++) {
                for (int j = 0; j < 6; j++) {
                    packet[i * 6 + j] = mac[j];


    My network related library for .NET Micro Framework (as well as .NET Compact and the desktop/server version) includes this method.

    MFDeploy and MAC Address / DHCP

    Some months ago I received a Embedded Master development kit from GHI Electronics. First I tried the examples that are already on the board, wow, working great. To get a network application working I had to change the IP address (or change it to use DHCP). I downloaded MFDeploy (MSDN Library) from the Microsoft Download site. The manual says that you have to enter 00-21-03-80-00-00 and for the last two numbers you have to use the hex value of the serial number of the board. I tried this but MFDeploy didn't accept my value until I have noticed that I have to use the colon instead of the dash as separator.


    For those of you trying to use DHCP enter for all IP addresses, but don't forget to put in your MAC address as DHCP servers need this.

    3 Examples using MSchwarz.Net.Dns

    My small .NET library which covers some network related protocols includes a DNS library. With this library you can query a DNS for i.e. the A record (IP address of a domain) or the corresponding mail server of a given domain (MX record). Here are three examples using the library.

    All queries are working the same: you have to build a DnsRequest that includes the Question. The Resolve method of the DnsResolver will return a DnsResponse which contains the answer (or answers).

    On a desktop .NET environment you can automatically load the DNS settings of the network adapter (for .NET Micro Framework this will be added next).

    DnsResolver dns = new DnsResolver(); dns.LoadNetworkConfiguration();

    Or by specifying the DNS server in the constructor (currently necessary in .NET MF):

    DnsResolver dns = new DnsResolver(IPAddress.Parse(""));


    1) Query IP Address of a given Domain (A Record)

    DnsResponse res = dns.Resolve(
        new DnsRequest ( new Question ( www.ajaxpro.info, DnsType.A, DnsClass.IN ) )

    You will now have one or more answers in your DnsResponse:

    foreach(Answer a in res.Answers) {

    2) Query MX Records (Mail Exchange)

    Instead of DnsType.A in the above example we’re using DnsType.MX, now. The rest of the code to write is the same. The MX record contains a Preference and a Domain that will be responsible for receiving mails for the domain. This can be accessible in the Record property of the Answer instance:

    foreach(Answer a in res.Answers) {
        MXRecord mx = a.Record as MXRecord;
        if(mx != null) {
            Console.WriteLine(mx.Preference + " " + mx.Domain);

    3) Reverse DNS Lookup (PTR Record)

    For PTR records you need to specify the IP address instead of a domain name in the Question object.

    string ip = "";
    Question q = new Question(ip, DnsType.PTR, DnsClass.IN);

    DnsResponse res = dns.Resolve(new DnsRequest(q));

    AUG AMI DevKit shipping

    AUG Elektronik GmbH has sent me AUG AMI DevKit for the .NET Micro Framework 3.0. I have received the package last weekend. Have a look at the content of the box:


    The contents in detail are

    • the AMI board (MH080407 Rev. 2)
    • 3.4" AMOLED display in a plastic housing that can be screwed to the AMI board
    • resistive touch screen glued on top of the display
    • 4 plastic screws used as a stand for the display and board
    • a 1 GB Kingston USB-stick containing full documentation in PDF format and install-files for SDK, samples and more
    • a 5 V regulated power supply plug (110..240 V AC, 50/60 Hz)
    • USB-flash adapter cable for SAM-BA
    • serial cable (RS-232 PC pin assignment - use a null-modem-cable to connect to a PC)
    • DBGU serial cable (RS-232 device pin assignment - directly connect to a PC)
    • standard USB A-B cable
    • standard Ethernet patch cable
    • "Getting Started" document in printed form

    My first experience was to put my little web server on the device, everything is working. What makes me very happy is the OLED display where colors look really nice compared to typically used TFT screens. I will publish some photos I have taken later this afternoon.