MFToolkit - new release (VS2010 support / .NET MF 4.1)
#1
Posted 05 November 2010 - 01:21 PM
http://michael-schwarz.blogspot.com/
http://www.ajaxpro.info/
#2
Posted 05 November 2010 - 01:36 PM
Hi,
because it was already requested several times I have published the changes concerning Visual Studio 2010 and .NET MF 4.1. You can download the latest release here (including the LE / BE files):
http://mftoolkit.cod...ases/view/55143
Here is a short example how to use the Web server to turn on the embedded LED on the Netduino Plus:
using ... namespace NetduinoApplication1 { public class Program { public static void Main() { MFToolkit.Net.Web.HttpServer http = new MFToolkit.Net.Web.HttpServer(new MyWeb()); http.Start(); while(true) { Thread.Sleep(1000); } } } public class MyWeb : IHttpHandler { public OutputPort led1 = new OutputPort(Pins.ONBOARD_LED, false); public void ProcessRequest(HttpContext context) { switch (context.Request.RawUrl) { case "/": context.Response.ContentType = "text/html"; context.Response.WriteLine("<html><head></head><body>Current Time: " + DateTime.Now + "<br/>"); context.Response.WriteLine("<a href=\"/led_on\">On</a> <a href=\"/led_off\">Off</a><br/<"); context.Response.WriteLine("</body></html>"); break; case "/led_on": led1.Write(true); // turn on the LED context.Response.ContentType = "text/html"; context.Response.WriteLine("<html><head></head><body><a href=\"/\">Go home...</a></body></html>"); break; case "/led_off": led1.Write(false); // turn off the LED context.Response.ContentType = "text/html"; context.Response.WriteLine("<html><head></head><body><a href=\"/\">Go home...</a></body></html>"); break; default: context.Response.RaiseError(HttpStatusCode.NotFound); break; } } } }
Regards,
Michael
Attached Files
http://michael-schwarz.blogspot.com/
http://www.ajaxpro.info/
#3
Posted 05 November 2010 - 04:32 PM
#4
Posted 05 November 2010 - 07:00 PM
#5
Posted 05 November 2010 - 07:50 PM
Awesome stuff! Noob question - what libraries would I reference to use the WebServer on a Netduino or Netduino Plus? I'm not familiar with the meaning of the LE and BE folders. Thanks!
James, use the DLLs in the main folder. The subfolders have "little-endian" and "big-endian" versions of the compact DLL.
"Little-endian" is used by Netduino's SAM7X microcontroller--but some other micros use "big endian". This refers to the order of bytes in a multi-byte data.
Chris
#6
Posted 06 November 2010 - 09:35 AM
Awesome stuff! Noob question - what libraries would I reference to use the WebServer on a Netduino or Netduino Plus? I'm not familiar with the meaning of the LE and BE folders. Thanks!
Hi James,
just reference the MicroHTTP\MicroHTTP.dll, that should copy automatically all references assemblies in your project.
Regards,
Michael
http://michael-schwarz.blogspot.com/
http://www.ajaxpro.info/
#8
Posted 07 November 2010 - 11:20 AM
- James and like this
http://michael-schwarz.blogspot.com/
http://www.ajaxpro.info/
#9
Posted 07 November 2010 - 02:08 PM
#10
Posted 01 December 2010 - 01:35 PM
Very awesome, thank you!
Anyone use or have an example on ho to send Zigbee API packet using the toolkit libary?
XBee oXbee = new XBee("COM1", 9600, ApiType.Enabled); oXbee.Open(); oRequest.ApiID = XBeeApiType.TxRequest64; oXbee.ExecuteNonQuery(oRequest);
How do i assign the address and packet data...can't find any examples to use the libabry.
tony
#11
Posted 09 May 2013 - 05:43 PM
Hi, I'm building an alarm system and I need to send informations to a server when anything happens to the system, now, how can I send a request (using POST or GET methods) from my Netduino Plus 2 to a server of which I know the IP address using your library? (the Netduino Plus 2 and the server are in the same LAN).
For example if a sensor recognise that a door is being opened, it will send a signal to the Netduino Plus 2 and then the Netduino Plus 2 should do something like 192.168.1.5?alarm=intrusion&sensor_code=2 I've finished all the software to manage the sensors and their control, now I've included HTTP.dll from your library (version 10.11.8.1) but I don't know where to start... Thanks!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users