Coder Social home page Coder Social logo

wireless-midi-controller-remote's Introduction

Wireless midi controller remote

The remote sends commands to the servant.

1. Prerequisites

1.1 ESP32

Firstly - of course - you will need an ESP32. ESP32's come in all sorts and shapes. In my case, I will be using an Espressif ESP32_DevKitc_V4, which is a very common ESP.

1.2 Python

In order to be able to use MicroPython, we will be using Python. This means you need to install Python (or at least pip) before being able to start messing around with MicroPython. I highly recommend getting the latest stable Python 3+.

After installation, you can verify if your installation works by typing this command in a fresh Command Prompt.

python -V

The output for me implies that I am using Python 3.8.5.

C:\Users\valen>python -V
Python 3.8.5

2. MicroPython

2.1 Installation

First get the appropriate firmware for your board. In my case, I use a specific v4.x version: GENERIC : esp32-idf4-20200902-v1.13.bin.

Secondly, we need to install the esptool:

pip install esptool

Deploy firmware

โš ๏ธ Make sure your ESP32 is properly connected to your computer.

First we need to erase the current firmware. To be able to do that, we need to know to which port our ESP32 is connected to. Open the device manager and look in the Ports view for an indication of your ESP32. Mine apparently is registered at port COM4.
Device Manager

Now that we know what port our ESP32 is connected to, we can remove the current firmware:

esptool.py --port COM4 erase_flash

The output should look similar to this:

esptool.py v3.0
Serial port COM4
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 8c:aa:b5:b5:86:50
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 17.0s
Hard resetting via RTS pin...

Then we write our downloaded firmware to the ESP32.

esptool.py --chip esp32 --port COM4 write_flash -z 0x1000 esp32-idf4-20200902-v1.13.bin

The writing itself might take a couple of minutes. This should be the output more or less:

esptool.py v3.0
Serial port COM4
Connecting.....
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 8c:aa:b5:b5:86:50
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 1456544 bytes to 928552...
Wrote 1456544 bytes (928552 compressed) at 0x00001000 in 82.9 seconds (effective 140.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Testing

Now we can test our firmware installation by connection to the COM4 port at a Baud rate of 115200. There are a couple of tools out there like TeraTerm and PuTTY (and mayne more). Since PuTTY is a very well known tool and is very easy to use, I will stick to that.
Install PuTTY, open it and create a new session with these settings (save the session):
PuTTY session

When you open the session, and don't see >>> or see weird output, then reset the ESP32 by pressing the reset button on the device (EN button).

By following these steps, we now have opened a REPL connection.

We can now start typing Python and MicroPython commands. Try a simple Hello world:

print("Hello ESP32!")

If the output is what we expect, then we can move on to the real work.

pip install adafruit-ampy ampy --port COM4 put src/main.py

https://www.studiopieters.nl/esp32-pinout/ https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/index.html

TTGO

http://www.lilygo.cn/prod_view.aspx?TypeId=50033&Id=1126&FId=t3:50033:3

https://www.instructables.com/TTGO-color-Display-With-Micropython-TTGO-T-display/

# erase flash
esptool.py --port COM7 erase_flash

# flash firmware
cd workspaces/esptool
python esptool.py --chip esp32 --port COM7 --baud 460800 --before default_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader/bootloader.bin 0xf000 phy_init_data.bin 0x10000 MicroPython.bin 0x8000 partitions_mpy.bin

# upload main scripth
ampy --port COM7 put remote/src/esp32ttgo/main.py

wireless-midi-controller-remote's People

Contributors

valentingregoire avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.