jboyer43
Posts: 10
Joined: Mon Jun 08, 2015 3:48 pm
Location: Canada

Install _wingpio.pyd

Sun Oct 25, 2015 11:01 pm

As a newbie on Python, I tried many variations of C:\WINDOWS\system32>pip install -e "F:/Download/pywindevices.zip" with about ZERO success.
I appreciate this is a Python issue, but I could not find any answer in the Python forums.
I am trying to run the sample PythonBlinkyServer.
Thanks.
Jerome

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Install _wingpio.pyd

Mon Oct 26, 2015 12:09 am

How far have you got on the steps at

https://ms-iot.github.io/content/en-US/ ... Python.htm?
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

jboyer43
Posts: 10
Joined: Mon Jun 08, 2015 3:48 pm
Location: Canada

Re: Install _wingpio.pyd

Mon Oct 26, 2015 2:15 am

Followed them to the letter... But when deploying (building) the code, it complains that _wingpio cannot be found.
Let me go through other samples and see how they develop. I will be back to you.
Thanks for your fast help!
Jerome

jboyer43
Posts: 10
Joined: Mon Jun 08, 2015 3:48 pm
Location: Canada

Re: Install _wingpio.pyd

Mon Oct 26, 2015 2:38 am

I am getting on the build the code:
Severity Code Description Project File Line
Warning Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly '_wingpio.pyd' or one of its dependencies. The module was expected to contain an assembly manifest. TestingPython C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 1819

Code:
import _wingpio as gpio

led_pin = 5
led_status = gpio.HIGH

gpio.setup(led_pin, gpio.OUT, gpio.PUD_OFF, led_status)

The reference is _wingpio.pyd obtained from pywindevices (https://github.com/ms-iot/python/releas ... evices.zip)
Jerome

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Install _wingpio.pyd

Mon Oct 26, 2015 9:15 am

I would suggest .. ignore wrong thread
Last edited by ricl on Mon Oct 26, 2015 9:43 am, edited 1 time in total.
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Install _wingpio.pyd

Mon Oct 26, 2015 9:29 am

I followed the steps exactly as on the example above and it builds.

You do need to right click References in Solution Explorer and add in _wingpio.pyd as a reference (just navigate to where you put it and add it) but, after that it builds just fine.

Looks like that piece of the documentation needs fixing.
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Install _wingpio.pyd

Mon Oct 26, 2015 9:51 am

Use Windows Devices from Python (e.g. GPIO, I2C, SPI)

•Right-click on the References node in the Python project
•Click Add Reference…
•Click on Browse tab
•Download pywindevices content from here
•Navigate to ARM for RPi2 or win32 for MBM
•Select the PYD file for the device type and configuration you want to use (e.g. _wingpio_d.pyd if a Debug configuration and _wingpio.pyd for a Release configuration)
•Add import _wingpio as gpio to your StartupTask.py
•Start using gpio functions (similar steps for I2C or SPI)
•WinDevices documentation can be found here https://github.com/ms-iot/samples/tree/ ... vices/docs
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

jboyer43
Posts: 10
Joined: Mon Jun 08, 2015 3:48 pm
Location: Canada

Re: Install _wingpio.pyd

Mon Oct 26, 2015 9:18 pm

Thanks to ricl!

The paucity of documentation on running headed and headless was, I guess, my source of frustrations. Success came as I:

- Created a BackgroundApplication (IoT) in Python
- Debugged the application on the PI
- The application now shows in the App X browser
- Application runs as expected and the LED blinks (yes that one!)
- Stop Debugging
- In Powershell, add the application in the startup
- Reboot... everything works as expected.

Caveat:
ZWaveHeadlessAdapterApp_1.0.0.0_arm MUST also be in the startup. If not the PI will not boot.


I am running W10 IoT 10.0.10556
Jerome

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Install _wingpio.pyd

Mon Oct 26, 2015 10:42 pm

I would have hoped that Foreground - Background was the terminology chosen but....
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

jboyer43
Posts: 10
Joined: Mon Jun 08, 2015 3:48 pm
Location: Canada

Re: Install _wingpio.pyd

Mon Oct 26, 2015 11:25 pm

One of my apps is Python-Test-Head-Off :lol:
Jerome

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Install _wingpio.pyd

Tue Oct 27, 2015 1:07 am

:-)
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

Return to “Windows 10 for IoT”