GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — midi-controller/esp32 at master · Pi3rral/midi-controller

Expand file tree

/

esp32

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

esp32

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
.vscode
.vscode
 
 
all_banks/00.TerraformColliderBasics
all_banks/00.TerraformColliderBasics
 
 
banks
banks
 
 
banks_dir
banks_dir
 
 
banks_existenza
banks_existenza
 
 
firmware
firmware
 
 
img
img
 
 
presets
presets
 
 
src
src
 
 
tools
tools
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 

README.md

Outline

Using Micropython on ESP32 DevKit board

Tools

Useful Links

https://docs.micropython.org/en/latest/esp32/quickref.html https://www.digikey.ca/en/maker/projects/micropython-basics-load-files-run-code/fb1fcedaf11e4547943abfdd8ad825ce

Local Virtualenv

Using pyenv-virtualenv micropython: pyenv virtualenv activate micropython

pip install -r requirements.txt

Flash firmware

Erase and flash on ESP32 (option to erase at the same time is not working) WARNING: Using more recent firmware (or custom) is not working yet

python -m esptool --port /dev/tty.usbserial-0001 erase_flash
python -m esptool --port /dev/tty.usbserial-0001 --chip esp32 --baud 460800 write_flash -z 0x1000 firmware/esp32-20210902-v1.17.bin

Build Firmware

Building in docker image:

docker build -f firmware/Dockerfile -t midigoat .
docker run --rm -ti --volume $PWD/firmware:/root/export midigoat /bin/bash -c "cp /micropython/ports/esp32/build-GENERIC/firmware.bin /root/export/esp32-generic-midigoat.bin"

Firmware is located in the image at /micropython/ports/esp32/build-GENERIC/firmware.bin

Test live

ampy --port /dev/tty.usbserial-0001 run src/main.py

Upload file

Don't forget to remove pyc files!

find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
ampy --port /dev/tty.usbserial-0001 put src/wifi.py /wifi.py
ampy --port /dev/tty.usbserial-0001 put src/midicontroller /midicontroller
ampy --port /dev/tty.usbserial-0001 put banks_dir /banks_dir
ampy --port /dev/tty.usbserial-0001 put src/main.py /main.py

or from the rshell

rsync presets /pyboard/presets
rsync banks_existenza /pyboard/banks
rsync src/midicontroller /pyboard/midicontroller
cp src/wifi.py /pyboard/
cp src/main.py /pyboard/

Connect to REPL

Using screen

screen /dev/tty.usbserial-0001 115200

exit with Ctrl-A; Ctrl-\

Using rshell

rshell -p /dev/tty.usbserial-0001

exit with Ctrl-D

from rshell

repl

exit with Ctrl-X

Free Flash Space

From REPL

import uos
fs_stat = uos.statvfs('/')
fs_size = fs_stat[0] * fs_stat[2]
fs_free = fs_stat[0] * fs_stat[3]
print("File System Size {:,} - Free Space {:,}".format(fs_size, fs_free))

Wiring Schema

R-Tx = 10 Ohm

R-V3.3 = 47 Ohm

diagram

Note: Connect 74HC165 to Pin D3 (GPIO0) make the board fail to boot.

External Libraries Used

https://github.com/adafruit/Adafruit_CircuitPython_MIDI

  • added __str__ to MIDIMessage, ProgramChange and ControlChange classes

https://github.com/dhylands/python_lcd

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.