Geeks With Blogs
Blair's Burnt Offerings My weblog about .NET and other worldly things

I have been busily working away at building infrastructure for the Dare to Dream Difference Challenge.  Since my last post, I have finished the hardware prototype, although I still need a cabinet.  The project now consists of a Device Solutions Tahoe II development board, an XBee Series 2 module, an AR1010 FM Receiver, an LM4832N audio amplifier, and two 0.5 watt speakers (pictured here).  Not pictured is the ZigBee base station.

HardwareProto1

I have made a shift in the approach I was taking for the software.  Originally, I was going to have my home server update the bedside clock through the ZigBee interface.  Sure, that was cool.  Having the bedside clock update the feeds itself over Ethernet, now that is really cool!

One problem: the Micro Framework has sockets, but no HTTP support--yet.  Jim Mateer has confirmed that HTTP is an approved feature in the next major release of the Framework, which is unfortunately too late. So, I wrote the web support classes from the System.Net namespace with enough functionality to keep me going. Namely, I implemented WebRequest, WebResponse, WebHeaderCollection, WebException, HttpWebRequest, and HttpWebResponse to support only HTTP 1.1, and not HTTP 1.0, HTTPS, cookies, caching, asynchronous operations or authentication.   I followed the behaviour I needed as best I could to allow me to replace my implementation with the official implementation from Microsoft when it is released.  With these classes I am able to download RSS feeds directly on the bedside clock.

I also ported an NTP client written by Valer Bocan.  He wrote this in the 1.0 days, which was perfect for Micro Framework. 

So now the bedside clock updates its time from a time server on the internet, it can fetch RSS feeds, and it can tune to FM radio stations and adjust the volume, treble and bass.

Here is a list of things of things I learned since the last update:

  • Don’t try yield to implement IEnumerable.GetEnumerator() because it won’t work.  You will instead have the MetaDataProcessor fail with an informative E_FAIL.
  • Reference MFDpwsExtensions.dll to get access to the System.Ext namespace.  That’s where I found Uri implemented.
  • Speaking of this, System.Ext.Net and System.Ext.Net.Sockets are documented, but the classes in these namespaces have gone AWOL.
  • TcpClient and UdpClient are not available, so you will have to do things the old fashion way with Sockets.  Fortunately, NetworkStream is available!
  • In order to use extension methods, you will need to provide an implementation of System.Runtime.CompilerServices.ExtensionAttribute.  More good news is that the other C# 3.0 compiler features I tried (lambda expressions, object initializers, and automatic properties) work great. Linq is out because of lack of generics support.  Update: Appears Linq is possible.  Thanks, Jens!

For the next update, I will be working with the Micro Framework’s WPF implementation to start building the user interface.

Posted on Sunday, March 1, 2009 12:47 AM .NET Micro Framwork , Challenge | Back to top


Comments on this post: Dream Challenge, Update Three

# re: Dream Challenge, Update Three
Requesting Gravatar...
Hey there, just noticed you're using the ar1010. The datasheet for that little guy is rubbish, just wondered if you'd be able to get it working, and if you had any tips or tricks?

kind regards
Ian.
Left by Ian Harris on Mar 01, 2009 7:30 AM

# re: Dream Challenge, Update Three
Requesting Gravatar...
You're right, these datasheets are really rough!

I was able to piece together enough information to tune stations so far (mostly from information on the SparkFun site). I need to do more work to "imply" the information I need and much more experimentation to finish my project. I am just at the beginning of discovery.

The weird thing is that it is way too hard to get these datasheets and information on the internet and I don't understand this. Once you find the documentation, it is stamped confidential all over. What's so secret about their API?

If you ordered from SparkFun, they can provide the programming guide which is marginally better.

Blair.
Left by Blair on Mar 02, 2009 8:44 PM

# re: Dream Challenge, Update Three
Requesting Gravatar...
Linq on the .NET Micro Framework is possible, even without Generics:-)

http://bloggingabout.net/blogs/jens/archive/2009/02/09/implementing-linq-on-the-net-micro-framework.aspx
Left by Jens Kühner on Mar 04, 2009 4:27 AM

# re: Dream Challenge, Update Three
Requesting Gravatar...
Good luck man... Have you got any videos about your prototype?
Left by Celiker BAHCECI on Mar 20, 2009 3:59 AM

# re: Dream Challenge, Update Three
Requesting Gravatar...
Not yet...but the challenge requires that I create one. Perhaps I will post it on YouTube.
Left by Blair on Apr 01, 2009 6:40 AM

# re: Dream Challenge, Update Three
Requesting Gravatar...
Very beautiful project!!
I've seen that you used an AIROHA AR1010 for FM Radio. I would like to do the same with a Microframework board. Can you share some informations on it please?
I have that module but the datasheet doesn't tell how to communicate via I2C to this chip. Could you help me?
Thanks, and good luck for the competition...

Stefano
Left by Stefano Moccia on Apr 07, 2009 9:55 AM

Your comment:
 (will show your gravatar)


Copyright © Blair Leduc | Powered by: GeeksWithBlogs.net