{"id":1978,"date":"2020-02-16T20:52:55","date_gmt":"2020-02-17T04:52:55","guid":{"rendered":"https:\/\/doubleecpu.com\/?page_id=1978"},"modified":"2020-02-16T20:57:47","modified_gmt":"2020-02-17T04:57:47","slug":"iot-net-core-sensors","status":"publish","type":"page","link":"https:\/\/doubleecpu.com\/index.php\/iot-net-core-sensors\/","title":{"rendered":"IoT.Net Core Sensors"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Required Hardware:<\/h2>\n\n\n\n<p>RaspberryPi 3 B+ ( VNC enabled and configured )<br>SenseHat<br>Windows 10 computer<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Required Software Windows 10:<\/h3>\n\n\n\n<p> Visual Studio Code  <br>gitbash<br><a href=\"https:\/\/www.microsoft.com\/net\/core\">.NET Core<\/a>\u00a0installed<br>.Net IoT Libraries<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>System.Device.GPIO <\/li><li>Iot.Device.Bindings <br>(Repository from github.com\/dotnet\/iot)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2553\" height=\"475\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-2.png\" alt=\"\" class=\"wp-image-1979\"\/><\/figure>\n\n\n\n<p>Clone Repository from github using gitbash from the directory folder where the code will be compiled.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git clone http:\/\/github.com\/dotnet\/iot iot<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Using .NET Core to Build and Publish App<\/h3>\n\n\n\n<p>Using VSCode navigate to the folder:<br> C:[Your Folder]\/iot\/devices\/SenseHat\/samples\/PressureAndTemperature.Sample.cs <br>Start a command Prompt Terminal, then build and compile the source code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dotnet publish -r linux-arm <\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2613\" height=\"808\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-3.png\" alt=\"\" class=\"wp-image-1981\"\/><\/figure>\n\n\n\n<p>This will create the app publish folder that will have to be copied to the RaspberryPi.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1843\" height=\"315\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-4.png\" alt=\"\" class=\"wp-image-1982\"\/><\/figure>\n\n\n\n<p>Using the VNC File Transfer function the Folder can be copied to the RaspberryPi<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1207\" height=\"691\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-6.png\" alt=\"\" class=\"wp-image-1984\"\/><figcaption>click Send Files <br>select the folder under \\bin\\debug\\netcoreapp2.1\\linux-arm\\<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-5.png\" alt=\"\" class=\"wp-image-1983\" width=\"147\" height=\"194\"\/><\/figure>\n\n\n\n<p> click send entire folder and click yes if prompted <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"635\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-7.png\" alt=\"\" class=\"wp-image-1985\"\/><figcaption>The Publish folder contents will be copied to the desktop by default<\/figcaption><\/figure>\n\n\n\n<p>If desired the folder can be cut and pasted to another location i.e. \/home\/pi\/.Net Core\/IoT\/SenseHat<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1066\" height=\"563\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-8.png\" alt=\"\" class=\"wp-image-1986\"\/><\/figure>\n\n\n\n<p>Open the terminal and navigate to the publish folder<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1077\" height=\"311\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-9.png\" alt=\"\" class=\"wp-image-1987\"\/><\/figure>\n\n\n\n<p>Make the sample executable And the run the executable<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"953\" height=\"149\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-10.png\" alt=\"\" class=\"wp-image-1988\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chmod 755 .\/SenseHat.Samples\n.SenseHat.samples<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"204\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2020\/02\/image-11.png\" alt=\"\" class=\"wp-image-1989\"\/><\/figure>\n\n\n\n<p>This will display the sensor data from the RaspberryPi<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding More functionality <\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Adding Different States to the Sample Code <\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Using Docker container to run container with app<\/h3>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Required Hardware: RaspberryPi 3 B+ ( VNC enabled and configured )SenseHatWindows 10 computer Required Software Windows 10: Visual Studio Code gitbash.NET Core\u00a0installed.Net IoT Libraries System.Device.GPIO Iot.Device.Bindings (Repository from github.com\/dotnet\/iot) Clone Repository from github using gitbash from the directory folder where the code will be compiled. git clone http:\/\/github.com\/dotnet\/iot iot Using .NET Core to Build and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/doubleecpu.com\/index.php\/iot-net-core-sensors\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;IoT.Net Core Sensors&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1978","page","type-page","status-publish","hentry"],"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/1978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/comments?post=1978"}],"version-history":[{"count":0,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/1978\/revisions"}],"wp:attachment":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/media?parent=1978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}