summaryrefslogtreecommitdiff
path: root/source/microcontrollers/inkplate/index.rst
blob: 04ed9729c6f309751ced3872856309d606dda029 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
**********
 Inkplate
**********

Notes on the Inkplate_ boards.

.. _Inkplate: https://soldered.com/collections/inkplate-e-paper-displays/

MicroPython
===========

Micropython for all of the Inkplate boards can be downloaded by cloning
the repository::

   $ git clone https://github.com/SolderedElectronics/Inkplate-micropython.git
   $ cd Inkplate-micropython

then the firmware can be flashed directly with esptool::

   $ esptool --port /dev/ttyUSB0 erase_flash
   $ esptool --port /dev/ttyUSB0 --chip esp32 --baud 115200 write_flash \
     --flash_mode keep --flash_size keep --erase-all 0x1000 \
     Inkplate-firmware.bin

under Debian, you may need to use ``--no-stub``, because of `#1043168`_::

   $ esptool --port /dev/ttyUSB0 --chip esp32 --baud 115200 --no-stub \
     write_flash --flash_mode keep --flash_size keep 0x1000 \
     Inkplate-firmware.bin

.. _`#1043168`: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1043168

Then the libraries can be copied to the board from the local copy::

  $ mpremote fs mkdir lib
  $ mpremote fs cp <board>/package.json :lib/
  $ mpremote fs cp <board>/<board>/*.py :lib/
  $ mpremote fs cp Dependencies/*.py :lib/

e-radionica / crowdfunding models
---------------------------------

The old inkplate6 models from e-radionica / the crowdfunding are `not
supported yet by the current version of the Inkplate module
<https://github.com/SolderedElectronics/Inkplate-micropython/issues/47>`_,
but they can run the old version in the ``legacy`` branch::

   $ esptool --port /dev/ttyUSB0 erase_flash
   $ esptool --port /dev/ttyUSB0 --chip esp32 --baud 115200 write_flash \
     --flash_mode keep --flash_size keep --erase-all 0x1000 \
     esp32spiram-20220117-v1.18.bin

   $ mpremote fs mkdir lib
   $ mpremote fs cp mcp23017.py inkplate6.py image.py shapes.py gfx.py gfx_standard_font_01.py soldered_logo.py :lib/

Recovering from corrupted storage
---------------------------------

Because of `#1043168`_, at the moment Debian is missing the
(json-encoded binary) file
``/usr/lib/python3/dist-packages/esptool/targets/stub_flasher/stub_flasher_32.json``:
the option ``--no-stub`` may be used to perform *most* operations
(possibly at a slower speed), but ``erase-flash`` is not among the
supported ones.

In that case you may need to clone the upstream repository::

   $ git clone https://github.com/espressif/esptool.git

and copy or link the correct file in the esptool package files::

   # cd /usr/lib/python3/dist-packages/esptool/targets/stub_flasher
   # ln -s /<path/to/repo>/esptool/esptool/targets/stub_flasher/1/esp32.json stub_flasher_32.json

and then regular commands, including ``erase_flash`` can be run.

See also
========

* `Documentation for micropython on the ESP32
  <https://docs.micropython.org/en/latest/esp32/quickref.html>`_
* `Inkplate micropython library
  <https://github.com/SolderedElectronics/Inkplate-micropython>`_
* `Issue related to the original Inkplate 6
  <https://github.com/SolderedElectronics/Inkplate-micropython/issues/47>`_

..
   vim: set filetype=rst: