Microsoft recently came out with initiative to provide special Windows and related tools to build IoT applications: http://www.windowsondevices.com/ . They provide development set consisting of Intel Galileo board and this special Windows version, and were kind enough to contribute it, which I'm taking as a chance to help stijn to maintain Windows version of MicroPython.
So, I tried to run MicroPython and it starts and executes simple commands well. Next step is running the testsuite, and that's where I hit the problems. Testsuite requires CPython (to compare results against), and the latest versions of CPython for Windows are distributed as MSI archive. But Windows for IoT doesn't have "msiexec" tool to install it. I tried to install it via generic redistributable package offered by Microsoft, but that didn't really work. Generally, it seems that any GUI applications don't work on Windows for IoT - it's essentially a headless version of Windows (you work with it accessing command line via telnet).
All the above didn't really stop me, and I installed CPython from MSI on my Linux box in Wine, verified it starts, them carefully copied all its files and (hopefully) all dependent DLLs to Galileo. No avail - CPython doesn't run (no errors, just running command exits immediately). More info may be available to my post to python-dev: https://mail.python.org/pipermail/pytho ... 37234.html
Bottom line? MicroPython already support Windows for IoT better than CPython . I'm currently thinking how to get testsuite on it running.
I hope to update this topic from time to time with more news/results.
Running MicroPython under Windows for IoT
Running MicroPython under Windows for IoT
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Running MicroPython under Windows for IoT
If you have an msi but want a portable version, it is often sufficient to run to get all files out of it. Or else try to open the msi with 7zip.
How did you get micropython running on it exactly? Was it built on the board itself, or a cross-compiled mingw version?
Anyway regarding CPython not running: last time I checked CPython insisted on consulting the registry upon startup. Maybe there is a problem with that. What is the return code?
Haven't looked into IoT but is it possible to build an executable, put it on a suported device and then debug it remotely using Visual Studio? That would by far be the quickest way to figure out where CPython fails.
Code: Select all
msiexec /a PathToMSIFile /qb TARGETDIR=DirectoryToExtractTo
How did you get micropython running on it exactly? Was it built on the board itself, or a cross-compiled mingw version?
Anyway regarding CPython not running: last time I checked CPython insisted on consulting the registry upon startup. Maybe there is a problem with that. What is the return code?
Haven't looked into IoT but is it possible to build an executable, put it on a suported device and then debug it remotely using Visual Studio? That would by far be the quickest way to figure out where CPython fails.
Re: Running MicroPython under Windows for IoT
Thanks for the hints!
That's what I tried, but that leads to flat and mangled filenames, I figure a lot of metadata kept in MSI somewhere else but raw filenames.Or else try to open the msi with 7zip.
Surely, crosscompiled under Linux.How did you get micropython running on it exactly? Was it built on the board itself, or a cross-compiled mingw version?
Both msiexec and python behaved the same, and for both it looked like some missing dependency. I would imagine that on normal GUI Windows at that place there would be popup with the name of missing DLL, but as there's no GUI on Galileo, that's it - silent quit. Of course, it may be not missing DLL, but missing function in it, etc.Anyway regarding CPython not running: last time I checked CPython insisted on consulting the registry upon startup. Maybe there is a problem with that.
Windows has return codes? D'oh, I remember what it is whole day! It's %errorlevel, right? But that can be used only in .bat files, no? Feel free to give an exact command to try next time (which mat take few weeks).What is the return code?
Well, I'm more interested in validating MicroPython on that platform, so currently thinking how to run testsuite without CPython and unix shell.Haven't looked into IoT but is it possible to build an executable, put it on a suported device and then debug it remotely using Visual Studio? That would by far be the quickest way to figure out where CPython fails.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Running MicroPython under Windows for IoT
To run the test suite without CPython, didn't you add an option to generate the .exp files so the output of uPy can be compared against them?
Re: Running MicroPython under Windows for IoT
Yes, and also a unix shell script to run testsuite against those .exp files. What to do when neither CPython nor unix shell is available? Nope, my solution is not to write bunch of implementations in other shells, but to (ab)use micropython to run it. It's not the most formally correct idea to use device-under-test to manage testing itself, but with some caution, why not? Expect patches soon.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Running MicroPython under Windows for IoT
on standard windows you'd check dependencies using dependency walker or dumpbin. (first if freeware, dumpbin is part of VS but you can probably find it standalone on the net)
The first is the nicest one but I'm not sure it'll run as it depends on gdi32.dll which is the graphical layer. Anywaway you use them like
Display return codes with echo %ERRORLEVEL%, doesn't matter if it's in a bat file or not.
Anyway I'll check if it's possible to run IoT in a virtual machine/quemu or so, that would be nice to test it
The first is the nicest one but I'm not sure it'll run as it depends on gdi32.dll which is the graphical layer. Anywaway you use them like
Code: Select all
depends /c /ot:out.txt /path/to/python.exe
type out.txt
dumpbin /dependents /path/to/python.exe
Anyway I'll check if it's possible to run IoT in a virtual machine/quemu or so, that would be nice to test it
Re: Running MicroPython under Windows for IoT
Well, I used to have ldd for (native) Windows: http://mingwrep.cvs.sourceforge.net/vie ... ldd-win32/ . Nowadays I just search for ".dll" in a binary viewer. As I mentioned, I tried to copy any non-system DLLs (like used MSVC runtime) over to Galileo. Of course, there could be user error.
Yes, there's an Windows for IoT SD image provided somewhere on the site in the starter message, feel free to look into it if you have time/interested.
Yes, there's an Windows for IoT SD image provided somewhere on the site in the starter message, feel free to look into it if you have time/interested.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Running MicroPython under Windows for IoT
Tried the image both in qemu and vbox, but no avail. It does enter boot stage but then Windows boot Manager complains about boot configuration errors. I assume because the virtualized x86 environment isn't close enough to the Galileo environment.