After having difficulties with the Adafruit Feather ESP32 and static discharge sensitivity, I needed to find a suitable alternative for my previous, current and future ESP32 based projects.
After testing a variety of ESP32 boards (none of which exhibited the static discharge sensitivity), I ultimately selected the "Heltech WiFi Kit 32" board (available on line). The board features a micro usb port for programming and charging, a JST 1.25 mm 2 pin connector (note this connector is smaller than most JST connectors I've used) and charger for a lithium battery , wifi, bluetooth, and an on board 128 by 64 OLED display, all for around $17.00 USD.
My first project for this board was to port a wifi network scanner I had developed for previous projects (the source code for the port is included as an Arduino .ino file). Most of the display samples I located for this board utilized a software implementation for I2C communication with the OLED. The included source code uses the hardware I2C for communication with the OLED.
I'll be porting more of my Feather applications to this board.
Step 1: Arduino Setup
The included software is for the Arduino environment. You will need to download and install the appropriate board and graphic libraries into the Arduino environment.
The photo shows the settings I selected on the Arduino "Tools" menu.
Step 2: Software
Two includes are required; WiFi.h for the wifi code, and U8g2lib.h for the graphics code. Again, these libraries must be downloaded and installed in the Arduino environment before compiling and downloaded the code to the Heltech WiFi Kit 32 board. I obtained the graphic library here: u8g2.
The software contains the two standard Arduino functions setup() and loop().
The setup() function places the wifi in station mode, then initializes the graphics.
The loop() function begins by obtaining the count of networks detected via wifi, then clears the display buffer in preparation for a new page. Next, if the network count is 0, then the message "0 networks found" is written into the display buffer. If the network count is non-zero, then a for loop is entered to write each of the network ssids found along with the rssi and and network encryption (space if open, asterisk if encrypted), into the display buffer.
Once all networks are written into the display buffer, the for loop exits and the display buffer is sent via hardware I2C to the OLED.
Finally, after a short delay, the main loop is repeated.
I have more testing to perform with this board, but so far it's appearing to be a great alternative to previous boards I've used.