<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.openhardwareconf.org/index.php?action=history&amp;feed=atom&amp;title=Swagbadge_Reinstall</id>
	<title>Swagbadge Reinstall - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.openhardwareconf.org/index.php?action=history&amp;feed=atom&amp;title=Swagbadge_Reinstall"/>
	<link rel="alternate" type="text/html" href="http://www.openhardwareconf.org/index.php?title=Swagbadge_Reinstall&amp;action=history"/>
	<updated>2026-04-11T09:15:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.1</generator>
	<entry>
		<id>http://www.openhardwareconf.org/index.php?title=Swagbadge_Reinstall&amp;diff=1468&amp;oldid=prev</id>
		<title>Nicola: /* Linux: connecting to the badge */</title>
		<link rel="alternate" type="text/html" href="http://www.openhardwareconf.org/index.php?title=Swagbadge_Reinstall&amp;diff=1468&amp;oldid=prev"/>
		<updated>2022-01-14T02:26:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Linux: connecting to the badge&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:26, 14 January 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    export AMPY_PORT=ttyUSB0   # note: no leading /dev/&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    export AMPY_PORT=ttyUSB0   # note: no leading /dev/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a firmware folder&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Create a firmware folder&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Download the bin file &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;per &lt;/del&gt;listed &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;above!&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Download the bin file &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;as &lt;/ins&gt;listed &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;below...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Run &amp;lt;code&amp;gt;./scripts/flash_micropython.sh&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Run &amp;lt;code&amp;gt;./scripts/flash_micropython.sh&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nicola</name></author>
	</entry>
	<entry>
		<id>http://www.openhardwareconf.org/index.php?title=Swagbadge_Reinstall&amp;diff=1441&amp;oldid=prev</id>
		<title>Nicola: Created page with &quot;== Overview ==  # Install the OS utilities you&#039;ll need # Locate the USB port your badge is on # Make a backup of your encryption key (and any other settings you want to keep s...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.openhardwareconf.org/index.php?title=Swagbadge_Reinstall&amp;diff=1441&amp;oldid=prev"/>
		<updated>2021-12-19T07:14:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Overview ==  # Install the OS utilities you&amp;#039;ll need # Locate the USB port your badge is on # Make a backup of your encryption key (and any other settings you want to keep s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
# Install the OS utilities you&amp;#039;ll need&lt;br /&gt;
# Locate the USB port your badge is on&lt;br /&gt;
# Make a backup of your encryption key (and any other settings you want to keep such as your wifi config)&lt;br /&gt;
# Flash the microprocessor with the firmware&lt;br /&gt;
# Send through a copy of the new code&lt;br /&gt;
&lt;br /&gt;
== Windows 10: connecting to the badge ==&lt;br /&gt;
&lt;br /&gt;
How to find your serial COM port on Windows: &lt;br /&gt;
* Use the Device Manager. &lt;br /&gt;
* Under the &amp;quot;Ports&amp;quot; category, you&amp;#039;ll see one or more entries. Hopefully one of which is your badge! It will tell you what Port it is on. &lt;br /&gt;
* If you can&amp;#039;t see your badge, you might need to go up to the View menu and use &amp;quot;Show hidden devices&amp;quot; and see if that helps.&lt;br /&gt;
&lt;br /&gt;
Windows 10 may automatically discover your #swagbadge USB hardware and automatically install the correct USB serial hardware driver, or if nothing still shows up, you might need to update your USB drivers for supporting the USB hardware CP210x on your #swagbadge, please follow these instructions:&lt;br /&gt;
* Download the CP210x drivers from [https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers Silicon Labs Windows Universal Driver]&lt;br /&gt;
* Unpack the zip file&lt;br /&gt;
* Follow the Silicon Labs instructions for [https://www.silabs.com/documents/public/application-notes/AN335.pdf INF only install] (Section 5 on page 9)&lt;br /&gt;
&lt;br /&gt;
By this point, you have know the serial COM port that your #swagbadge is connected to, e.g COM4&lt;br /&gt;
&lt;br /&gt;
== Mac OS: connecting to the badge ==&lt;br /&gt;
&lt;br /&gt;
How to find your serial COM port on OS X: &lt;br /&gt;
&lt;br /&gt;
    $ ls /dev/tty.usb*&lt;br /&gt;
&lt;br /&gt;
Unless you have lot of dev boards (or maybe a phone) plugged in you should just see a single filename there.&lt;br /&gt;
Use this (without the &amp;lt;code&amp;gt;/dev/&amp;lt;/code&amp;gt; prefix) when using the open command in mpfshell&lt;br /&gt;
&lt;br /&gt;
To get a working `mpfshell` install a recent version of Python (Python3.8 is known to work) using a installed DMG.&lt;br /&gt;
Then create a *venv* and install the necessary tools using pip.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
    $ mkdir swag&lt;br /&gt;
    $ cd swag&lt;br /&gt;
    $ python3.8 -m venv env&lt;br /&gt;
    $ ./env/bin/pip install esptool mpfshell&lt;br /&gt;
&lt;br /&gt;
You can then run &amp;lt;code&amp;gt;scripts/mpf.sh&amp;lt;/code&amp;gt; to connect (do not include the leading &amp;lt;code&amp;gt;/dev/&amp;lt;/code&amp;gt; when setting AMPY_PORT):&lt;br /&gt;
&lt;br /&gt;
    $ export AMPY_PORT=&amp;lt;your device node&amp;gt; # for bash, adjust to suit for your shell of choice&lt;br /&gt;
    $ scripts/mpf.sh&lt;br /&gt;
    mpfs [/]&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|Mac users beware: If you Ctrl-C mpfshell, (or disconnect USB cable while the badge connected to mpfshell), you could crash your desktop, due to the poor kernel drivers the Lolin32 Lite uses.}}&lt;br /&gt;
