Just published on Codeplex and GitHub. More details later:
Win10 IoT Core Universal Windows App runs on a Raspberry PI 2 (& desktop) that reads some sensors (on an Arduino board) saves to and from Azure Mobile Service

Codeplex Project:


https://iotazuresensors.codeplex.com/



This project has taken about a week to get it to this first release. A bit more work to do with the Arduino code to make it work more efficiently. Consists of two projects, the UW App and the Arduino Sketch

Updates

    1. Second Release (V5): Serial code now can auto load port via settings. Can set the Id string or its list index in menus.json. If found then will autoload when serial page is opened. Still need to press Back.
    2. Third Release (V5.1) : Many "rough edges" removed. A few minor bugs resolved. Better Serial and Main UI's. LCD Keypad actions now work properly and Select can be used to return from Serial Page.
    3. Fourth Release: Now have Bluetooth Serial Option instead of USB Serial.

Functionality for UW App

  • Is a Windows 10 Universal Windows app that runs on Windows 10
  • Primary target is though Windows 10 IoT Core.
  • A menu array of buttons is auto generated at startup from a a Json file that also contains some config settings. Easy to add/remove button, reconfigure
  • Buttons provide various actions with resect to 4 sensors, besides reading current values from the Arduino board, Typical Database CRUD with an Azure Mobile Service Table
  • Same table as previously used with CEJson and Ardjson Codeplex projects.
  • The sample IOT Core Serial app orchestrates the serial communication with the Arduino board.
  • Includes an API for interacting with the Arduino Sensors and LCD display.


You plug the Arduino device's Micro USB in to a RPI2 USB Host port.

Arduino Shield Functionality

  • Is meant for the Robot Leonard Arduino board that plugs on top of the Raspberry PI 2
  • But there is currently a driver problem with its USB-Serial when used with the RPI2

So using an Arduino Uno

  • Two sensors used each with an additional temperature sensor

- Freetronics DHT Humidity Sensor

- Freetronics Baro (Pressure) Sensor

  • Also Freetronics LCD (Text) Display
  • Can be used instead of the UW App UI
  • All UI commands are actionable (in parallel) by the keypad on the LCD display
  • LCD displays one UI Button command at a time. Can cycle through them in a 2D manner (left,Right,Up,Down) and action with Select.
  • Individual results (read a sensor and get current stored sensor value) show on display other actions show Done when complete.

Screen Shots

 

mainPage

The Main Page: Buttons are all generated from  menu.json

 

serial

The Serial Terminal Page: Adapted from the IoT Serial Example

 

Listins-1PNG

Listing Page – 1: The latest values for each sensor  (Values as stored on Azure Mobile Service)

 

Listings-2

Listing Page – 2: The History of the Humidity Sensor (Values as stored on Azure Mobile Service)

 

Code

menu.json

gg

 

  {
    "ElementConfig": 
      
    
  },
  {
    "MainMenu": 
      [ "_", "Setup Serial", "Show sensor list", "Back to sensor list","=Sensor"],
      ,
      ,
      ,
      ,
      ,
      ,
      ,
      
    
  },
  {
    "SecondMenu": 
      [ "a" ],
      [ "b" ],
      [ "c" ]
    
  },
  {
    "ThirdMenu": 
      [ "a" ],
      [ "b" ],
      [ "c" ]
    
  }

The Json text is an array of an named arrays (ElementConfig, MainMenu,SecondMenu and ThirdMenu)

 

  • ElementConfig: This is an array of name-value pairs as  app configuration settings. Note that the first character in the name sets the data type (i= int, c=char and s=string)

MainMenu: This is an array of an array of strings. It is 2D array of the UI Command Buttons. (Those with _ prefix are TextBlocks and those with = are TextBoxes)
The first column (TextBlocks) states the command
The third row (TextBoxes) is where the individual sensor values are written.

The buttons are the sensors to action the command with.

  • SecondMenu, ThirdMenu: Just to show you can load other menus. Not used.

 

These entities are read into lists which are then used by the program.