From 446bb695257f2da187e976c6bc8fd65af5fe9d74 Mon Sep 17 00:00:00 2001 From: Peter Hinch Date: Mon, 3 Jun 2019 08:48:37 +0100 Subject: [PATCH] Add upip installation for Picoweb. Remove Pyboard D info. --- PICOWEB.md | 38 ++++++++++++++++++++++++++++++++++---- README.md | 6 ------ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/PICOWEB.md b/PICOWEB.md index b954977..937a4d8 100644 --- a/PICOWEB.md +++ b/PICOWEB.md @@ -8,16 +8,46 @@ This repo aims to clarify the installation process. Paul Sokolovsky's Picoweb code is unchanged. The demos are trivially changed to use IP '0.0.0.0' and port 80. -To install on a hardware platform such as ESP32 or Pyboard D it is necessary to -copy this directory and its contents (including subdirectories) to the target. -If using `rshell` on an ESP32 change to this directory, at the `rshell` prompt -issue +Two ways of installing Picoweb are available: copying this directory to the +target or using `upip`. To use `upip` you should ensure your firmware is V1.11 +or later; your target will also require an internet connection. +## Installing using upip + +Copy the `picoweb` subdirectory of this repo's `PicoWeb` directory, with its +contents, to the target. If using `rshell` to connect to a Pyboard D this would +be done with: +``` +/my/tree/PicoWeb> cp -r picoweb/ /flash +``` +Check whether your target has `uasyncio` pre-installed: +``` +>>> import uasyncio +>>> +``` +If this throws an `ImportError`, you will need to install `uasyncio`. + +Ensure your target is connected to the internet. Then perform the following +steps. The first step may be omitted if `uasyncio` is already installed. +``` +upip.install('micropython-uasyncio') +upip.install('micropython-ulogging') +upip.install('micropython-pkg_resources') +upip.install('utemplate') +``` + +## Installing by copying this archive + +Copy the contents of the `PicoWeb` directory (including subdirectories) to the +target. If using `rshell` on an ESP32 change to this directory, at the `rshell` +prompt issue ``` /my/tree/PicoWeb> rsync . /pyboard ``` This may take some time: 1 minute here on ESP32. +# Running Picoweb + At the REPL connect to the network and determine your IP address ``` >>> import network diff --git a/README.md b/README.md index a7c7522..9850f0c 100644 --- a/README.md +++ b/README.md @@ -124,12 +124,6 @@ The set and the array are different ways of viewing a bitmap implemented as a bytearray: e.g. if max_value is 255 the bytearray occupies 32 bytes allocated by the constructor. -# Pyboard D - -Note: official docs may now be found [here](https://pybd.io/hw/pybd_sfxw.html). -This [unofficial guide](./pyboard_d/README.md) now contains little which is not -in the official docs and will shortly be removed. - # A design for a hardware power meter This uses a Pyboard to measure the power consumption of mains powered devices.