Access your Netduino from the Web

Make your Netduino accessible from anywhere via the Yaler relay.

Prerequisites

Setting up your device requires a relay domain. Please sign up to get one.

Setting up the hardware

Cuno Pfister's Gsiot.Server library runs on Netduino Plus, Netduino Plus 2, Mountaineer and other .NET Micro Framework boards.

Follow these steps on your Windows computer to make sure that the Netduino's DHCP is on and a MAC address is set.

  1. Start MFDeploy.exe located in
    C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.x\Tools\MFDeploy.exe
  2. Select Device type USB
  3. Plug in your Netduino via USB
  4. Click the Ping button until the Netduino replies with
    Pinging... TinyCLR
  5. To open the network configuration dialog, select the menu
    Target > Configuration > Network
  6. Make sure the DHCP Enable checkbox is checked
  7. Make sure the MAC address is the same as the address printed on the sticker on your Netduino
  8. Click Update to save changes to the Netduino
  9. Reboot the Netduino by unplugging and replugging its USB cable
  10. Done.

Installing the Gsiot.Server library

Follow these steps to add Cuno Pfister's Gsiot.Server library to Visual Studio.

  1. For Netduino Plus, download
    Projects+V20110526... .zip
    For Netduino Plus 2 or Mountaineer boards, download
    Gsiot+samples+for+NETMF+4.2... .zip
  2. On Windows, open the ZIP and copy the folders Gsiot.Server and HelloWeb (and, if available, Oberon.Netmf.Compatibility) to
    C:\Users\USER_NAME\Documents\Visual Studio 2012\Projects
  3. Done.

Running a Web service example

  1. On Windows in Visual Studio, open the project
    HelloWeb
  2. Replace <insert your relay domain here> with your relay domain, e.g. for the relay domain gsiot-ffmq-ttd5 that would be
    RelayDomain = "gsiot-ffmq-ttd5",
  3. Replace <insert your secret key here> with your key, e.g. for the key o5fIIZS5tpD2A4Zp87CoKNUsSpIEJZrV5rNjpg89 that'd be
    RelaySecretKey = "o5fIIZS5tpD2A4Zp87CoKNUsSpIEJZrV5rNjpg89",
  4. Right below, add this line to set your relay host
    RelayHost = "try.yaler.io",
  5. Build and upload the example code to your Netduino
  6. Done. Now, see how to access your device from a Web browser or with Curl (add /hello to make it work).

Learning more

For an excellent introduction and more examples, read the book Getting Started with the Internet of Things by Cuno Pfister.


Creative Commons License This work by Yaler GmbH is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.