Project Bifröst – improving application deployment to Ubuntu and Windows 10

Datetime:2017-04-20 05:36:43         Topic: Ubuntu  Win 10          Share        Original >>
Here to See The Original Article!!!

Project Bifröst is a UWP application for Windows 10 IoT Core which allows .NET Core applications to access the hardware capabilities of the IoT device that the application is deployed to.

Last time I wrotean introductory post explaining how this UWP application works, and wrote quite a lot about how to deploy a sample .NET Core application (called GpioSwitch ). It occurred to me while writing the post that the deployment process currently sucks . So I’ve written some PowerShell scripts to manage the application’s deployment, which are in the GpioSwitch directory.

Improving deployment for the GpioSwitch application

If you want to just build the application, open PowerShell at the GpioSwitch project root and run:

.\build.ps1

Deploy to a running Raspberry Pi 3 with Windows 10

This script has two parameters:

  • ip : the ip address of the Raspberry Pi 3 (mine is 192.168.1.125)
  • destination : the network path to where you want the application to be copied (I created a folder named CoreTest in the root, so the network path is “C$\CoreTest”)
.\deploy-windows.ps1 -ip 192.168.1.125 -destination "c$\CoreTest"

So to now run the application and to set pin 26 to logic high: ssh into your Raspberry Pi 3 (either using PuTTY or Powershell), navigate to the directory that you copied the application to, and run:

./GpioSwitch 26 1

Deploy to a running Raspberry Pi 3 with Ubuntu 16.04

This script has three parameters:

  • ip : the ip address of the Raspberry Pi 3 (mine is 192.168.1.110)
  • destination : the path to where you want the application to be copied (I created a folder named GpioSwitch in my user directory, so the path is “/home/ubuntu/GpioSwitch”)
  • username : the user id that you’ve logged in with (my userid is “ubuntu”)
.\deploy-ubuntu.ps1 -ip 192.168.1.110 -destination "/home/ubuntu/GpioSwitch" -username ubuntu

(This process will prompt you to enter your Raspberry Pi password.)

So to now run the application and to set pin 26 to logic high: ssh into your Raspberry Pi 3 (either using PuTTY or Powershell), navigate to the directory that you copied the application to, and run:

sudo -E /home/ubuntu/GpioSwitch/GpioSwitch 26 1

This is a much better way to deploy applications to a Raspberry Pi hosting Windows or Ubuntu.








New

Put your ads here, just $200 per month.