Setting up Windows 10 for IoT on your Raspberry Pi

This week at the BUILD conference in San Francisco Microsoft released the first preview of Windows 10 IoT (Internet of Things) for Raspberry Pi 2 (as well as other lovely devices like the Intel Galileo and MinnowBoard Max).

First, as I mentioned in February the Raspberry Pi 2 runs the Windows 10 IoT version. That means there is no "shell" or Windows Explorer. It's not a tiny desktop PC, but rather the core brain of whatever embedded maker thing you choose to build with it. The core of it is Windows. You've got PowerShell, you can run Windows Universal Apps that you write in C#, and you can talk to peripherals.

Over here at http://microsoft.hackster.io there is a great list of projects you can build with Windows IoT, including a cool robot you can control with an Xbox Controller.

Installing Windows 10 on your Raspberry Pi 2

This is an early build so things will change and get easier I'm sure. To be frank, getting the builds for Raspberry Pi took some confusing on my part to download.

  • Go to the Windows Embedded Connect site and sign in.
  • Pick the Build you want. I got Windows 10 IoT Core Insider Preview Image for Raspberry Pi 2.
  • You'll need to install this older "File Transfer Manager" if you don't have it. If you have Chrome, you'll need to click the ".dlm" file and open it with the File Transfer Manager. You'll also need to accept two EULAs.
  • Then you'll get a large ZIP file with the image you want inside. Unzip somewhere.
  • Here's a kicker, you'll need a Windows 10 Preview machine to run these commands and install.
    • I built one with a laptop I had around. I'm not sure why Windows 10 is needed. However, once it's setup you can use Windows 8.1 to talk to the Pi 2 or Remote PowerShell in.
  • You should also get Microsoft Visual Studio 2015 RC.
    • After you install 2015, go try to make a Universal App and it will download the Universal Apps SDK.
  • Follow the instructions here.  Below is my summary along with the gotchas that slowed me down.

Now, plug your micro SD card into your Windows 10 PC (I use a micro to USB adapter) and open an Administrator PowerShell and run:

  • wmic diskdrive list brief and make note of the physical disk number of your SD Card.

next run this and change PhysicalDriveto whatever your SD Card's physical number is.

dism.exe /Apply-Image /ImageFile:flash.ffu /ApplyDrive:\\.\PhysicalDriveN /SkipPlatformCheck

  • NOTE: I had some issues and got "Error 50" on one of my micro SD cards. Changing cards worked. Not sure what's up.

Now, just put your micro SD card into your Pi 2 and boot up your Pi 2 while connected to a display and Ethernet. It will initially startup very slow. It could be 2 to 4 minutes before you get to the main screen. Just hang in there until you see this screen. This is the Default app and just shows the IP Address of your Raspberry Pi 2.

Now, from your local admin PowerShell run these commands to remote into your Pi 2. The default name is MINWINPC but you can also use the IP Address.

net start WinRM

Set-Item WSMan:\localhost\Client\TrustedHosts -Value MINWINPC

remove-module psreadline -force

Enter-PsSession -ComputerName MINWINPC -Credential MINWINPC\Administrator

When the credentials dialog opens, make sure you use yourrpi2machinename\Administrator or yourrpi2ipaddress\Administrator for the user name. I was just using Administrator. The default password is p@ssw0rd and you should change it.

See here how the PowerShell prompt changes to include the remote machine's name after I've remoted in?

On your Windows machine install the MSI that was included in the download. It will start a small watcher utility that will scan your network and look for Microsoft IoT devices. It's easy to lose them if their IP address changes. It also has a nice right click menu for getting to its embedded web server.

Included and running on the image is a web server that will let you explore attached devices and running processes.

You can also deploy applications from here although you'll usually do it from Visual Studio.

As of the time of this blog post they didn't have WiFi and Bluetooth ready yet but they are updating it often so I am sure we'll see updates soon. Here is a list of devices that work today via USB.

There's lots of samples. You can make Background (headless) IoT apps or do ones with a UI since the Raspberry Pi has HDMI built in.

Finally, here's turning on an LED from C# (with comments and defensive code).

using Windows.Devices.Gpio;

private void InitGPIO()

{

    var gpio = GpioController.GetDefault();

    // Show an error if there is no GPIO controller

    if (gpio == null)

    {

        pin = null;

        GpioStatus.Text = "There is no GPIO controller on this device.";

        return;

    }

    pin = gpio.OpenPin(LED_PIN);

    // Show an error if the pin wasn't initialized properly

    if (pin == null)

    {

        GpioStatus.Text = "There were problems initializing the GPIO pin.";

        return;

    }

    pin.Write(GpioPinValue.High);

    pin.SetDriveMode(GpioPinDriveMode.Output);

    GpioStatus.Text = "GPIO pin initialized correctly.";

}

Deploying from Visual Studio

Make sure the remote debugger is running with schtasks /run /th StartMsVsmon and connect with no authentication while it's running.

Now you can deploy a Universal App (with UI!) directly from Visual Studio:

And here is my amazing app. Which is basically just a bunch of controls I threw onto the XAML. But still. Fancy!

Windows Remote Arduino and Virtual Arduino Shields

A few other cool maker things worth pointing out are Windows Remote Arduino and Virtual Arduino Shields. Remote Arduino lets you talk to your Arduino from your Windows  machine using the Firmata protocol. Then you can reach out to an Arduino device and give it commands from a Windows Universal app. The Virtual Arduino Shields lets you use a Windows Phone as a well, just that, virtual shields. Shields for Arduino can add up and when you're prototyping you may not want to shell out for a Gyro or GPS. A cheap phone like a Lumia 530 has like $200 worth of sensors (gps, touch display, gyro, internet, speech, etc) in it that you can exploit.

