This tutorial is for developing a simple system to "see the availability of a meeting room" based on
- Raspberry Pi B+
- Azure
- Office 365 - Calendar
- Oled Display SSD1306
Architecture
This project is composed by three "block"
- Raspberry Pi B+
- Azure API
- Office 365 -Calendar
I've used the library EWS to manage the availability of a room in Office 365.
http://blogs.msdn.com/b/exchangedev/archive/2014/06/02/ews-managed-api-2-2-now-available.aspx
Unfortunately, this library is unusable by Windows 10 IoT and we need to build a proxy for it.
I've built a proxy in Azure API because is the faster way. Another possible way is to use the xml request from the Windows10 IoT App but is slower to implement.
I've used the Oled display SSD1306 (128x32) because is cheaper then the "classical" touch screen of the Raspberry Pi
Office 365
You need to have an Office 365 Account "up and running". You need to have a "meeting room" configured.
Azure API
I've created this layer for manage the communication of the Raspberry with the Exchange Web Services.
Unfortunately it is impossible to use the "Microsoft Exchange Webservices" Package in a universal App.
This is the step for create an Azure API Layer
- Create Visual Studio project from scratch
- Add NuGet Package from EWS
- Add the model
- Add the logic
- Add scaffolding element
- Add Swagger Support
- Configure the correct username and password in webconfig
This is just a simple Azure API project. You should use it just for educational purposes because how simple this project is!
Creation of the project
from Visual Studio (2015) create a new Asp.net project (and select Azure API App)
Add NuGet Package from EWS
Add the reference to the NuGet package
https://www.nuget.org/packages/Microsoft.Exchange.WebServices
Add the model
in model folder add this file
Add the logic
create a Project folder named EWS and copy this file inside the folder just created
Add scaffolding element
right click on Controller folder, Add, controller
use this file for the new controller created
Add Swagger Support
You can use this link for configure the swagger support for your Azure Api site
- https://azure.microsoft.com/it-it/documentation/articles/app-service-dotnet-create-api-app-visual-studio/
- http://www.nuget.org/packages/Swashbuckle
Configure your web config
add this key in your web config
<appSettings>
<add key="RAusername" value="EWSUsername"/>
<add key="RApassword" value="EWSPassword"/>
<add key="RoomName" value="Room Email"/>
</appSettings>
Deploy on Azure
and test it
open the url of the Azure API and add /swagger
Windows IoT Application
- Create new project
- Wire your Raspberry correctly to the SSD 1306
- Add the support for Azure API
- Add nuget package for OLED ssd1306
- Write the code for handle the appointment
Creation of new Windows IoT project
Create new Windows Universal Platform Project and add the behavior for IoT
The project in github is made with caliburn micro. See the reference on official caliburn micro site
Wire Raspberry and ssd1306
Wire your board using this schema
https://ms-iot.github.io/content/en-US/win10/samples/SPIDisplay.htm
Add nuget package
Add nuget package for handle ssd1306 device
https://www.nuget.org/packages/WindowsIot-SPiDisplay-SSD1306/
Write real code for handle your appointment
This is the main part of the IoT application
for download the full code from github
for my code (i've included Caliburn micro in the project in the github repo) you have to disable the flag "compile with .net native tool chain
Comments