Personal Dashboard Showing Calendar Events & Weather Forecast Using .NET Core
Tags: dotnet, raspberrypi, showdev, csharp
Published: 2019-10-24 16:18:27

##Idea

I had this idea in my head that I want to display my calendar, the local weather forecast, and possibly some other things, on some screen.

At first, I was thinking of doing a smart mirror ([Example 1](https://www.hackster.io/SrivishnuTech/make-your-own-smart-mirror-for-under-80-using-raspberry-pi-a87460), [Example 2](https://www.howtogeek.com/414647/how-to-build-a-smart-mirror/)). But I wasn't sure if I wanted to put in all that work for something I might not use. Plus, since my woodworking skills aren't at the highest level, it would have been a pretty clumsy-looking mirror. :/

##Hardware

A couple of months ago, I came across this [touchscreen display](https://thepihut.com/products/official-raspberry-pi-7-touchscreen-display) for Raspberry Pi and a [case](https://thepihut.com/products/raspberry-pi-official-7-touchscreen-case?variant=15155531396) for it. I thought they were pretty neat-looking and would be perfect for my idea. So I ordered the display, the case and a new Raspberry Pi :)

The first order of business was to connect and set up the screen. However, that was not as straight forward as I had hoped. I followed the [assembly guide](https://thepihut.com/blogs/raspberry-pi-tutorials/45295044-raspberry-pi-7-touch-screen-assembly-guide), but after powering on the Pi, the screen was just white, and nothing happened.

I wondered if the Pi was broken or maybe the screen. Yet, the Pi worked if I connected it to a regular PC monitor. So, either the display was broken, or I was missing something.

Finally, I found the solution on [StackExchange](https://raspberrypi.stackexchange.com/questions/34280/white-screen-on-touchscreen-display), and the problem was that I was missing the drivers. Once I installed them, everything worked 'almost' perfectly.

The screen was upside down, but that was an [easy fix](https://www.raspberrypi.org/forums/viewtopic.php?p=902849).


##Software

After the display was up and running correctly, I needed to figure out how I was going to display the information I wanted.

We all know that there are loads of tools available to do this, but I wanted to grow my .NET skills. And I came across a tutorial on building an application using ASP.NET Core called "[The Little ASP.NET Core Book](https://nbarbettini.gitbooks.io/little-asp-net-core-book/)".

Once I had gone through the tutorial, creating a to-do application, I figured I would be able to use this for my idea.

The main items I wanted to display were my calendar and the weather forecast. I found this [quickstart](https://developers.google.com/calendar/quickstart/dotnet) from Google for the Google Calendar API and used that as my base.

I then found a [.NET library for the Dark Sky API](https://github.com/amweiss/dark-sky-core). Along with the forecast, I wanted to display a small image that would represent the forecast. I discovered [these awesome icons](http://adamwhitcroft.com/climacons/) by [Adam Whitcroft](http://adamwhitcroft.com/) and managed to integrate them into my solution.


##Design

Once I was able to get all the data I needed, next on the agenda was to try to make it pretty.

I was delighted when I encountered [freefrontend.com](https://freefrontend.com) and some CSS examples. I found examples for [calendars](https://freefrontend.com/css-calendars/), [weather widgets](https://freefrontend.com/css-weather-widgets/) and I also added the current date and [time](https://freefrontend.com/css-clocks/) to my display.

I haven't done much HTML/CSS work, so it took me some time to get everything to work together. But I was satisfied with the result once I ironed that out.


##"Deployment"

In "[The Little ASP.NET Core Book](https://nbarbettini.gitbooks.io/little-asp-net-core-book/)" the author goes through [two different deployment scenarios](https://nbarbettini.gitbooks.io/little-asp-net-core-book/chapters/deploy-the-application/). On the one hand, using [Azure](https://nbarbettini.gitbooks.io/little-asp-net-core-book/chapters/deploy-the-application/deploy-to-azure.html), and on the other with [Docker](https://nbarbettini.gitbooks.io/little-asp-net-core-book/chapters/deploy-the-application/deploy-with-docker.html).

Both deployment strategies failed for me.

Once I had deployed the application in Azure, I was unable to open the page and got a "Timed Out" error. And my Dockerfile always failed when building.

Because I wanted to test this as soon as possible on my Raspberry Pi display, I didn't bother to figure out what went wrong at this time. So, I used a USB stick to move the solution.

However, my Raspberry didn't have .NET Core, so I was unable to run it there. Thankfully I found a guide on how to install it on a Raspberry Pi in a [blog post by Scott Hanselman](https://www.hanselman.com/blog/InstallingTheNETCore2xSDKOnARaspberryPiAndBlinkingAnLEDWithSystemDeviceGpio.aspx).

Once that was installed, I was able to run the application. I needed to make minor CSS adjustments so it would fit the smaller screen better.

##Future Updates


I'm pleased about how good it looks, and how neat the display is. And it fits well on top of the shoe cabinet.

I'm not 100% sure at the moment if I'll make some improvements but examples of the things I could do/add are:

*   Add/update more data from Dark Sky
*   Fix the deployment process
*   Display my [ToDoist](https://todoist.com) list
*   Motion sensor
*   Voice assistant ([Mycroft](https://mycroft.ai/)?)

Thank you for reading :D

  

PS Here is a similar project I found, using Python and an E-Ink display: [_Dresser Top Dashboard_](https://www.hackster.io/johnjones4/dresser-top-dashboard-913ed3).

---

Thank you for reading. For weekly updates from me, you can sign up to my [newsletter.](https://email.halldorstefans.com/)