It's early days but I'm pretty stoked about all the options that Makers have available. The ASP.NET team is in talks with the IoT folks to see if we can get ASP.NET 5 running on Windows IoT on a Raspberry Pi as well, so stay tuned. Get started here.

Related Links


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.

树莓派 2 win 10 IOT的更多相关文章

  1. 树莓派3 Windows 10 IoT Core

    下载地址:https://developer.microsoft.com/zh-cn/windows/iot/Downloads 先下载安装 Windows 10 IoT 核心版仪表板: 安装完成后运 ...

  2. Windows 10 IoT Serials 4 - 如何在树莓派上使用Cortana语音助手

    从Windows 10 IoT Core 14986版本开始,微软已经加入Cortana语音助手功能.之前,我们只能使用本地语音识别,需要编写应用程序,下载到设备中才能实现.从现在开始,微软已经从系统 ...

  3. 基于树莓派的微型气象站设计与开发(Windows 10 IoT Core)

    前言 树莓派(Raspberry Pi,RPi)是专门为学生计算机编程教育而设计,只有信用卡大小的卡片式电脑,可以运行Linux或者Windows 10 IoT Core操作系统.本文将利用树莓派和U ...

  4. Windows 10 IoT Serials 2 - Windows 10 IoT RTM 升级教程

    7月29日,微软推出了Windows 10 for PC的正式版,其版本号是Build 10240.近两天官方说已经有4700万的下载安装量,同时这个数字还在不断攀升.另外,除了Windows 10 ...

  5. 【Windows 10 IoT - 1】Window 10系统安装(树莓派 Pi2)

    一.硬件准备 (1).树莓派Pi2 (2).8G 10速Micro SD卡 (3).LCD显示器(如果是VGA接口,需要加一个HDMI转VGA模块) (4).鼠标 (5).安装Windows 10的P ...

  6. 【Windows 10 IoT - 3】Windows 10 RTM安装及新特性(树莓派 Pi2)

    在<[Window 10 IoT - 1]Window 10系统安装(树莓派 Pi2)>中,我们介绍了Windows 10 IoT预览版的安装,正式版Windows 10 IOT(OS版本 ...

  7. 【Windows 10 IoT - 2】LED闪烁及动画绘制(树莓派 Pi2)

    在上一篇博文<Windows 10 IoT系统安装>中,我们实现了在树莓派2平台上运行Window 10 IoT,本篇文章将介绍在该平台上的程序开发. 在最初获得的资讯中,以为Window ...

  8. Windows 10 IoT Serials 5 - 如何为树莓派应用程序添加语音识别与交互功能

    都说语音是人机交互的重要手段,虽然个人觉得在大庭广众之下,对着手机发号施令会显得有些尴尬.但是在资源受限的物联网应用场景下(无法外接鼠标键盘显示器),如果能够通过语音来控制设备,与设备进行交互,那还是 ...

  9. Windows 10 IoT Serials 7 – 如何用树莓派制作家庭流媒体播放器

    Windows 10平台引入了AllJoyn开源软件框架,它提供了一组服务可以创建动态近端网络,让设备可以相互连接实现功能交互.目前,AllJoyn开源软件框架由AllSeen联盟负责管理.AllSe ...

随机推荐

  1. LeetCode---Word Break 2

    Given a string s and a dictionary of wordsdict, add spaces in s to construct a sentence where each w ...

  2. Git ~ 添加远程仓库 ~Git

    现在的情景是 , 你已经在本地创建了一个Git仓库后 , 又想在 Github 创建一个Git 仓库并且让这两个仓库进行远程同步 , 这样Github 上的仓库既可以作为备份 ,有可以让其他人通过仓库 ...

  3. mantis增加密码修改

    解决方式就是考虑修改Mantisbt PHP程序,增加一个密码修改框,这样管理员就可以直接修改用户密码了.     操作步骤如下:    1) 修改文件 manage_user_edit_page.p ...

  4. 学习笔记:js、css、html判断浏览器的各种版本

    js.css.html判断浏览器的各种版本 (转载自:http://www.jb51.net/web/42244.html  版权归原作者所有) 利用正则表达式来判断ie浏览器版本 判断是否IE浏览器 ...

  5. Cash Machine_多重背包

    Description A Bank plans to install a machine for cash withdrawal. The machine is able to deliver ap ...

  6. 1、网页制作Dreamweaver(界面、基本操作、锚点、表格)

    界面 网页的界面html由两部分组成:<head>和<body>,<title>放在<head>中 1.以下是<head>部分的解释: &l ...

  7. HDU 1622

    http://acm.hdu.edu.cn/showproblem.php?pid=1622 白书上6.3.2二叉树层次遍历的例题,层次遍历用bfs,建立二叉树,很基础的题目 #include < ...

  8. Push推送原理

    Push 的工作机制 APNS 是Apple Push Notification Service(Apple Push服务器)的缩写,是苹果的服务器. 推送可以分为三个阶段. 第一阶段:.net应用程 ...

  9. 《More Effective C++ 》笔记

    条款10 防止构造函数里的资源泄露 条款20 协助编译器实现返回值优化 条款22 考虑使用op=来取代单独的op运算符 条款26 限制类对象的个数 条款27 要求或禁止对象分配在堆上

  10. 64位gcc编译32位汇编

    由于使用as和ld来编译链接汇编程序,在使用C库的时候比较麻烦,需要输入比较多的指令,所以使用gcc进行编译链接.由于书中内容是32位汇编程序,但是机器使用的是64位操作系统,自带的gcc也是64位的 ...