Download and install: https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
Start a command prompt or Powershell session and run the following:
conda init # Initialize shell support for Conda
conda create -n esp32-pump -c conda-forge -c sci-bots -c sci-bots/label/dropbot nodejs astroid ecdsa isort lazy-object-proxy mccabe pylint pyserial typing websocket-client pyserial six jupyter notebook jupyterlab jupytext autopep8 ipywidgets asyncserial pyaes pyside2 grove-i2c-motor-driver
conda activate esp32-pump
conda config --env --append channels conda-forge
jupyter labextension install @jupyter-widgets/jupyterlab-manager
git clone https://github.com/sci-bots/esp32-pump-driver
Start a command prompt or Powershell session and run the following:
conda activate esp32-pump
cd esp32-pump-driver
jupyter lab
- Launch
notebooks/MicroPython RPC - pump UI.py
notebook - Run all cells.
- Use IPython widgets to trigger pump actions:
The following instructions are only required if you plan to modify the code running on the ESP32 (not required for pump user interface).
See README-rpi.md
for instructions for the Raspberry Pi 3.
Start a Powershell session and run the following:
conda activate esp32-pump
pip install esptool
pip install mpy-repl-tool
python -m there.jupyter-setup
- Download the latest MicroPython for ESP32 here to
~\Downloads
(e.g.,C:\Users\christian\Downloads
). - Start a Powershell session and run the following:
conda activate esp32-pump
# Attempt to autodetect COM port
$ESP_PORT = $(python -c "import serial.tools.list_ports as lp; print('\\n'.join([p.device for p in lp.comports()]))" | Sort-Object | Select-Object -first 1)
# Attempt to autodetect esp32 MicroPython firmware
$ESP_MICROPYTHON = "$(Resolve-Path ~\Downloads\esp32*.bin | Sort-Object -Descending | Select-Object -first 1)"
esptool --port $ESP_PORT --baud 460800 erase_flash
esptool --port $ESP_PORT --baud 460800 --chip esp32 write_flash -z 0x1000 $ESP_MICROPYTHON
# Bootstrap with code
python -m there ls
# Copy files to `build` directory.
Copy-Item -Recurse .\app\* -Destination build\app
Copy-Item -Recurse .\lib\* -Destination build\lib
# Add Sci-Bots Conda-packaged MicroPython libraries.
cmd /C robocopy "$env:CONDA_PREFIX/share/platformio/micropython-lib" build/lib /s
copy boot.py build
python -m there push -r build /
- Reset board and display serial output:
python -m there --reset -i
- Press
Ctrl+C
to enter read/execute/print loop (i.e., REPL). - Press
Ctrl+]
to quit.
Note that the code above assumes that the $ESP_PORT
and $ESP_MICROPYTHON
environment variables are set to the serial port and the MicroPython firmware
file path, respectively.