A multi-function ESP32 board with Ether (100BASE-TX), CAN-bus, and OLED, and LiPo charger and FTDI
As mentioned before, a great programmer "MrBuddyCasino" succeeded to make "practical" ESP32 web radio by I2S and just last week, he again added Bluetooth Audio support in the same source. As same, I quickly added OLED display driver to this wonderful source, which is uploaded to
For compiling this source, please note to use latest ESP-IDF otherwise you will see lots of errors.
Now I would like to introduce "how to activate bluetooth audio by ESP32"!!
As the first step, you need to enter Component config and
Check (activate) bluetooth and entering it....
Activate "Classic Bluetooth", then go up again to top level...
and entering Web Radio / Bluetooth Speaker selection
, and just select activate Bluetooth Speaker Mode will turn your ESP32 module into Bluetooth Audio Receiver!!!!
In the https://github.com/kodera2t/ESP32_OLED_webradio , I slightly changed source to define bluetooth device name by include/bt_config.h, which default is "hogehoge_mont".
Just after binary uploading, you will see your ESP32 device on iPhone or any bluetooth capable device and just connect to it, your ESP32 module become "audio receiver" !!! Of course, sound quality is perfect if ESP32 with proper I2S D/A converter, like this board!
ESP32 is quite powerful MCU but unfortunately at this moment Arduino environment cannot make it show ESP32's full ability. Very quick way to maximize ESP32 power is using ESP-IDF, the Official development framework for ESP32. It can work on Win, OSX, and Linux and here I would like to show the flow how to program ESP32 by esp-idf on OSX.
Here I would specifically show the case of WiFi web-radio application with OLED display, which can be downloaded from GitHub. After finishing esp-idf environement arrangement, you can put the project folder within esp folder as show in the above picture...
Inside project folder, you will see lots of files and here app_main.c is the main C source. If you installed Xcode, may be C is associated with Xcode and you can edit source (not compile) by Xcode comfortably.
If you want just try web radio by my board, you can skip C-code editing but just type
the blue-backed menu in console. Yeah you can remember linux kernel compiling in tens years ago! If this menu does not appear in console, your esp-idf environment is incomplete. Please re-check Espressif web site procedure.
You also can change it through source code editing but it is quite handy to change SSID and password for WiFi connection by this menu.
Please change SSID and password matching to your environment.
If your application does not need WiFi connection, you don't need to touch the previous procedure of SSID/password, but this "Default serial port" should be matched to your ESP32 board. Every time changing board, please check serial device by just "ls /dev/" and find serial device recognized by OS. (In Windows, it may be /dev/COM4 or something.)
After editing/saving everything you need, exit menuconfig and just type
make -j5 clean; make -j5; make flash
"-j5" is suitable if your computer has quad core or more, and it will boost-up compile.
After minutes, you will be backed to command prompt after binary uploading. If no error and seeing "Hard resetting..." then new binary is uploaded to ESP32 successfully!! Have fun1
Also this is just a by-product, but the wonderful code in
is modified to support OLED display to show receiving station information! Fun to see, have fun!
The ESP Monster board (which is available at https://www.tindie.com/products/microwavemont/esp32-monster-board-ether-can-oled-all-in-one/ ) has Ether/OLED/Can-bus/Lipo charger/FTDI, all in one board.
This time I made a sample code of Ether and OLED, which is uploaded to my GitHub account at
Actual operation can be found in the following movie.. Have fun!
Not limited to I2C, most of function of ESP32 can be re-arrangeable in Arduino IDE. It is quite easy just by editing "pins_arduino.h" in your ESP32 compiler environment. For the case of Monster board, I2C should be changed from GPIO21/22 to GPIO13/14 as follows
YES, this is all you need to re-arrange. please note some of special pins (GPIO 12, 0, 1, 3, ....) are not accessible because each of them has some function during booting.
This is the pinout of the monster board. It is a composite board with three big function
RMII consumes lots of GPIO as written in the attached above picture. At this moment, Ether and CAN-bus programming requires Espressif's environment, esp-idf
This is the schematic of main part. Nothing special except for re-arrangement of I2C connection to GPIO13/14, because original GPIO21/22 are occupied by LAN8720 connection, which is not re-arrangable. (LAN8720 connection is dominant..)
And this is the sub part of schematic. LAN8720 part needs several attention for 50MHz clock generation. Clock signal should be connected to GPIO0, but if it is connected for booting time, ESP32 does not boot-up and will wait for new binary upload. Very short instance just after power on, 50MHz clock should be turned-off (or clock part should be disconnected). Inserting very simple R-C delay in clock EN terminal of oscillator can avoid this problem (R30 and C2 in the schematic). By this completed circuit, every function works without any problem and ESP32 boot up correctly.
Ether interface extension requires bunch of GPIO and one of "headache" arises around GPIO0. But now this is totally fixed by circuit.
Details will be explained later. please give me a moment...