@@ -22,22 +22,41 @@ features.
22
22
23
23
# Installing uasyncio on bare metal
24
24
25
- As discussed in the [ main README] ( ./README.md ) these instructions assume the
26
- official build of MicroPython firmware. Accordingly the ` uasyncio ` files from
27
- the [ official library] ( https://github.com/micropython/micropython-lib ) are
28
- required. At the time of writing the PyPI repository contains ` uasyncio ` V2.0
29
- which is incompatible with that fimware so ` upip ` cannot be used.
25
+ MicroPython libraries are located on [ PyPi] ( https://pypi.python.org/pypi ) .
26
+ Libraries to be installed are:
27
+
28
+ * micropython-uasyncio
29
+ * micropython-uasyncio.queues
30
+ * micropython-uasyncio.synchro
31
+
32
+ The ` queues ` and ` synchro ` modules are optional, but are required to run all
33
+ the examples below.
34
+
35
+ The oficial approach is to use the ` upip ` utility as described
36
+ [ here] ( https://github.com/micropython/micropython-lib ) . Network enabled
37
+ hardware has this included in the firmware so it can be run locally. This is
38
+ the preferred approach.
39
+
40
+ On non-networked hardware there are two options. One is to use ` upip ` under a
41
+ Linux real or virtual machine. This involves installing and building the Unix
42
+ version of MicroPython, using ` upip ` to install to a directory on the PC, and
43
+ then copying the library to the target.
44
+
45
+ The need for Linux and the Unix build may be avoided by using
46
+ [ micropip.py] ( https://github.com/peterhinch/micropython-samples/tree/master/micropip ) .
47
+ This runs under Python 3.2 or above. Create a temporary directory on your PC
48
+ and install to that. Then copy the contents of the temporary direcory to the
49
+ device. The following assume Linux and a temporary directory named ` ~/syn ` -
50
+ adapt to suit your OS. The first option requires that ` micropip.py ` has
51
+ executable permission.
30
52
31
- The aim is to create a ` uasyncio ` directory on the device's filesystem
32
- containing the following files:
33
-
34
- [ ` __init__.py ` ] ( https://github.com/micropython/micropython-lib/blob/master/uasyncio/uasyncio/__init__.py )
35
- [ ` core.py ` ] ( https://github.com/micropython/micropython-lib/blob/master/uasyncio.core/uasyncio/core.py )
36
- [ ` queues.py ` ] ( https://github.com/micropython/micropython-lib/blob/master/uasyncio.queues/uasyncio/queues.py )
37
- [ ` synchro.py ` ] ( https://github.com/micropython/micropython-lib/blob/master/uasyncio.synchro/uasyncio/synchro.py )
53
+ ```
54
+ $ ./micropip.py install -p ~/syn micropython-uasyncio
55
+ $ python3 -m micropip.py install -p ~/syn micropython-uasyncio
56
+ ```
38
57
39
- These modules may be frozen as bytecode in the usual way, by placing the above
40
- ` uasyncio ` directory in the port's ` modules ` directory and rebuilding.
58
+ The ` uasyncio ` modules may be frozen as bytecode in the usual way, by placing
59
+ the ` uasyncio ` directory in the port's ` modules ` directory and rebuilding.
41
60
42
61
###### [ Main README] ( ./README.md )
43
62
@@ -169,7 +188,8 @@ The following modules are provided which may be copied to the target hardware.
169
188
generalisation of switches providing logical rather than physical status along
170
189
with double-clicked and long pressed events.
171
190
3 . ` asyncio_priority.py ` An experimental version of uasyncio with a simple
172
- priority mechanism. See [ this doc] ( ./FASTPOLL.md ) .
191
+ priority mechanism. See [ this doc] ( ./FASTPOLL.md ) . Note that this does not yet
192
+ support ` uasyncio ` V2.0.
173
193
174
194
** Demo Programs**
175
195
0 commit comments