A&A Milano Smart Park Project
Firmware developed with the Arduino IDE v2 by Norman Mulinacci @ 2023
The project runs on Espressif's ESP32-DevkitC with ESP32-WROVER-B module
- Arduino core for the ESP32 version 2.0.14
- To download the core through the Arduino IDE, you need to add the following URLs in File -> Settings -> Additional URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Libraries listed below can be installed through the Arduino IDE Library Manager:
- U8g2 Arduino library version 2.34.22
- SSLClient Library version 1.6.11
- BSEC Arduino library version 1.8.1492
- PMS Library version 1.1.0
- TinyGSM Library version 0.11.7
You will also need to install a modified version of MiCS6814-I2C-MOD-Library which is not available through the Arduino Library Manager and must be imported manually:
If you already have the official or any another version of the MiCS6814-I2C-Library installed in your IDE environment, you'll need to first remove it. Libraries are installed to folders under {sketchbook folder}/libraries
. You can find the location of your sketchbook folder in the Arduino IDE at File > Preferences > Sketchbook location. Just delete the appropriate library directory.
- Board --> esp32 --> "ESP32 Dev Module"
P.S: When building, Core Debug Level can be set from "None" to "Verbose" to have a less or a more detailed serial output.
On supported build platforms (i.e. Linux, MacOs), you can use make
to build
the firmware. The provided Makefile
includes targets for installing all required
dependencies as well.
To download all required Arduino build tools and dependencies (core and libraries) clone this repo and run the following command from within the cloned directory:
make env
Then, to build the firmware, simply run:
make
The firmware binary and all build artifacts will be located under the var/build
directory. Run make help
for details on all targets supported by the Makefile
.
To run the build to completion, a working Python interpreter must be installed
on your build system, along with the
pyserial
library.
-
Connect the ESP32 board to a USB port on your PC.
-
Check that it's been detected correctly: it should appear as
Silicon Labs CP210x USB to UART Bridge (COMx)
(check in Windows Device Management). If not, download the drivers and install them manually through Device Management:- for Windows 10/11: https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver.zip
- for older Windows versions: https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers.zip
-
Download the latest release, extract it and run
runme.bat
. The script will automatically scan for the right COM port and then erase, flash and verify the board. If it stays on "Connecting..." for too long, hold the "BOOT" button of the ESP32 board and try again. If it still doesn't work, try on a different USB port. -
If it verifies OK, you are done!
-
Connect the ESP32 board to a USB port on your Mac.
-
Download and install the drivers for macOS: https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip When installing, you need to authorize them in macOS Security Settings. Check that the device appearsin macOS System Information, otherwise disconnect and reconnect the USB cable. If it still doesn't find it, try a different USB port.
-
Download the latest release, extract it. In the Terminal, move to the msp-firmware folder using the
cd
command; then make the.sh
files executable with these commands:chmod +x install-pip-esptool.sh
andchmod +x flash-msp-firmware.sh
. -
Run the install script with this terminal command:
./install-pip-esptool.sh
(you might need to authorize its execution in macOS Security Settings). This will check if Python3 is installed (it might ask to install Developer Tools: if it does, install them), and it will install pip and the esptool program needed for the flashing process. -
After the installation is done, run the install script with this terminal command:
./flash-msp-firmware.sh
(you might need to authorize its execution in macOS Security Settings). The script will erase, flash and verify the board. If it stays on "Connecting..." for too long, hold the "BOOT" button of the ESP32 board and try again. If it still doesn't work, try on a different USB port. -
If it verifies OK, you are done!