Showing posts with label WIndows. Show all posts
Showing posts with label WIndows. Show all posts

Friday, June 5, 2015

Windows IoT on Raspberry Pi 2 - Part 1 Set Up

[Disclaimer: I work for Microsoft, but I try not to be biased :)]

[Update 7/21/2015: Regarding the reason why I did not see a output screen was because the device was operating in a headless mode. After changing the mode I was able to see the screen, which was important when starting to do builds. More information here]

I received an email about Windows IoT image being publicly available a few days ago and decided to give it a go. I basically followed the link below, which leads to other sites such as Windows 10 Preview and Visual Studio 2015 Preview links as the need arises. Save some time to complete all the steps, especially if you dont already have Windows 10 Preview.


http://ms-iot.github.io/content/en-US/GetStarted.htm


I wont repeat my installation steps, but instead will document what I saw different and some catcha's that was in my installation experience. If you are interested, I found at least one other post that shared their installation experience:


http://techcrunch.com/2015/04/30/how-to-install-windows-10-iot-on-your-raspberry-pi-2/#.vvglfg:5B1f


Notes I took:



1. The initial boot took a really long time after getting the image onto the board. So be patient. :) 
2. I didn't see a nice 'Windows 10 IoT Core Insider Preview screen like this, instead I just see a blue screen stating the IP address and basic information (below). 
3. My USB keyboard did not seem to work. I tried both a wireless keyboard/mouse combo that worked on other Raspberry Pi's as well as a wired one.
4. My HDMI monitor had distorted image (the image below was from a conference room projector). Plus my USB keyboard did not work, so I ended up using the 'App to Watch for IoT Boards on Your Network' to discover the board IP documented here (below). 
5. Initially when I entered the command to trust the local machine, I used LAN for the board and wirless for the PC, which did not work. If I put both on LAN, it discovered correctly and worked.
6. Remember to disable 'Use Authentication' in Visual Studio remote machine property. 

Working Blinky sample program:



The screens I saw during initial bootup: 






Windows IoT discovery program (right click on the device will bring up some access options):



Disable Use Authentication when specifying remote machine in VS2015:





In part 2, I would like to experiment with Python Tools for Visual Studio 2015 Preview.


Happy Coding!





Monday, May 18, 2015

PyInstaller for Converting Python Script to Windows Executables

I have always known about Py2Exe as a way to convert Python script to Windows executable. Recently I had a need to convert a simple Python FTP script to a Windows device. Py2Exe module did not work for me, searching for the error did not reveal too much information about the error itself, but rather another tool that 'just works'. The tool is called PyInstaller and at least for me, works out of the box. 

Here is my FTP script following this Stackoverflow post: http://stackoverflow.com/questions/24586016/

from pyftpdlib.authorizers import DummyAuthorizerfrom pyftpdlib.handlers import FTPHandlerfrom pyftpdlib.servers import FTPServer
authorizer = DummyAuthorizer()authorizer.add_user("user", "12345", ".", perm='elradfmwM')authorizer.add_anonymous(".",  perm='elradfmwM')
handler = FTPHandlerhandler.authorizer = authorizer
server = FTPServer(("0.0.0.0", 2121), handler)server.serve_forever()
Here is my conversation output:

> pyinstaller.exe .\my_ftp.py
31 INFO: wrote <path>\my_ftp\my_ftp.spec
47 INFO: Testing for ability to set icons, version resources...

In the dist folder of the newly created my_ftp folder will contain the .exe file. 

Happy coding!