I am a Xamarin MVP, Microsoft Developer Technologies MVP, Microsoft Azure MVP, Architect, Software Developer, Organizer and Sponsor of the Cape Town, and Johannesburg Xamarin User’s Group and father of 2.
Last night was the Cross Platform Iot Session at CTXUG in Cape Town. The turnout was absolutely amazing! Thank you to all for coming it was a really fun evening!
Roger Weiss from Aliens kicked off with an overview of Windows 10 Iot Core and a few demos. These demos featured some awesome use of Microsoft Cognitive services and also some nifty voice controlled home automation.
It was then my turn. Unfortunately Chris van Wyk couldn’t make it this evening. 🙁
The session featured
Visual Micro for Visual Studio
Visual Studio Code with Arduino Extension which is now Open Source.
Xamarin Forms and Xamarin.Android with Android Things 0.41 Preview
The new Xamarin Iot preview for Linux based devices
A great test of the contrib drivers is Pimoroni’s Rainbow Hat. https://shop.pimoroni.com/products/rainbow-hat-for-android-things The Rainbow HAT brings together a lot of the components mentioned above on one board. It’s provided with the Android Things Starter Kit so it’s a very good place to start. The first sample I’ve added here focus’s on this specific HAT.
The sample added is based on the google Weather Station sample. It has one difference, it uses Azure Iot Hubs for cloud messaging.
Push Button (A) to swap display from Temperature and Pressure on the board display
Native UI for RaspberryPi to display weather based on air pressure
Telemetry sent from Android Things Device to Azure via Azure Iot Hubs
Message support from Azure to Android Things Device.
To uses the Iot hub in the sample, the DeviceId, DeviceKey and HostName of an Azure Iot hub will need to be provided. I will do a post specific on Iot Hubs to provide more detail on this in subsequent blog posts. These variables are set in the MainActivity.
private bool _useHubs = true; // Set this to true to use Azure Iot Hubs
_weatherDevice.DeviceId = "<Add Azure Iot Hub Device Id Here>";
_weatherDevice.DeviceKey = "<Add Azure Iot Hub Device Key Here>";
_weatherDevice.HostName = "<Add Azure Iot Hub Hostname Here>";
I’m in the process of creating more samples of the rest of the contrib library. I’m also packaging more third-party drivers from around the community into reusable Nuget packages for Android Things with Xamarin.
I’m also having a lot of fun at the moment with a version of these drivers, built from scratch to work with Xamarin Iot. We can then have these components (and Rainbow HAT) working on Linux devices which will of course be awesome!
That was using Xamarin Iot on Visual Studio for the Mac (Preview). Xamarin Iot is also however available for Visual Studio 2017 on Windows (Preview 2.1) too. Below is the identical solution just running from Visual Studio 2017 on Windows. Have a look!
This is just a quick look at Xamarin Iot running on a Raspberry Pi Zero, this time on Visual Studio on Windows. More in-depth content coming soon!
This is a first look at the new Xamarin Iot functionality found within Visual Studio for Mac 7.1 Preview. I will dig much further into detail in future posts, but lets have a very quick look and it. I’m really excited about this addition to the already awesome Xamarin tooling!
A new project type has been added for Iot. This project type or template will create the solution and project needed to run on the Iot device.
What’s immediately apparent is the new run option for the Iot project type. There’s now a new item called “Manage Devices”
The Iot Device Manager allows all the connected devices to be managed. This setup is very similar to the Mac Agent used for iOS development with the Xamarin Visual Studio for Windows extension, however it will display all the Linux based devices running on the network. In this case and screenshot it’s a Raspberry Pi Zero running Raspian (Jesse). Configuring the device will allow remote deploys to the device from your Mac. This will require a user name and password of a user on the Raspberry Pi. This user will be used to connect to the Raspberry pi via SSH. Also note, SSH needs to be enabled on the Raspberry Pi for this to work.
Now you can start developing your Iot solution. What’s really awesome is, all the things you expect to work will just work. This includes break points and a full debugging experience. All this can happen wirelessly to a “headless” device.
The build and execution process is very similar to the Mac Agent when you do iOS development from Windows (Visual Studio) to a Mac. The difference in this case, it is from a Mac (Visual Studio) to a Linux instance (Raspberry Pi). On the very first execution, the mono run time will be copied over to the device. This will be used to execute the built app. The application itself and it’s “built code” is also synchronized with the Raspberry Pi. This compiled Iot app is then in turn executed on the device remotely.
Lets see it in action! Here is a simple example of the now standard Iot demo of a flashing LED, but running on a tiny Raspberry Pi Zero W. What’s really nice about this implementation is, it runs on devices that is not supported by other Iot platforms, like Android Things and Windows 10 Iot Core. It will run on the myriad of Linux based devices out there.
There is much more to show and tell. So there’s much more blogs to come on this topic! This will also include how Android Things and Xamarin Iot can work together to make cross platform Iot simpler.
I received this today, the Xamarin MVP Award!!! This is truly something special that I can now cross off from my bucket list. Thank you, so much Xamarin and the awesome Xamarin Community! So honored to be receiving this!
Thank you to all that made this possible. It is really really amazing to know that all the years of work that went into assisting and contributing to the Xamarin and Microsoft community, globally and in South Africa has been appreciated!
Thank you once again! And here’s to more community fun and enjoyment!!