Archive

Archive for the ‘Just Blog'ing’ Category

Native code on ChipworkX using RLP

September 21st, 2009 Elze No comments

The main language for .NET Micro Framework is managed C# code (altrough with some thinkering people got other .NET languages like VB.NET to work). Which is a powerfull yet easy to use language. In combination with Visual Studio this is what makes .NET Micro Framework unique.

The only drawback of this solution is that the managed code is interpreted while running. This takes some time. Therefore it isn’t as fast as running native code. The people at GHI found a solution for this called RLP.

Screenshot of Wolfenstein on ChipworkX

Screenshot of Wolfenstein on ChipworkX

Read more…

Categories: Just Blog'ing Tags:

SHA/HMAC digest class

September 5th, 2009 Elze No comments

I know there are more SHA classes arround for C# but I needed a class that I could incorporate in a program without licence/copyright problems so I’ve written my own class from scratch.

The class supports SHA-1, SHA-224 and SSH-256. The HMAC versions with key are also supported. The comments in the code are the same as the pseudocode found on the Wikipedia page about SHA helping to understand what the code is doing.

Demo code:

// Outputs: SHA-1: 6CD1F13BA07759CCB56D904C02C5509FCDEC30E2
Debug.Print(”SHA-1: ” + HexDisplay.bytesToHex(SHA.computeSHA1(
 Encoding.UTF8.GetBytes(”The quick brown fox jumped up the fence and fell down”)
)));

// Outputs SHA-224: 475F234AC83E68834716DFF035A018AEFF5D575560B694EDD5FD40DE
Debug.Print(”SHA-224: ” + HexDisplay.bytesToHex(SHA.computeSHA224(
 Encoding.UTF8.GetBytes(”The quick brown fox jumped up the fence and fell down”)
)));

// Outputs SHA-256: 8A1C5C14E24F5EA8F04061CA96A389DF77F838D0BEAD3253CFFEF8C880F912AA
Debug.Print(”SHA-256: ” + HexDisplay.bytesToHex(SHA.computeSHA256(
 Encoding.UTF8.GetBytes(”The quick brown fox jumped up the fence and fell down”)
)));

// Outputs HMAC SHA-1: A31FBA759E7E25430CCC746800DFBA9926D3AAB9
Debug.Print(”HMAC SHA-1: ” + HexDisplay.bytesToHex(SHA.computeHMAC_SHA1(
 Encoding.UTF8.GetBytes(”testkey”),
 Encoding.UTF8.GetBytes(”The quick brown fox jumped up the fence and fell down”)
 )));

// Outputs HMAC SHA-224: A36AA9599671BFA825BF8B1444F52E7266E4B0E2C30FD5D920EEA980
Debug.Print(”HMAC SHA-224: ” + HexDisplay.bytesToHex(SHA.computeHMAC_SHA224(
 Encoding.UTF8.GetBytes(”testkey”),
 Encoding.UTF8.GetBytes(”The quick brown fox jumped up the fence and fell down”)
)));

// Outputs HMAC SHA-256: 5AF95A03C056CED859AE31BB320BD620997544102BBFA487FB36CB4731B5A385
Debug.Print(”HMAC SHA-256: ” + HexDisplay.bytesToHex(SHA.computeHMAC_SHA256(
 Encoding.UTF8.GetBytes(”testkey”),
 Encoding.UTF8.GetBytes(”The quick brown fox jumped up the fence and fell down”)
)));

Download:
You can download the class with test program: MF_SHA.zip

Categories: Just Blog'ing Tags:

MFTwitter, A simple Twitter Client

August 22nd, 2009 Elze No comments

Somebody asked if I could make a  Twitter Client for .NET Micro Framework. Afcourse I said, so I started building and within a few hours it’s ready. A simple but yet usefull Twitter Client.

This Twitter client allows you  to view your “friends” timeline. This is the timeline that you see when you go to your startpage. It’s shows your Twit’s and the Twit’s of the friends you follow.

The program consists of two parts. The Twitter library (It’s less fancy than it’s sound. It has only one function :P ) and the WPF display program.

