Skip to content

Commit 8239a3d

Browse files
committed
Update installation instructions.
1 parent 45f51dd commit 8239a3d

File tree

3 files changed

+59
-22
lines changed

3 files changed

+59
-22
lines changed

FASTPOLL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ loop = asyncio.get_event_loop(runq_len=40, waitq_len=40)
372372
CPython V3.7 provides a function `get_running_loop` which enables the current
373373
loop to be retrieved, raising a `RuntimeError` if one has not been
374374
instantiated. This is provided in `fast_io`. In the above sample the `Bar`
375-
constructor call `get_running_loop` to avoid inadvertently instantiating an
375+
constructor can call `get_running_loop` to avoid inadvertently instantiating an
376376
event loop with default args.
377377

378378
Function:

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ This comprises two parts.
4545

4646
# 2. Version and installation of uasyncio
4747

48-
Paul Sokolovsky (`uasyncio` author) has released `uasyncio` V2.2.1. This version
49-
is on PyPi and requires his [Pycopy](https://github.com/pfalcon/micropython)
50-
fork of MicroPython firmware. His `uasyncio` code may also be found in
48+
Paul Sokolovsky (`uasyncio` author) has released versions of `uasyncio` which
49+
supercede the official version. His latest version is that on PyPi and requires
50+
his [Pycopy](https://github.com/pfalcon/micropython) fork of MicroPython
51+
firmware. His `uasyncio` code may also be found in
5152
[his fork of micropython-lib](https://github.com/pfalcon/micropython-lib).
5253

5354
I support only the official build of MicroPython. The library code guaranteed
@@ -58,12 +59,14 @@ CPython).
5859
Most documentation and code in this repository assumes the current official
5960
version of `uasyncio`. This is V2.0 from
6061
[micropython-lib](https://github.com/micropython/micropython-lib).
61-
If release build of MicroPython V1.10 or later is used, V2.0 is incorporated
62-
and no installation is required. Some examples illustrate the features of the
63-
`fast_io` fork and therefore require this version.
62+
It is recommended to use MicroPython firmware V1.11 or later. On many platforms
63+
`uasyncio` is incorporated and no installation is required.
64+
65+
Some examples illustrate features of the `fast_io` fork and therefore require
66+
this version.
6467

6568
See [tutorial](./TUTORIAL.md#installing-uasyncio-on-bare-metal) for
66-
installation instructions where a realease build is not used.
69+
installation instructions where `uasyncio` is not pre-installed.
6770

6871
# 3. uasyncio development state
6972

TUTORIAL.md

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
108145
files must be copied from the official
109146
[micropython-lib](https://github.com/micropython/micropython-lib).
110147

111148
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
114151
```
115152
On the target hardware create a `uasyncio` directory (optionally under a
116153
directory `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-
125159
The `uasyncio` modules may be frozen as bytecode in the usual way, by placing
126160
the `uasyncio` directory and its contents in the port's `modules` directory and
127161
rebuilding.

0 commit comments

Comments
 (0)