Netduino is back! Watch Bryan Costanich (formerly of Xamarin) as he walks through hacking a coffee maker into a connected appliance using Netduino and Xamarin. Netduino, recently acquired and relaunched by Wilderness Labs (www.wildernesslabs.co) is getting a new life as a brain for connected things developers that want to be able to use .NET to build connected IOT hardware.
2. - The dream of connected things
- Controlling household electricity with a
relay
- Exposing control via a web API
- Connecting to that Web API from a
Xamarin App
Building a Netduino Powered
Connected Coffee Maker
3. Wilderness Labs
Relaunched Netduino in March.
Added Mac support.
Netduino stock at Amazon.com and
Mouser.com (international).
Building a vNext connected things
platform.
Actively working on Netduino.
7. Power Control
Household electricity (110V/240V) is
controlled by a relay.
Relays are electromechanical and isolate
circuits.
Controlled by a simple on/off via a digital
I/O pin.
Design @ 3D_Print_Designs repo
Assembly instructions in blog.
OutputPort relay =
new OutputPort(Pins.GPIO_PIN_D2, false);
relay.Write(true);
9. Maple Web Server Host
public class RequestHandler : RequestHandlerBase {
private static bool _isPowerOn;
public void getStatus() { StatusResponse(); }
public void postTurnOn() { TogglePower(true); StatusResponse(); }
public void postTurnOff() { TogglePower(false); StatusResponse(); }
private void TogglePower(bool val) {
_isPowerOn = val;
Ports.ONBOARD_LED.Write(val);
Ports.GPIO_PIN_D1.Write(val);
}
private void StatusResponse() {
this.Context.Response.ContentType = "application/json";
this.Context.Response.StatusCode = 200;
Hashtable result = new Hashtable { { "isPowerOn", _isPowerOn.ToString().ToLower() } };
this.Send(result);
}
}
get:/Status
post:/TurnOn
post:/TurnOff
10. Xamarin Mobile App
Xamarin.Forms + HttpClient
async private Task<bool> PowerCommand(string command) {
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://" + _hostAddress + "/" + _apiBase);
var response = await client.PostAsync(command, null);
if (response.IsSuccessStatusCode) {
if (command == "turnon") {
App.ApplianceStatus = ApplianceStatus.On;
} else {
App.ApplianceStatus = ApplianceStatus.Off;
}
}
return response.IsSuccessStatusCode;
}
11. Possible Expansion Projects
On timer.
Feedback loop for heat control w/temp sensor; what temp do
you like your coffee?
Coffee done push notification.
Scheduler.
Imagine waking up, grabbing your phone, and turning on your coffee pot from bed.
Weâre building the worldâs first Connected Things OS. Secure, ultra low power features, over the air updates, managed from the cloud. Runs on real connected things hardware; microcontrollers like the ARM Cortex-M series. Full .NET standard apps + Javascript support.
Developer Platform:
Target .NET developers first. Full .NET Standard 2.0 Support.
Then JavaScript (Node + Johnny Five)
Open OS for other platforms.
Great Netduino documentation
Electronics tutorial
Etc.
A place to get help and meet other netduino developers