manual rework
|
Before Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 256 KiB |
|
Before Width: | Height: | Size: 256 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 445 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 423 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 671 KiB |
|
Before Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 354 KiB |
|
Before Width: | Height: | Size: 289 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 415 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 378 KiB |
|
Before Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 372 KiB |
|
Before Width: | Height: | Size: 451 KiB |
45
README.md
@@ -1,13 +1,21 @@
|
||||
<<<<<<< HEAD
|
||||
# At this moment deprecated in favor of <a target="_blank" href="https://github.com/pycom/pydocs">pydocs</a>.
|
||||
|
||||
This project is based on Gitbook, new docs are based on Github pages.
|
||||
|
||||
# Introduction
|
||||
=======
|
||||
# run locally
|
||||
>>>>>>> publish
|
||||
|
||||
Welcome to the Pycom documentation site. We recommend reading through all the sections to familiarise yourself with the various tools and features available to you to help you develop on your Pycom module.
|
||||
```
|
||||
brew install hugo
|
||||
hugo serve
|
||||
```
|
||||
|
||||
To get started, read through the Getting Started Guide then feel free to jump straight into the tutorials and examples in Tutorials & Examples to begin building your projects.
|
||||
# Workflow
|
||||
|
||||
<<<<<<< HEAD
|
||||
* [Products](products.md)
|
||||
* [Getting Started](getting-started/introduction.md)
|
||||
* [Pymakr](pymakr-plugin/installation/)
|
||||
@@ -15,4 +23,37 @@ To get started, read through the Getting Started Guide then feel free to jump st
|
||||
* [API Documentation](firmware-and-api-reference/introduction.md)
|
||||
* [Product Info](product-info-datasheets/introduction.md)
|
||||
* [Pybytes](pybytes/introduction.md)
|
||||
=======
|
||||
- Make PR using Master branch
|
||||
- PR get merged on master
|
||||
- Then merge publish with master
|
||||
>>>>>>> publish
|
||||
|
||||
```
|
||||
git commit -m "section: commit message"
|
||||
git push origin master
|
||||
git checkout publish
|
||||
git merge master
|
||||
git push origin publish
|
||||
```
|
||||
|
||||
# some infos:
|
||||
|
||||
- assets are in ./static directory, a directory aliased at /
|
||||
- css in /themes/doc-theme/static/doc-theme.css
|
||||
- SUMMARY.md is in config.toml
|
||||
|
||||
|
||||
# help
|
||||
|
||||
- gohugo.io
|
||||
|
||||
|
||||
# detect broken links
|
||||
|
||||
```
|
||||
wget -o 404.txt -r --spider http://localhost:1313
|
||||
```
|
||||
|
||||
A webhook has been installed on the publish branch to:
|
||||
- https://publish.d1rmdw1xyxqk1e.amplifyapp.com/
|
||||
|
||||
1293
config.toml
Normal file
BIN
content/.DS_Store
vendored
Normal file
15
content/_index.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "Introduction"
|
||||
aliases:
|
||||
- /introduction
|
||||
---
|
||||
Welcome to the Pycom documentation site. We recommend reading through all the sections to familiarise yourself with the various tools and features available to you to help you develop on your Pycom module.
|
||||
|
||||
To get started, read through the Getting Started guide then feel free to jump straight into the tutorials and examples in Tutorials & Examples to begin building your projects.
|
||||
|
||||
* [Products](products)
|
||||
* [Getting Started](gettingstarted/introduction)
|
||||
* [Tutorials](tutorials/introduction)
|
||||
* [Product Info](datasheets/introduction)
|
||||
* [API Documentation](firmwareapi/introduction)
|
||||
* [Pybytes](pybytes/introduction)
|
||||
366
content/advance/cli.md
Normal file
@@ -0,0 +1,366 @@
|
||||
---
|
||||
title: "CLI Updater"
|
||||
aliases:
|
||||
- advance/cli.html
|
||||
- advance/cli.md
|
||||
- chapter/advance/cli
|
||||
---
|
||||
## Command Line Update Utility
|
||||
|
||||
#### Windows
|
||||
|
||||
After installing the [Windows version](https://software.pycom.io/findupgrade?product=pycom-firmware-updater&type=all&platform=win32&redirect=true) of the updater tool, the CLI tool `pycom-fwtool-cli.exe` can be found here:
|
||||
|
||||
* 32-Bit Windows: `C:\Program Files\Pycom\Pycom Firmware Update\`
|
||||
* 64-Bit Windows: `C:\Program Files (x86)\Pycom\Pycom Firmware Update\`
|
||||
|
||||
#### macOS
|
||||
|
||||
In order to get access to the CLI tool on macOS, you will need to right click on the [Mac version](https://software.pycom.io/findupgrade?product=pycom-firmware-updater&type=all&platform=macos&redirect=true) of the updater tool and click `Show Package Contents`, then navigate to `Contents/Resources`, here you will find the `pycom-fwtool-cli`.
|
||||
|
||||
#### Linux
|
||||
|
||||
In the [Ubuntu 14.04 LTS](https://software.pycom.io/findupgrade?product=pycom-firmware-updater&type=all&platform=unix&redirect=true) (and newer) version of the updater tool, `pycom-fwtool-cli` is installed in `/usr/local/bin`. In the [Generic Linux](https://software.pycom.io/findupgrade?product=pycom-firmware-updater&type=all&platform=unix&redirect=true) package, the tool is extracted into folder `./pyupgrade`
|
||||
|
||||
### Usage
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli [-h] [-v] [-d] [-q] [-p PORT] [-s SPEED] [-c] [-x]
|
||||
[--ftdi] [--pic] [-r]
|
||||
{list,chip_id,wmac,smac,sigfox,exit,flash,copy,write,write_remote,wifi,pybytes,cb,nvs,ota,lpwan,erase_fs,erase_all}
|
||||
...
|
||||
|
||||
Update your Pycom device with the specified firmware image file For more
|
||||
details please see https://docs.pycom.io/chapter/advance/cli.html
|
||||
|
||||
positional arguments:
|
||||
{list,chip_id,wmac,smac,sigfox,exit,flash,copy,write,write_remote,wifi,pybytes,cb,nvs,ota,lpwan,erase_fs,erase_all}
|
||||
list Get list of available COM ports
|
||||
chip_id Show ESP32 chip_id
|
||||
wmac Show WiFi MAC
|
||||
smac Show LPWAN MAC
|
||||
sigfox Show sigfox details
|
||||
exit Exit firmware update mode
|
||||
flash Write firmware image to flash
|
||||
copy Read/Write flash memory partition
|
||||
write Write to flash memory
|
||||
wifi Get/Set default WIFI parameters
|
||||
pybytes Read/Write pybytes configuration
|
||||
cb Read/Write config block
|
||||
nvs Read/Write non volatile storage
|
||||
ota Read/Write ota block
|
||||
lpwan Get/Set LPWAN parameters [ EU868 US915 AS923 AU915]
|
||||
erase_fs Erase flash file system area
|
||||
erase_all Erase entire flash!
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-v, --verbose show verbose output from esptool
|
||||
-d, --debug show debuggin output from fwtool
|
||||
-q, --quiet suppress success messages
|
||||
-p PORT, --port PORT the serial port to use
|
||||
-s SPEED, --speed SPEED
|
||||
baudrate
|
||||
-c, --continuation continue previous connection
|
||||
-x, --noexit do not exit firmware update mode
|
||||
--ftdi force running in ftdi mode
|
||||
--pic force running in pic mode
|
||||
-r, --reset use Espressif reset mode
|
||||
```
|
||||
|
||||
## How to use the Parameters
|
||||
|
||||
{{% hint style="info" %}}
|
||||
The CLI tool uses a combination of global and command specific parameters. The **order of parameters** is **important** to avoid ambiguity.
|
||||
|
||||
`pycom-fwtool-cli [global parameters] [command] [command parameters]`
|
||||
|
||||
While `pycom-fwtool-cli -h` shows help for global parameters and a list of available commands, command specific parameters can be viewed using `pycom-fwtool-cli [command] -h`
|
||||
|
||||
The parameter `-r, --reset` has been added as a courtesy for users of 3rd party ESP32 products. This functionality is **not supported** by the Expansion Board 2.0 and may cause this tool to crash or hang in certain circumstances.
|
||||
{{< /hint >}}
|
||||
|
||||
### Global Parameters
|
||||
|
||||
```text
|
||||
`-h / --help` : shows above help (you can also get detailed help for each sub-command
|
||||
`-v / --verbose` : show verbose output from esptool.
|
||||
`-d / --debug` : show debug output from fwtool.
|
||||
`-q / --quiet` : suppress most output, used for scripting
|
||||
`-p / --port` : specifies the serial port to be used. Can also be set via **environment variable ESPPORT**
|
||||
`-s / --speed` : specifies the serial speed to be used. Can also be set via **environment variable ESPBAUD**
|
||||
`-c / --continuation` : continue previous connection in FTDI mode. This allows running multiple commands sequentially without having to reset the module. This option is ignored in PIC mode as the module can be reset via the serial connection.
|
||||
`-x / --noexit` : This will prevent the PIC from leaving firmware update mode.
|
||||
`--ftdi` : This will force the CLI updater to run in FTDI mode.
|
||||
`--pic` : This will force the CLI updater to run in PIC mode.
|
||||
`-r, --reset` : This will force the CLI updater to use Espressif's workaround to switch into Firmware update mode. This reset method is intended for 3rd party hardware only and is not supported by the Expansion Board 2.0
|
||||
```
|
||||
|
||||
### Commands
|
||||
|
||||
#### list
|
||||
|
||||
Get list of available serial ports ports.
|
||||
|
||||
```bash
|
||||
usage: pycom-fwtool-cli list [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
**Example:** On macOS:
|
||||
|
||||
```bash
|
||||
$ pycom-fwtool-cli list
|
||||
/dev/cu.usbmodemPy343431 [Pytrack] [USB VID:PID=04D8:F013 SER=Py343434 LOCATION=20-2]
|
||||
/dev/cu.Bluetooth-Incoming-Port [n/a] [n/a]
|
||||
```
|
||||
|
||||
On Windows:
|
||||
|
||||
```text
|
||||
COM6 [Pytrack] [USB VID:PID=04D8:F013 SER=Py343434 LOCATION=20-2]
|
||||
```
|
||||
|
||||
{{% hint style="info" %}}
|
||||
This is the only command that does not require any additional parameters.
|
||||
|
||||
All other commands require that **the serial port is specified either through the** `-p` **/** `--port` **option or through environment variable** `ESPPORT` You can optionally specify the speed either through `-s` / `--speed` or via environment variable `ESPBAUD`. The default speed is `921600`. The maximum speed for read operations on PIC based expansion boards & shields is `230400`. The speed will be reduced automatically if necessary.
|
||||
|
||||
#### Special note for Expansion Board 2.0
|
||||
|
||||
You will need to have a **jumper wire** connected between `G23` and `GND` to use any of the commands below. You will also need to **press the reset button** either before running each command or at least before running the first command. To avoid having to press the reset button again after each command, you can use the `-c` / `--continuation` option. The first command connecting to the device **MUST NOT** use the `-c` / `--continuation` option. This is to make sure a program called `_stub_` is uploaded onto the device. This `_stub_` cannot be uploaded more than once, so you need to tell the cli tool that the `_stub_` is already running, which is done through using the `-c` / `--continuation` option.
|
||||
{{< /hint >}}
|
||||
|
||||
#### chip\_id
|
||||
|
||||
Shows the unique ID of the ESP32 on the connected module.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT exit [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
#### wmac
|
||||
|
||||
Shows the WiFi MAC of the connected module.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT wmac [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
#### smac
|
||||
|
||||
Shows the LPWAN MAC of the connected module.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT smac [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
#### sigfox
|
||||
|
||||
Show sigfox details
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT sigfox [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
#### exit
|
||||
|
||||
If a Pysense/Pytrack/Expansion 3 has previously been left in firmware update mode by using the `-x` option, this command can be used to exit the firmware update mode.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT exit [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
#### flash
|
||||
|
||||
Writes firmware image to flash, must be as a `.tar(.gz)` file as provided by Pycom. These files can be found on [GitHub](https://github.com/pycom/pycom-micropython-sigfox/releases).
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT flash [-h] [-t TAR]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-t TAR, --tar TAR perform the upgrade from a tar[.gz] file
|
||||
```
|
||||
|
||||
#### copy
|
||||
|
||||
Read/Write flash memory partition from/to local file
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT [-h] [-p PARTITION] [-f FILE] [-r] [-b]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-p PARTITION, --partition PARTITION
|
||||
The partition to read/write (all, fs, nvs, factory,
|
||||
secureboot, bootloader, partitions, otadata, fs1,
|
||||
ota_0, config)
|
||||
-f FILE, --file FILE name of the binary file (default: <wmac>-<part>.bin)
|
||||
-r, --restore restore partition from binary file
|
||||
-b, --backup backup partition to binary file (default)
|
||||
```
|
||||
|
||||
#### write
|
||||
|
||||
Write to a specific location in flash memory.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT write [-h] [-a ADDRESS] [--contents CONTENTS]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-a ADDRESS, --address ADDRESS
|
||||
address to write to
|
||||
--contents CONTENTS contents of the memory to write (base64)
|
||||
```
|
||||
|
||||
#### wifi
|
||||
|
||||
Get/Set default WiFi parameters.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli wifi [-h] [--ssid SSID] [--pwd PWD] [--wob [WOB]]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
--ssid SSID Set Wifi SSID
|
||||
--pwd PWD Set Wifi PWD
|
||||
--wob [WOB] Set Wifi on boot
|
||||
```
|
||||
|
||||
#### pybytes
|
||||
|
||||
Read/Write pybytes configuration.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli pybytes [-h] [--token TOKEN] [--mqtt MQTT] [--uid UID]
|
||||
[--nwprefs NWPREFS] [--extraprefs EXTRAPREFS]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
--token TOKEN Set Device Token
|
||||
--mqtt MQTT Set mqttServiceAddress
|
||||
--uid UID Set userId
|
||||
--nwprefs NWPREFS Set network preferences
|
||||
--extraprefs EXTRAPREFS
|
||||
Set extra preferences
|
||||
```
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Note: The local `pybytes_config.json` file is overwritten when making any modifications using this command (requires Pybytes firmware `1.17.5.b6` or higher and Firmware updater `1.14.3`).
|
||||
{{< /hint >}}
|
||||
|
||||
#### cb
|
||||
|
||||
Read/Write config block (LPMAC, Sigfox PAC & ID, etc.). You can find the structure of this block [here.](https://github.com/pycom/pycom-micropython-sigfox/blob/master/esp32/pycom_config.h#L24)
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT cb [-h] [-f FILE] [-b] [-r]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-f FILE, --file FILE name of the backup file
|
||||
-b, --backup backup cb partition to file
|
||||
-r, --restore restore cb partition from file
|
||||
```
|
||||
|
||||
If neither `-b` or `-r` is provided, the command will default to backup. If no file name is provided, `<WMAC>.cb` is used.
|
||||
|
||||
To backup your config block: `$pycom-fwtool-cli -p PORT cb`
|
||||
|
||||
To restore your config block: `$pycom-fwtool-cli -p PORT cb -r -f backup.cb`
|
||||
|
||||
#### nvs
|
||||
|
||||
Read/Write non-volatile storage.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT nvs [-h] [-f FILE] [-b] [-r]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-f FILE, --file FILE name of the backup file
|
||||
-b, --backup backup cb partition to file
|
||||
-r, --restore restore cb partition from file
|
||||
```
|
||||
|
||||
If neither `-b` or `-r` is provided, the command will default to backup. If no file name is provided, `<WMAC>.nvs` is used.
|
||||
|
||||
To backup your NVS: `$ pycom-fwtool-cli -p PORT nvs`
|
||||
|
||||
To restore your NVS: `$ pycom-fwtool-cli -p PORT nvs -r -f backup.nvs`
|
||||
|
||||
#### ota
|
||||
|
||||
Read/Write ota block, this contains data relating to OTA updates such as the hash of the OTA firmware.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli ota [-h] [-f FILE] [-b] [-r]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-f FILE, --file FILE name of the backup file
|
||||
-b, --backup backup cb partition to file
|
||||
-r, --restore restore cb partition from file
|
||||
```
|
||||
|
||||
If neither `-b` nor `-r` is provided, the command will default to backup. If no file name is provided, `<WMAC>.ota` is used.
|
||||
|
||||
To backup your OTA block: `$pycom-fwtool-cli -p PORT ota`
|
||||
|
||||
To restore your OTA block: `$pycom-fwtool-cli -p PORT ota -r -f backup.ota`
|
||||
|
||||
#### lpwan
|
||||
|
||||
Get/Set LPWAN parameters saved to non-volatile storage. Please see [here](/firmwareapi/pycom/network/lora.md##loranvramsave) for more details.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT lpwan [-h] [--region REGION]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
--region REGION Set default LORA region
|
||||
--erase_region Erase default LORA region
|
||||
--lora_region Output only LORA region
|
||||
```
|
||||
|
||||
#### erase\_fs
|
||||
|
||||
Erase flash file system area. This is useful if some code running on the device is preventing access to the REPL.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli -p PORT erase_fs [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
#### erase\_all
|
||||
|
||||
Erase entire flash, only use this if you are sure you know what you are doing. This will remove your devices lpwan mac addresses etc.
|
||||
|
||||
```text
|
||||
usage: pycom-fwtool-cli erase_all [-h]
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
```
|
||||
|
||||
43
content/advance/downgrade.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: "Firmware Downgrade"
|
||||
aliases:
|
||||
- advance/downgrade.html
|
||||
- advance/downgrade.md
|
||||
- chapter/advance/downgrade
|
||||
---
|
||||
The firmware upgrade tool usually updates your device to the latest available firmware version. If you require to downgrade your device to a previous firmware there are two methods to achieve this.
|
||||
|
||||
{{% hint style="info" %}}
|
||||
If you are using an Expansion Board 1.0 or 2.0, you will need to have a jumper connected between `G23` and `GND` to use either procedure below. You will also need to press the reset button before beginning.
|
||||
{{< /hint >}}
|
||||
|
||||
You can obtain previous firmware versions here:
|
||||
|
||||
* [WiPy](https://software.pycom.io/downloads/WiPy.html)
|
||||
* [LoPy](https://software.pycom.io/downloads/LoPy.html)
|
||||
* [SiPy](https://software.pycom.io/downloads/SiPy.html)
|
||||
* [GPy](https://software.pycom.io/downloads/GPy.html)
|
||||
* [FiPy](https://software.pycom.io/downloads/FiPy.html)
|
||||
* [LoPy4](https://software.pycom.io/downloads/LoPy4.html)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Prior to version `1.16.0.b1` the firmware for modules with LoRa functionality was frequency specific. From `1.16.0.b1` and onward, the firmware is region agnostic and this can either be set programatically or via the config block (see [here](../cli#lpwan)).
|
||||
{{< /hint >}}
|
||||
|
||||
## GUI
|
||||
|
||||
As of version `1.12.0.b0` of the firmware update tool, you can now provide a `.tar` or `.tar.gz` archive of the firmware you wish to upload to the board.
|
||||
|
||||
When you start the update tool you will see the following screen:
|
||||
|
||||

|
||||
|
||||
When you tick the `Flash from local file` option, an address bar will appear. Click the `...` button and locate the `.tar(.gz)` file with the firmware you wish to flash to your device. From this point the updater will behave just like a regular update but using the local file instead of downloading the latest.
|
||||
|
||||
## Command line
|
||||
|
||||
You can also use the [CLI](../cli) version of the update tool to downgrade your device. Will need to get a `.tar` or `.tar.gz` archive of the firmware you wish to upload to the board. Then run the following commands:
|
||||
|
||||
```bash
|
||||
$ pycom-fwtool-cli -v -p PORT flash -t /path/to/firmware/archive.tar.gz
|
||||
```
|
||||
108
content/advance/encryption.md
Normal file
@@ -0,0 +1,108 @@
|
||||
---
|
||||
title: "SecureBoot and Encryption"
|
||||
aliases:
|
||||
- advance/encryption.html
|
||||
- advance/encryption.md
|
||||
- chapter/advance/encryption
|
||||
---
|
||||
## Summary
|
||||
|
||||
In order to encrypt your firmware, you will need to build it from source. Our firmware source code can be found [here](https://github.com/pycom/pycom-micropython-sigfox/), along with instructions on how to build it. Below you will find specific instructions on how generate keys, build and flash encrypted firmware.
|
||||
|
||||
1. Obtain keys (for Secure Boot and Flash Encryption)
|
||||
2. Flash keys and parameters in `efuses`
|
||||
3. Compile bootloader and application with `make SECURE=on`
|
||||
4. Flash: bootloader-digest at address `0x0` and encrypted; all the others (partitions and application) encrypted, too.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Firstly you will need to setup the tool chain and download the source code. detailed instructions on how to achieve this can be found [here](https://github.com/pycom/pycom-micropython-sigfox/blob/master/README.md#the-esp32-version_). Once you have complete this, you will need to open a terminal in the `esp32` folder of the firmware source code repo.
|
||||
|
||||
Next you will need keys for Flash Encryption and Secure Boot; they can be generated randomly with the following commands:
|
||||
|
||||
```bash
|
||||
python $IDF_PATH/components/esptool_py/esptool/espsecure.py generate_flash_encryption_key flash_encryption_key.bin
|
||||
python $IDF_PATH/components/esptool_py/esptool/espsecure.py generate_signing_key secure_boot_signing_key.pem
|
||||
```
|
||||
|
||||
The Secure Boot key `secure_boot_signing_key.pem` has to be transformed into `secure-bootloader-key.bin`, to be burnt into efuses. This can be done in 2 ways:
|
||||
|
||||
```bash
|
||||
python $IDF_PATH/components/esptool_py/esptool/espsecure.py extract_public_key --keyfile secure_boot_signing_key.pem signature_verification_key.bin
|
||||
```
|
||||
|
||||
or, as an artifact of the make build process, on the same directory level as Makefile
|
||||
|
||||
```bash
|
||||
make BOARD=GPY SECURE=on TARGET=boot
|
||||
```
|
||||
|
||||
To flash the keys (`flash_encryption_key.bin` and `secure-bootloader-key.bin`) into the efuses (write and read protected) run the following commands (ignoring the lines that start with `#`):
|
||||
|
||||
_**Note: Irreversible operations**_
|
||||
|
||||
```bash
|
||||
# Burning Encryption Key
|
||||
python $IDF_PATH/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_key flash_encryption flash_encryption_key.bin
|
||||
# Burning Secure Boot Key
|
||||
python $IDF_PATH/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_key secure_boot secure-bootloader-key.bin
|
||||
# Enabling Flash Encryption mechanism
|
||||
python $IDF_PATH/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_efuse FLASH_CRYPT_CNT
|
||||
# Configuring Flash Encryption to use all address bits together with Encryption key (max value 0x0F)
|
||||
python $IDF_PATH/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_efuse FLASH_CRYPT_CONFIG 0x0F
|
||||
# Enabling Secure Boot mechanism
|
||||
python $IDF_PATH/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 burn_efuse ABS_DONE_0
|
||||
```
|
||||
|
||||
**If the keys are not written in efuse, before flashing the bootloader, then random keys will be generated by the ESP32, they can never be read nor re-written, so bootloader can never be updated. Even more, the application can be re-flashed (by USB) just 3 more times.**
|
||||
|
||||
## Makefile options
|
||||
|
||||
```bash
|
||||
make BOARD=GPY SECURE=on SECURE_KEY=secure_boot_signing_key.pem ENCRYPT_KEY=flash_encryption_key.bin TARGET=[boot|app]
|
||||
```
|
||||
|
||||
* `SECURE=on` is the main flag; it's not optional
|
||||
* if `SECURE=on` the following defaults are set:
|
||||
* encryption is enable
|
||||
* `secure_boot_signing_key.pem` is the secure boot key, located relatively to Makefile
|
||||
* `flash_encryption_key.bin` is the flash encryption key, located relatively to Makefile
|
||||
|
||||
For flashing the bootloader digest and the encrypted versions of all binaries:
|
||||
|
||||
```bash
|
||||
make BOARD=GPY SECURE=on flash
|
||||
```
|
||||
|
||||
## Flashing
|
||||
|
||||
For flashing the `bootloader-reflash-digest.bin` has to be written at address 0x0, instead of the `bootloader.bin` (at address `0x1000`).
|
||||
|
||||
Build is done using `SECURE=on` option; additionally, all the binaries are pre-encrypted.
|
||||
|
||||
```bash
|
||||
make BOARD=GPY clean
|
||||
make BOARD=GPY SECURE=on TARGET=boot
|
||||
make BOARD=GPY SECURE=on TARGET=app
|
||||
make BOARD=GPY SECURE=on flash
|
||||
```
|
||||
|
||||
Manual flash command:
|
||||
|
||||
```bash
|
||||
python $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before no_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x0 build/GPY/release/bootloader/bootloader-reflash-digest.bin_enc 0x8000 build/GPY/release/lib/partitions.bin_enc 0x10000 build/GPY/release/gpy.bin_enc_0x10000
|
||||
```
|
||||
|
||||
## OTA update
|
||||
|
||||
The OTA should be done using the pre-encrypted application image.
|
||||
|
||||
Because the encryption is done based on the physical flash address, there are 2 application binaries generated:
|
||||
|
||||
* `gpy.bin_enc_0x10000` which has to be written at default factory address: `0x10000`
|
||||
* `gpy.bin_enc_0x1A0000` which has to be written at the `ota_0` partition address (`0x1A0000`)
|
||||
|
||||
{{% hint style="info" %}}
|
||||
Hint: on MicroPython interface, the method `pycom.ota_slot()` responds with the address of the next OTA partition available (either `0x10000` or `0x1A0000`).
|
||||
{{< /hint >}}
|
||||
|
||||
20
content/advance/license.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "License"
|
||||
aliases:
|
||||
- advance/license.html
|
||||
- advance/license.md
|
||||
---
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2015 Damien P. George, and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Copyright (c) 2017, Pycom Limited.
|
||||
|
||||
This software is licensed under the GNU GPL version 3 or any later version, with permitted additional terms. For more information see the Pycom Licence v1.0 document supplied with this file, or available at [https://www.pycom.io/opensource/licensing](https://www.pycom.io/opensource/licensing)
|
||||
|
||||
53
content/datasheets/_index.md
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: "Introduction"
|
||||
aliases:
|
||||
- datasheets/introduction.html
|
||||
- datasheets/introduction.md
|
||||
- datasheets/introduction
|
||||
- product-info
|
||||
- chapter/datasheets
|
||||
---
|
||||
|
||||
The follow pages contain all information relating to each product, for examples: pinouts, spec sheets, relevant examples and notes.
|
||||
|
||||
## Development Modules
|
||||
|
||||
{{% refname "development/wipy2.md" %}}
|
||||
|
||||
{{% refname "development/wipy3.md" %}}
|
||||
|
||||
{{% refname "development/lopy.md" %}}
|
||||
|
||||
{{% refname "development/lopy4.md" %}}
|
||||
|
||||
{{% refname "development/sipy.md" %}}
|
||||
|
||||
{{% refname "development/gpy.md" %}}
|
||||
|
||||
{{% refname "development/fipy.md" %}}
|
||||
|
||||
## OEM modules
|
||||
|
||||
{{% refname "oem/w01.md" %}}
|
||||
|
||||
{{% refname "oem/l01.md" %}}
|
||||
|
||||
{{% refname "oem/g01.md" %}}
|
||||
|
||||
{{% refname "oem/l01\_reference.md" %}}
|
||||
|
||||
{{% refname "oem/universal\_reference.md" %}}
|
||||
|
||||
## Expansion Boards and Shields
|
||||
|
||||
{{% refname "boards/expansion3.md" %}}
|
||||
|
||||
{{% refname "boards/pytrack.md" %}}
|
||||
|
||||
{{% refname "boards/pysense.md" %}}
|
||||
|
||||
{{% refname "boards/pyscan.md" %}}
|
||||
|
||||
{{% refname "boards/expansion2.md" %}}
|
||||
|
||||
{{% refname "boards/deepsleep/" %}}
|
||||
21
content/datasheets/boards/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "Expansion Boards and Shields"
|
||||
aliases:
|
||||
- product-info/boards
|
||||
- chapter/datasheets/boards
|
||||
---
|
||||
|
||||
This section contains all of the datasheets for the Pycom Expansion Boards and Shields. This includes the Expansion Board, Pytrack, Pysense and Deep Sleep Shield.
|
||||
|
||||
{{% refname "expansion3.md" %}}
|
||||
|
||||
{{% refname "pytrack.md" %}}
|
||||
|
||||
{{% refname "pysense.md" %}}
|
||||
|
||||
{{% refname "pyscan.md" %}}
|
||||
|
||||
{{% refname "expansion2.md" %}}
|
||||
|
||||
{{% refname "deepsleep/" %}}
|
||||
|
||||
19
content/datasheets/boards/_index.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "Expansion Boards and Shields"
|
||||
aliases:
|
||||
---
|
||||
|
||||
This section contains all of the datasheets for the Pycom Expansion Boards and Shields. This includes the Expansion Board, Pytrack, Pysense and Deep Sleep Shield.
|
||||
|
||||
{{% refname "expansion3.md" %}}
|
||||
|
||||
{{% refname "pytrack.md" %}}
|
||||
|
||||
{{% refname "pysense.md" %}}
|
||||
|
||||
{{% refname "pyscan.md" %}}
|
||||
|
||||
{{% refname "expansion2.md" %}}
|
||||
|
||||
{{% refname "deepsleep/" %}}
|
||||
|
||||
26
content/datasheets/boards/deepsleep/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: "Deep Sleep Shield"
|
||||
aliases:
|
||||
- product-info/boards/deepsleep
|
||||
- chapter/datasheets/boards/deepsleep
|
||||
---
|
||||
|
||||
The schematic of the Deep Sleep Shield is available as a PDF File.
|
||||
|
||||
<a href="/gitbook/assets/deepsleep-schematic.pdf" target="_blank"> Deep Sleep Schematic </a>
|
||||
|
||||
## Pinout
|
||||
|
||||
The pinout of the Deep Sleep Shield is available as a PDF File
|
||||
|
||||
<a href="/gitbook/assets/deepsleep-pinout.pdf" target="_blank"> Deep Sleep Pinout </a>
|
||||
|
||||
|
||||

|
||||
|
||||
{{% hint style="info" %}}
|
||||
To correctly connect a WiPy 2.0, LoPy or SiPy to the Deep Sleep Shield, align the white triangle on the Shield with the LED of the Pycom Device. Once the Pycom Device is seated onto the Deep Sleep Shield, this can then be connected to the Expansion Board
|
||||
{{< /hint >}}
|
||||
|
||||

|
||||
|
||||
24
content/datasheets/boards/deepsleep/_index.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "Deep Sleep Shield"
|
||||
aliases:
|
||||
---
|
||||
|
||||
The schematic of the Deep Sleep Shield is available as a PDF File.
|
||||
|
||||
<a href="/gitbook/assets/deepsleep-schematic.pdf" target="_blank"> Deep Sleep Schematic </a>
|
||||
|
||||
## Pinout
|
||||
|
||||
The pinout of the Deep Sleep Shield is available as a PDF File
|
||||
|
||||
<a href="/gitbook/assets/deepsleep-pinout.pdf" target="_blank"> Deep Sleep Pinout </a>
|
||||
|
||||
|
||||

|
||||
|
||||
{{% hint style="info" %}}
|
||||
To correctly connect a WiPy 2.0, LoPy or SiPy to the Deep Sleep Shield, align the white triangle on the Shield with the LED of the Pycom Device. Once the Pycom Device is seated onto the Deep Sleep Shield, this can then be connected to the Expansion Board
|
||||
{{< /hint >}}
|
||||
|
||||

|
||||
|
||||