It has some known impovements and issues, as this program is something in between it’s your task to fix it if you want :P

  • Twitter Username and password are stored in code, impovement can me made with an onscreen keyboard
  • The XML response is parsed “in order” so when fields are outputted in an different order
    the parser has to be changed
  • The XML response is parsed “in order” so when fields are outputted in an different order the parser has to be changed
  • The somewhat strange datetime format of Twitter is parsed without checking the UTC offset. I don’t think this is a problem. It seems that Twitter always returns Date/Time with UTC +0000
  • It doesn’t check if Twit’s are removed. It just removes the last one when the list gets bigger then 25
  • Profile images cache could be better
  • Many more :P

Video:
You can whatch a Youtube video below. The interface is fluwent but Windows Media Encoder screwed it up a little. Maybe I will make a new version with my camera and a real device:


Download:
And last but not least you can download the code for Visual Studio 2008:
MFTwitterClient.zip

Categories: Just Blog'ing Tags:

MFBrix a simple ball game

August 17th, 2009 Elze No comments

I want to write a simple but fun app that could showcase/test the functions of the new ChipworkX board. I tought of a simple ball game that could be controlled by moving the board. This is done trough the onboard BMA020 accelerator sensor.

It took me some time to figure out how to do the collision detection but I have an initial version ready. The idea of the game? You have to blast away the purple bricks in the game without touching the red bricks. I’ve done some testing and it’s harder then you think :P

The game isn’t ready yet. The video/source is as demonstration only! The red walls don’t harm you yet and there is only one level. When it’s finished I will upload it to microframeworkprojects.com

You can whatch a YouTube video below:

And download the Visual Studio 2008 solution:
MFBall.zip

Categories: Just Blog'ing, Projects Tags: , , ,

GHI Team: ChipworkX

August 9th, 2009 Elze No comments
ChipworkX development system

ChipworkX development system

In the time that I have been away the .NET Micro Framework community made great progress. The first device running the new 4.0 framework beta comes from GHI Electronics. It’s called ChipworkX and has some impressive features:

  • 200 Mhz 32-bit ARM 9 Processor
  • 64MB SDRAM
  • 256MB NAND FLASH (seen as an internal drive)
  • 8MB NOR FLASH (For user deployment and EWR)
  • 480×272 4.3″ TFT Display with touch screen.
  • 2 SPI (8/16bit), I2C, 3 UART, 1 PWM
  • One-wire interface
  • SD/MMC card connector
  • USB Device port
  • Dual USB Host ports
  • XBee module connector for wireless communications
  • 3D Accelerometer BMA020
  • MP3 & MIDI decoder chip VS1053 with Stereo Speakers and audio jack
  • Real Time Clock Battery
  • Power over USB
  • Net Micro Framework 3.0 hosted, V4.0 ready
  • Windows SideShow
  • SQLite Database Support
  • Native Procedure (RLP)
  • PPP Stack

With the RLP feature you can write native C++ code that can be called from .NET MF without using the MF porting kit (GHI has used this to make a MPEG decoder!) also a database system is provided in the form of a SQLite Database system.

You can find more information at the ChipworkX product page

Categories: Just Blog'ing Tags:

Dream Different Challange – Finalists

August 9th, 2009 Elze No comments

Maybe everybody knows already but the Dare to Dream Different Challange finalists have been announced! Unfortunatly I’m not one of them but still I find it very cool that people put so much and usefull effort into their .NET Micro Framework project.

Here is the list of the finalists (from the contest website)

Hobbyiests

Initial Last Name City Country
A Inochkin Moscow Russia
T Fogg Wallington Australia
T Scherrer Novo Hamburgo Brazil
R Stropek Traun Austria
E Percival Hatfield United Kingdom

Professionals:

Initial Last Name City Country
G Aasgaard Bergen Norway
D Schaffer Rockville, MD United States of America
S Vassiliev Moscow Russia
B Fisher Shiner, TX United States of America
J Ng Seattle, WA United States of America

I whish everybody the best of luck and congatulations!!

Where was Elze? I’m back :)

August 8th, 2009 Elze No comments

Hi!

You may have noticed that I’ve been away for a while. But I’m back. Due to several problems with my landlord refusing to do necessary work on my appartment I’ve decided to move to my parents until I find a new appartment. Al the complications involved with this caused that I had very little time.

