ESP32 build settings
PlatformIO under VScode
After putting up with the Arduino IDE interface under VScode for far too long I switched to using PlatformIO with VScode.
The performance change is remarkable, build take a fraction of the time the Arduino IDE takes.
It is strongly recommended to use this VScode + PlatformIO combination.
The reason for change?
PlatformIO supports inline debugging using JTAG via an ESP-PROG device WINNER WINNER, CHICKEN DINNER!
I have still yet to receive my ESP-PROG, but the performance improvement just in building the app is worth it alone.
You still need to select minimal-spiffs, but that is already defined in the platformio.ini file in the repository :-)
Arduino Board Configuration
There are quite a few ESP32 boards to select from within the Arduino IDE.
This make it more confusing than is really required.
The ESP32 processor we are targeting in this design is housed within a ESP-WROOM-32 module.
The de facto standard ESP32 Dev kit used this design, and it highly recommend to just pick this board configuration, even if you use a different brand; eg: DoIt.
By doing so, you get a wider choice of partitions to use, which is important.
Minimal SPIFFS Partition Scheme
When the compiled binary size with WiFi code approaches 1Mbyte, for some weird obtuse reason the Default Partition Scheme produces weird behaviour (despite 1.4MB being available); eg:
- Watchdog timeouts during reboot, causing a constant reboot cycle (visible via serial port debug)
- Web pages not being served
- TelnetSpy not responding to telnet connections
For reliable operation, you must use the Minimal SPIFFS Partition Scheme in the Arduino board configuration options.
Enable SPIFFS upload in Arduino IDE
Install the Arduino ESP32 filesystem uploader: https://github.com/me-no-dev/arduino-esp32fs-plugin
Required libraries
ESP32
The ESP environment must be added to the Arduino environment.
https://github.com/espressif/arduino-esp32 or
https://dl.espressif.com/dl/package_esp32_index.json (V1.0.1)
Libraries - now included in /src/Afterburner/src/Libraries
DO NOT ADD TO ARDUINO IDE
-
WifiManager : The one from stock library manager didn't work with esp32, try https://github.com/tzapu/WiFiManager/tree/development
-
TelnetSpy : https://github.com/yasheena/telnetspy
-
OneWire: https://github.com/stickbreaker/OneWire (for ESP32)unreliable bit-banged one-wire comms -
DallasTemperature: https://github.com/milesburton/Arduino-Temperature-Control-Library -
esp32-owb : https://github.com/DavidAntliff/esp32-owb reliable RMT peripheral based one-wire comms
-
esp32-ds18b20 : https://github.com/DavidAntliff/esp32-ds18b20 works with esp32-owb
-
WebSockets: https://github.com/Links2004/arduinoWebSockets
-
ArduinoJSON: https://github.com/bblanchon/ArduinoJson
- The Arduino IDE insists upon installing the latest version. This will not work properly.
- Please refer to https://arduinojson.org/v5/faq/
-
Adafruit_GFX: https://github.com/adafruit/Adafruit-GFX-Library
-
Adafruit SH1106 (for ESP32): https://github.com/nhatuan84/esp32-sh1106-oled
-
PubSubClient - https://github.com/knolleary/pubsubclient