&lt;br /&gt;
== Linux: connecting to the badge ==&lt;br /&gt;
&lt;br /&gt;
# install the virtualwrapper https://virtualenvwrapper.readthedocs.io/en/latest/install.html&lt;br /&gt;
# Add the below code to your .bashrc&lt;br /&gt;
   export WORKON_HOME=$HOME/.virtualenvs&lt;br /&gt;
   export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3&lt;br /&gt;
   export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv&lt;br /&gt;
   export PROJECT_HOME=$HOME/Programming&lt;br /&gt;
   source /usr/local/bin/virtualenvwrapper.sh&lt;br /&gt;
   export AMPY_PORT=ttyUSB0   # note: no leading /dev/&lt;br /&gt;
# Create a firmware folder&lt;br /&gt;
# Download the bin file per listed above!&lt;br /&gt;
# Run &amp;lt;code&amp;gt;./scripts/flash_micropython.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Windows 10: installing utilities == &lt;br /&gt;
&lt;br /&gt;
* Install [https://docs.conda.io/en/latest/miniconda.html Miniconda3] to create a specific Python development environment. (Note we are using Python3 not Python2)&lt;br /&gt;
* Create specific Python 3 environment for playing around with your #swagbadge&lt;br /&gt;
** Start an Anaconda Powershell Prompt (aka Windows Terminal)&lt;br /&gt;
** &amp;lt;code&amp;gt;conda create --yes -n swagbadge python=3&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;conda activate swagbadge&amp;lt;/code&amp;gt;&lt;br /&gt;
* Your command prompt should now look like: &amp;lt;code&amp;gt;(swagbadge) C:\Users\[Username]&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Install some python tools to let us prepare and communicate with the badge&lt;br /&gt;
** &amp;lt;code&amp;gt;pip install esptool mpfshell&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To test that the required tools are installed, trying running the following commands&lt;br /&gt;
** &amp;lt;code&amp;gt;esptool&amp;lt;/code&amp;gt;  # Should show you help on running the esptool&lt;br /&gt;
** &amp;lt;code&amp;gt;mpfshell&amp;lt;/code&amp;gt;  # Should show three lines of output&lt;br /&gt;
*** &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;  #  To exit mpfshell&lt;br /&gt;
&lt;br /&gt;
== Download #swagbadge (Aiko Engine) firmware ==&lt;br /&gt;
&lt;br /&gt;
Within your Anaconda Prompt session, change directory to where you’d like the #swagbadge software to be downloaded, for example:&lt;br /&gt;
* &amp;lt;code&amp;gt;cd $HOME/software&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download #swagbadge firmware:&lt;br /&gt;
* &amp;lt;code&amp;gt;git clone https://github.com/geekscape/aiko_engine_mp.git&amp;lt;/code&amp;gt; # NOTE: this URL will change once we&amp;#039;re live&lt;br /&gt;
* &amp;lt;code&amp;gt;cd aiko_engine_mp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install MicroPython&lt;br /&gt;
* Create a directory to hold the MicroPython firmware, such as aiko_engine_mp/firmware/&lt;br /&gt;
* &amp;lt;code&amp;gt;mkdir firmware&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fetch the firmware&lt;br /&gt;
* Using your web browser, download: [http://micropython.org/resources/firmware/esp32-idf4-20200902-v1.13.bin esp32-idf4-20200902-v1.13.bin] (mouse right button click → [Save As …]  saving the MicroPython firmware in the firmware directory you just made.&lt;br /&gt;
** The [http://micropython.org/download/ MicroPython download list] has a link to a bunch of firmware drivers, we are using the one for the esp32 device, with the latest 1.4 generic&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;#039;&amp;#039;&amp;#039;STOP&amp;#039;&amp;#039;&amp;#039;! Make a copy of your badge&amp;#039;s encryption key and network settings before proceeding. Use mpfshell to get configuration/net.py and configuration/keys.db}}&lt;br /&gt;
&lt;br /&gt;
== Erase and reinstall firmware ==&lt;br /&gt;
&lt;br /&gt;
Erase #swagbadge LoLin-Lite ESP32 flash memory&lt;br /&gt;
* &amp;lt;code&amp;gt;esptool --chip esp32 --port COM3 erase_flash&amp;lt;/code&amp;gt; # adjust the port to suit.&lt;br /&gt;
* You’ll know it’s worked, if the output finishes with “Hard resetting via RTS pin…”&lt;br /&gt;
&lt;br /&gt;
You may get this error, if so, try esptool.py instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sauron [mc]$ esptool --chip esp32 --port /dev/ttyUSB0 erase_flash&lt;br /&gt;
esptool.py v2.8&lt;br /&gt;
Serial port /dev/ttyUSB0&lt;br /&gt;
Connecting....&lt;br /&gt;
Chip is ESP32D0WDQ6 (revision 1)&lt;br /&gt;
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None&lt;br /&gt;
Crystal is 40MHz&lt;br /&gt;
MAC: 7c:9e:bd:ed:79:24&lt;br /&gt;
Enabling default SPI flash mode...&lt;br /&gt;
Erasing flash (this may take a while)...&lt;br /&gt;
&lt;br /&gt;
A fatal error occurred: ESP32 ROM does not support function erase_flash.&lt;br /&gt;
sauron [mc]$ esptool.py --chip esp32 --port /dev/ttyUSB0 erase_flash&lt;br /&gt;
esptool.py v2.6&lt;br /&gt;
Serial port /dev/ttyUSB0&lt;br /&gt;
Connecting....&lt;br /&gt;
Chip is ESP32D0WDQ6 (revision 1)&lt;br /&gt;
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None&lt;br /&gt;
MAC: 7c:9e:bd:ed:79:24&lt;br /&gt;
Uploading stub...&lt;br /&gt;
Running stub...&lt;br /&gt;
Stub running...&lt;br /&gt;
Erasing flash (this may take a while)...&lt;br /&gt;
Chip erase completed successfully in 11.8s&lt;br /&gt;
Hard resetting via RTS pin...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install microPython on the badge&lt;br /&gt;
* &amp;lt;code&amp;gt;esptool --chip esp32 --port COM3 --baud 460800 write_flash -z 0x1000 firmware\esp32-idf4-20200902-v1.13.bin&amp;lt;/code&amp;gt; #adjust port and firmware location if necessary&lt;br /&gt;
* You’ll know it’s worked, if the output finishes with “Hard resetting via RTS pin…”&lt;br /&gt;
&lt;br /&gt;
Test that the software is installed correctly by using mpfshell&lt;br /&gt;
* &amp;lt;code&amp;gt;mpfshell -o COM3&amp;lt;/code&amp;gt; # Adjust port to suit&lt;br /&gt;
* If it has made a connection to your badge, you will see it say&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Connected to esp32&lt;br /&gt;
** Micropython File Shell v0.9.1, sw@kaltpost.de **&lt;br /&gt;
-- Running on Python 3.8 using PySerial 3.4 --&lt;br /&gt;
mpfs [/]&amp;gt; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using mpfshell ==&lt;br /&gt;
&lt;br /&gt;
mpfshell has two functions: it lets you put files on/off the device, and it can give you a python shell to execute code on the device.&lt;br /&gt;
* Getting files on/off the device is a bit like commandline ftp&lt;br /&gt;
** ls - looks at the files on your micropython device&lt;br /&gt;
** lls - looks at the files on your local computer in the current directory&lt;br /&gt;
** put - puts a file to the device&lt;br /&gt;
** cat - shows you the contents of the file&lt;br /&gt;
** help() - gives you more information on the commands&lt;br /&gt;
** repl - opens up the python shell on the badge&lt;br /&gt;
&lt;br /&gt;
Note: To get out of repl, use Ctrl-Q (on Windows) which drops you back into mpfshell&lt;br /&gt;
&lt;br /&gt;
A little program to say hello world!&lt;br /&gt;
* &amp;lt;code&amp;gt; &amp;gt;&amp;gt;&amp;gt; print(&amp;quot;hello world&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Output: &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A little program to turn the blue light on the board on and off (this is on the underside of the Swagbadge, visible through a circular cutout)&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;gt;&amp;gt;&amp;gt; import machine&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; pin22=machine.Pin(22, machine.Pin.OUT, machine.Pin.PULL_UP)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; pin22.value(0) &lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; pin22.value(1)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alternatives to mpfshell: Thonny, rshell and pyboard.py ==&lt;br /&gt;
&lt;br /&gt;
[https://thonny.org Thonny] is an IDE for python, with micropython support. It comes with [https://github.com/thonny/thonny/wiki/MicroPython instructions for using Thonny with micropython].&lt;br /&gt;
&lt;br /&gt;
rshell is an option, but it may not be reliable in all cases. However &amp;#039;pip install rshell&amp;#039; also installs pyboard.&lt;br /&gt;
&lt;br /&gt;
pyboard.py is the official tool that ships with micropython and is more flexible and reliable: http://docs.micropython.org/en/latest/reference/pyboard.py.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sauron [mc]$ pyboard.py --device /dev/ttyUSB0 -c &amp;#039;import os; print(os.statvfs(&amp;quot;/&amp;quot;)[0]*os.statvfs(&amp;quot;/&amp;quot;)[3], &amp;quot;bytes free out of&amp;quot;,os.statvfs(&amp;quot;/&amp;quot;)[1]*os.statvfs(&amp;quot;/&amp;quot;)[2])&amp;#039;&lt;br /&gt;
1699840 bytes free out of 2097152&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Saving your private key ==&lt;br /&gt;
&lt;br /&gt;
Use mpfshell to get the file: `configuration/keys.db`.&lt;br /&gt;
&lt;br /&gt;
== Putting the Aiko framework onto the device, using mpfshell == &lt;br /&gt;
* &amp;lt;code&amp;gt;mpfshell COM5 -s scripts\aiko.mpf&amp;lt;/code&amp;gt; #run from within the aiko_framework_mp directory&lt;br /&gt;
&lt;br /&gt;
=== Windows only: Patch mpfshell ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note!&amp;#039;&amp;#039; mpfshell used to need a patch applied to let it run a script under Windows. This is no longer required, but recorded here for archival purposes.&lt;br /&gt;
&lt;br /&gt;
* Inside &amp;lt;code&amp;gt;C:/users/USERNAME/Miniconda2/envs/swagbadge/Lib/site-packages/mp&amp;lt;/code&amp;gt;&lt;br /&gt;
* edit &amp;lt;code&amp;gt;mpfshell.py&amp;lt;/code&amp;gt;&lt;br /&gt;
* Search for &amp;lt;code&amp;gt;elif args.script is not None:&amp;lt;/code&amp;gt;, around line 796&lt;br /&gt;
* between that line and the next, insert two lines. It should look like:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    elif args.script is not None:&lt;br /&gt;
&lt;br /&gt;
        if platform.system() == &amp;quot;Windows&amp;quot;:  #INSERT THIS LINE&lt;br /&gt;
            mpfs.use_rawinput = True        #INSERT THIS LINE&lt;br /&gt;
&lt;br /&gt;
        f = open(args.script, &amp;quot;r&amp;quot;)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Python is very particular about spacing. The rest of the code uses 4 spaces for indents so follow suit.&lt;/div&gt;</summary>
		<author><name>Nicola</name></author>
	</entry>
</feed>