@@ -94,23 +94,60 @@ CPython V3.5 and above.
9494
9595## 0.1 Installing uasyncio on bare metal
9696
97- If a release build of firmware is used no installation is necessary as uasyncio
98- is compiled into the build. The current release build (V1.9.10) now supports
99- asynchronous stream I/O.
97+ It is recommended to use MicroPython firmware V1.11 or later. On many platforms
98+ no installation is necessary as ` uasyncio ` is compiled into the build. Test by
99+ issuing
100+ ``` python
101+ import uasyncio
102+ ```
103+ at the REPL.
104+
105+ The following instructions cover cases where modules are not pre-installed. The
106+ ` queues ` and ` synchro ` modules are optional, but are required to run all the
107+ examples below.
108+
109+ #### Hardware with internet connectivity
110+
111+ On hardware with an internet connection and running firmware V1.11 or greater
112+ installation may be done using ` upip ` , which is pre-installed. After ensuring
113+ that the device is connected to your network issue:
114+ ``` python
115+ import upip
116+ upip.install(' micropython-uasyncio' )
117+ upip.install(' micropython-uasyncio.synchro' )
118+ upip.install(' micropython-uasyncio.queues' )
119+ ```
120+ Error meesages from ` upip ` are not too helpful. If you get an obscure error,
121+ double check your internet connection.
122+
123+ #### Hardware without internet connectivity (micropip)
124+
125+ On hardware which lacks an internet connection (such as a Pyboard V1.x) the
126+ easiest way is to run ` micropip.py ` on a PC to install to a directory of your
127+ choice, then to copy the resultant directory structure to the target hardware.
128+ The ` micropip.py ` utility runs under Python 3.2 or above and runs under Linux,
129+ Windows and OSX. It may be found
130+ [ here] ( https://github.com/peterhinch/micropython-samples/tree/master/micropip ) .
131+
132+ Typical invocation:
133+ ``` bash
134+ $ micropip.py install -p ~ /rats micropython-uasyncio
135+ $ micropip.py install -p ~ /rats micropython-uasyncio.synchro
136+ $ micropip.py install -p ~ /rats micropython-uasyncio.queues
137+ ```
100138
101- The following instructions cover the case where a release build is not used.
102- The instructions have changed as the version on PyPi is no longer compatible
103- with official MicroPython firmware.
139+ #### Hardware without internet connectivity (copy source)
104140
105- The following instructions describe copying the bare minimum of files to a
106- target device, also the case where ` uasyncio ` is to be frozen into a compiled
107- build as bytecode. For the latest release compatible with official firmware
141+ If ` micropip.py ` is not to be used the files should be copied from source. The
142+ following instructions describe copying the bare minimum of files to a target
143+ device, also the case where ` uasyncio ` is to be frozen into a compiled build as
144+ bytecode. For the latest release compatible with official firmware
108145files must be copied from the official
109146[ micropython-lib] ( https://github.com/micropython/micropython-lib ) .
110147
111148Clone the library to a PC with
112- ```
113- git clone https://github.com/micropython/micropython-lib.git
149+ ``` bash
150+ $ git clone https://github.com/micropython/micropython-lib.git
114151```
115152On the target hardware create a ` uasyncio ` directory (optionally under a
116153directory ` lib ` ) and copy the following files to it:
@@ -119,9 +156,6 @@ directory `lib`) and copy the following files to it:
119156 * ` uasyncio.synchro/uasyncio/synchro.py `
120157 * ` uasyncio.queues/uasyncio/queues.py `
121158
122- The ` queues ` and ` synchro ` modules are optional, but are required to run all
123- the examples below.
124-
125159The ` uasyncio ` modules may be frozen as bytecode in the usual way, by placing
126160the ` uasyncio ` directory and its contents in the port's ` modules ` directory and
127161rebuilding.
0 commit comments