Back in 2012, I found some code online which should have been a Nuget package. I tried to reach out to the original author (even searched for him/her today) but could not find any contact info.

That person created a library to generate QR codes. I packaged it for nuget which was just 1,5 years old back then.

The package is still out there. I don’t have any code on my system for years from that lib. But you can still grab the package here: https://www.nuget.org/packages/MessagingToolkit.QRCode/ 

Or from the package manager in Visual Studio with:

Install-Package MessagingToolkit.QRCode

It has been downloaded over 61.000 times now! So Twitt88 did a great job coding it!

I am porting an other 4 to 6 year old library to .Net Standard 1.4. The current status is up on GitHub https://github.com/jphellemons/PhotoBucketNetStandard

And the Nuget package has been submitted. This one is originally build by Mark Schall so most of the credits are for him. I only rewrote the stuff that is not available in .Net Standard or requires other namespaces.

Let’s all port libs to .Net Standard!

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn

For one of my hobby projects, I wanted to have my source code under source control. Professionally I use VSTS (Visual Studio Team Services) https://www.visualstudio.com/team-services/pricing/ which is great. But this is a hobby project which I code alone. So I did a git init and committed it locally.

I moved the complete Visual Studio solution + project (folder) and hidden .git folder to OneDrive and the cpu started to heat up. OneDrive keeps syncing and uses a lot of cpu. I tried to exclude the .git folder, but that did not help.

So what is the solution?

  1. Move the full folder inc .git hidden dir outside OneDrive
  2. git init –bare c:\Users\youruser\OneDrive\reponame.git
  3. in the dir outside OneDrive: git remote add onedrive c:\Users\youruser\OneDrive\reponame.git
  4. git push –u onedrive master

Do not forget to push sometimes to the remote. Or use in Visual Studio the “commit & push” button.

Thanks to Qiuwen Chen for pointing me in the right direction.

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn

It all starts with installing Windows 10 IoT on a suitable device. I used a Raspberry Pi 2 (Model B) and installed the creators update of Windows 10 IoT. You should really get the dashboard from Microsoft: https://developer.microsoft.com/en-us/windows/iot/downloads


It is really easy to get Windows 10 IoT on your device. Here is a small manual https://developer.microsoft.com/en-us/windows/iot/docs/iotdashboard


If you have your Visual Studio 2017 configured, you can easy deploy to it.

The hardware

I bought stuff from aliexpress. I had no rush, so saved a lot of money Smile

I was inspired by this article https://www.modmypi.com/blog/raspberry-pi-plant-pot-moisture-sensor-with-email-notification-tutorial but that referenced to a moisture sensor for 4 gbp and shipping was also 4 gbp. So just the sensor could cost me 9,40 eur. Which makes it less fun, because the whole idea of a raspberry pi is that you can make an internet of things device with little costs.


I spend only 42 cent on the sensor and bought some male/female, male/male, female/female jumper cables too and even an hdmi to dvi connector so I could connect an external monitor, but never used it.

Ali Url snip_20170504112536

€ 0,42

Ali Url snip_20170504112647

€ 2,19

Ali Url snip_20170504113017

€ 1,14


So I had to spend € 2,61 euro including shipping to get the parts for my Pi 2.

Hardware wiring

Connect the probe to the sensor with two wires. Doesn’t matter which goes where.

Connect the sensor to the GPIO

VCC 3v3 Pin 1
D0 GPIO 17 Pin 11






this is a good page for gpio pins: http://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/



I hit a strange bug with the UWP but fixed it, thanks to stack overflow, by manual creating a project.json file. As said, I was inspired by this article but that is coded in Python. My preference language is still C# and I wanted to try win 10 iot. So I rewrote this python code to C# and got this: 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Http;
using Windows.ApplicationModel.Background;
using Windows.Devices.Gpio;
using Windows.UI.Core;
using System.ServiceModel;
using LightBuzz.SMTP;
using Windows.ApplicationModel.Email;

namespace BackgroundApplication1
    public sealed class StartupTask : IBackgroundTask
        private const int SENSOR_PIN = 17;
        private GpioPin pinSensor;
        private BackgroundTaskDeferral deferral;

        private const string SMTP_SERVER    = "smtp-mail.outlook.com";
        private const string STMP_USER      = "YOURPLANTSADDRESSHERE@hotmail.com";
        private const string SMTP_PASSWORD  = "YOURPASSWORDHERE";
        private const int    SMTP_PORT      = 587;
        private const bool   SMTP_SSL       = false;

        private const string MAIL_RECIPIENT = "iwillwatertheplants@hotmail.com";

        public void Run(IBackgroundTaskInstance taskInstance)
            deferral = taskInstance.GetDeferral();

            taskInstance.Canceled += TaskInstance_Canceled;

            var gpio = GpioController.GetDefault();

            if (gpio != null)
                pinSensor = gpio.OpenPin(SENSOR_PIN);

                var r = pinSensor.Read();


                var dm = pinSensor.GetDriveMode();

                pinSensor.DebounceTimeout = TimeSpan.FromMilliseconds(50);

                pinSensor.ValueChanged += PinIn_ValueChanged;

        private void PinIn_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
            if (pinSensor.Read() == GpioPinValue.High)
                SendMail("Thirsty", "Plant needs water");
                SendMail("I am good", "Plant is fine again");

        private async void SendMail(string subject, string body)
            using (SmtpClient client = new SmtpClient(SMTP_SERVER, SMTP_PORT, SMTP_SSL, STMP_USER, SMTP_PASSWORD))
                EmailMessage emailMessage = new EmailMessage();

                emailMessage.To.Add(new EmailRecipient(MAIL_RECIPIENT));
                emailMessage.Subject = subject;
                emailMessage.Body = body;

                await client.SendMailAsync(emailMessage);

        private void TaskInstance_Canceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)

I used the nuget "lightbuzz-smtp" to send mail https://github.com/LightBuzz/SMTP-WinRT

Have fun with Windows 10 IoT raspberries etc.

Pin on pinterest Plus on Googleplus Post on LinkedIn

Make sure you have Windows 10 with the anniversary update or newer.

You can verify this by pressing the winkey + R and type ‘winver’ and hit enter. The anniversary update has buildnr 14393. And make sure that you have the “Bash on Ubuntu on Windows” feature enabled.

Xmllint is not included by default, so you have to install it first.

sudo apt install libxml2-utils

You can read more about xmllint on http://xmlsoft.org/

in order to format a large XML file which has no line breaks you have to use xmllint like this:

xmllint --format input_xml_file.xml > pretty_output_xml_file.xml

You use the format option on the input_xml_file.xml and redirect the output (>) to a new file with the name pretty_output_xml_file.xml

This is a lot faster than opening the file in notepad++ and use the xml plugin to format it.

Hope it helped. Good luck!


Pin on pinterest Plus on Googleplus Post on LinkedIn

Here are the 9 steps to enable the linux subsystem in the latest Windows 10 version:

  1. Windows key + I (to go to settings)
  2. Update Windows
  3. Select developer menu on left hand side
  4. Make sure that the developer mode is enabled
  5. Go back to the main page of settings
  6. On the right hand side click “programs and features”
  7. Click on install additional features on the left hand side
  8. Check the box for the linux subsystem
  9. Double click on c:/windows/system32/bash.exe to install it



I had to blog this, because the GUI option mentioned on msdn did not work on my locale (nl_nl)



Read more about it on MSDN https://msdn.microsoft.com/en-us/commandline/wsl/about

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn