16 people following this project (follow)

Inroducing:

NeonMika.Webserver is easy to set up and easy to extend. With minimal code you can achieve great results controlling and accessing your Netduino+.

It is easy to run this on your .Net MF device, as long as it has an ethernet port. It's espacially created for the Netduino, but I think it's no big work to port it to other plattforms.

It provides the following functionalities:

-XML Responses ... Just create an Instance of XMLResponse, give it an URI to listen for and fill a Hashtable with your response keys and values... Voila ;)

-File Response ... No XML Response fitting your URL? Probably you want to watch a file saved on your device? No problem. This webserver will be able to work as a standard webserver just serving .html files, but you also could save Pictures, Music or ... everthing ... on SD and host it via NeonMikaWebserver.

-Complex Response ... Don't want to send a saved file or XML? Probably you want to return dynamicly created ressources? Then just use a Complex Response. Implement your return logic, still using the functionalities of an Basic Response. :)

So this is a "very easy to expand" webserver. Create your webserver with ONE line of code. And just watch it work ;)

Structure:

The basic steps the server runs through are not that complicated at all:
Request receiving -> Request wrapping -> Action -> Response generation -> Response sending

The server methods handles everything for you, except the Action.
Why? Not every project is the same. Everyone has other needs.
So thats why there are different types of responses you can use to expand your server:
  1. XML Responses
  2. Complex Response
  3. File Response

But don't worry, there are already standard actions implemented.
In the latest version of NeonMika.Webserver this are: (In brackets the type of the response)
  1. File response (file) - Sending back files stored on your SD card.
  2. Echo (xml) - Everyone of you should know it - ipnetduino/echo?value=toEcho
  3. SwitchPin (xml) - Just switch some pin from ON to OFF or the other way - ipnetduino/switchPin?pin=0-13
  4. SetPin (xml) - Not sure what state your PIN is? Just use SetPin to turn your OutputPorts ON or OFF. - ipnetduino/setPin?pin=0-13&value=true
  5. IndexPage (complex) - You don't want to use a SD card or don't have one? Just store your index page (html code) as project ressource. - ipnetduino/
  • You can use this completely without SD card (like me) and extend it to your wishes to controll your Netduino via Browser.
  • Or leave your NeonMika.Webserver completly untouched to use it as typical web server for html-files.
  • Or just store every kind of file on your SD card to be able to access files over the network.
  • Or everything together!
    • EVERTHING IS POSSIBLE! --> I should study marketing xD

Documentation:

I try to keep this project easy to understand (I hope so) and very extendable.
I'm trying to comment most of the methods and to keep the wiki (http://neonmikawebserver.codeplex.com/documentation) up to date. Please go there to have a little "Getting started"

Useage:

There are two directories of interest for you:
Framework and Executeable.

Framework contains the basic code for a new project based on NeonMika.Webserver. Check out this folder if you want an untouched version of NeonMika.Webserver).
Executeable will contain little projects created by me that base on NeonMika.Webserver. Check out this folder if you want to see some examples of how to use NeonMika.Webserver


To test NeonMika.Webserver and to have some sample code, just follow these steps:
  1. Just download the code and go to "Executeables/NETMF"
  2. Deploy the project to your Netduino Plus. It should start running.
    1. This sample project using NeonMika.Webserver has the following xml method added to the webserver at runtime: ipnetduino/wave ... Connect LEDs to Pin 0,1,4,5,8,9 and you will see your LED lighting up one after the other

To do:

-Return file list from directory
-Authentification for different areas on the SD (which user is allowed to go where)
-Screenshots
-Videos
-Suggestions!?

Screenshots:

protoIndex.jpg
Prototype for the index.html-page. This will be something like the "control center" for your Netduino+.

switchPin.jpg
The switchPin method returns the selcted pin's new state

echo.jpg
The echo method returns the same value as transmitted to the server (look at the URL)

Changelog:

-Index page (8.11.2011)
-Screenshot of echo, switchPin and index page (8.11.2011)

I appreciate every kind of response. I want this to help the community, so I hope the communty will help me to get this project better and better

Last edited Nov 28 2011 at 7:50 AM by NeonMika, version 15