@@ -94,23 +94,60 @@ CPython V3.5 and above.
94
94
95
95
## 0.1 Installing uasyncio on bare metal
96
96
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
+ ```
100
138
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)
104
140
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
108
145
files must be copied from the official
109
146
[ micropython-lib] ( https://github.com/micropython/micropython-lib ) .
110
147
111
148
Clone 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
114
151
```
115
152
On the target hardware create a ` uasyncio ` directory (optionally under a
116
153
directory ` lib ` ) and copy the following files to it:
@@ -119,9 +156,6 @@ directory `lib`) and copy the following files to it:
119
156
* ` uasyncio.synchro/uasyncio/synchro.py `
120
157
* ` uasyncio.queues/uasyncio/queues.py `
121
158
122
- The ` queues ` and ` synchro ` modules are optional, but are required to run all
123
- the examples below.
124
-
125
159
The ` uasyncio ` modules may be frozen as bytecode in the usual way, by placing
126
160
the ` uasyncio ` directory and its contents in the port's ` modules ` directory and
127
161
rebuilding.
0 commit comments