But I’ve been on holiday and have a lot of fresh energy! There have been a lot of developments in the mean time, some new MF products, Dare to Dream different finalists announced and a lot more. So I have to dive in these things, expect some more blog items soon!

Elze

Categories: Just Blog'ing Tags:

The Meridan/P and more info on HomeTerm

June 9th, 2009 Elze No comments

I have a Meridan/P from Device Solutions but never given it a propper introduction. The Meridan/P has the same connections and powerfull functions as it’s bigger brother the Tahoe II but in a smaller package  (50mm x 50mm). It lacks the screen and the ethernet connection but both can be added externaly should be needed. The pinout of the connectors match up with the connectors on the Tahoe II so converting your project to this new board is easy!

I use the Meridan/P in my HomeTerm project now as external temperature sensor. The baseboard (Tahoe II) is connected to the Meridan/P with Xbee. The Meridan/P also controls  an RGB LED matrix allowing you to put the temperature sensor in sight. The baseboard sends the current time and external temperature from Yahoo Weather to the Meridan/P and in response to that it sends the current room temperature back.

Read more…

DreamQuest, My Dare to Dream Different Project

June 9th, 2009 Elze No comments

I’ve been working on my Dare to Dream Different Challange for some time now. With the finish of this round comming a little closer (15th of May) I want to lift some of the secrecy thats surrounding it. In this article I’m telling about the idea, sourcecode is not released.

The idea of my project is based on geocaching. Geocaching is a game were the participants use a GPS reciever to search for tressures or “caches”. Each tressure contains information what to do next. Quoted from Wikipedia there are about 800 thousand geocaches registrated on different websites.

The name of my project is called  DreamQuest. The first part of the name, “Dream”, comes from the name of the challange. The second part, “Quest”, comes from what this project provides:  Quests.

A Quest is an combination of the following:

  • Information (Text and images)
  • Questions (Multiple choice and text entry)
  • POI, Point of interest
  • Basic Program

Quests are made on a website and can be shared among users. The .NET Micro Framework device is connected to internet trough GPRS with an GM862 from Telit. This enables users to download and start a quest everywhere.

The visibility of information, questions and POI is controlled by the associated basic program. I’ve written an Basic Intrepeter for .NET Micro Framework (MFBasic) for this purpose. Besides access to the items that make up the quest, the Basic program also has access to the current GPS location and time.

With Basic controlling the visibility of information, questions and POI can be triggered with a host of different triggers, not limited to:

  • Distance from current location
  • Current time
  • Current speed
  • Travelled distance
  • Correctly answered questions
  • Many more..

By showing more and more items with different triggeres an adventure or “Quest” can be held without putting things in the ground but the element of supprise and not knowing what will happen next still existing.

When a user is doing a Quest, a score is calculated, so participants can compete with each other for the highscore enabling the social element.

Also tracking is supported so that you can see the track that you have made while doing a quest.

Categories: Just Blog'ing Tags: ,

OpenStreetmap Control

May 21st, 2009 Elze No comments

For my Dare to Dream Different application I needed to display a map of the area. I used the public source OpenStreetmap tile system. In this system there are a lot of 256×256 pixel images that represent a part of the globe. The way those tiles are named is described on the Openstreetmap website making it easy to use the tiles in a custom application.

The control provided here downloads the tiles in a seperate thread to keep the user interface responsive. The original images are PNG images that .NET Micro Framework doesn’t support. I have a simple converter script on my website. The url is in the sourcecode. You can keep on using that URL for hobby projects but when releasing your application in the wild you should make your own script as i’m not responsible for complaints that the url doesn’t work anymore.

 

 

You can see a Youtube screencast of the application (I recommend switching to HD display!):

 

The source here is provided AS-IS, the control is extracted from the DreamQuest project and parts of the source are removed to make it work independant so you could see some comments that dont make sence. Also I wont update this control in the future, I’ve you want to improve it you have to do it yourself ;-)

The source (Read the notes above): MFOpenstreetmap.zip

Enjoy!

Extra:
Celiker Bahceci from Turkey had about the same idea with the static maps API from Google and put this on CodePlex: http://www.codeproject.com/KB/dotnet/UsingGoogleMapInMF.aspx So if you like my OpenstreetMap control you also check this out!

 

Categories: Just Blog'ing Tags: ,