I have several sketches that I wrote for the Heltec WiFi Kit 32 v3 which use the U8g2lib.h library and they all work fine on my original Heltec WiFi32 v3 OLED which I bought off Amazon.de two months ago. I have just bought a new Heltec WiFi Kit 32 v3, again via Amazon.de and set it up on my Arduino IDE but the new Heltec WiFi Kit 32 v3 OLED remains blank when running these sketches although the monitor shows the sketches are running. I have tried the example OLED sketches for the Heltec WiFi32 v3 and it works fine although the examples use the HT_SSD1306Wire.h library. Why can’t a sketch that runs on the original Heltec WiFiKit 32 v3 OLED not work on a new Heltec WiFi Kit 32 v3 OLED?
Differences between WiFi Kit 32 v3 boards
One comment I can offer here is that Heltec has form when it comes to changing the internals of a board without saying anything about the change and, on occasion, without visibly changing anything on the board, including the board version identifier. It may simply be that your earlier boards are from a different production run and are indeed different, in spite of any indication to the contrary. As to what the difference might be, you may have to poke around in the Heltec documentation area to see if there’s anything that might indicate a change in configuration that might be causing the problem you are observing.
The being said, I seem to recall there being issues in the past with using the U8g2lib
library. Given that the Heltec display library works, you could try searching these forums on “u8g2lib” for anything else that may be biting you.
I thought that maybe the i2c address of the OLED had been changed. In the example using the HT_SSD1306Wire.h library, which works, 0x3c is used. So using the info in this thread I set the i2c address in the U8g2lib.h library to 0x3c but this had no effect and the OLED remains blank.
Fixed. The solution was to reset the OLED before the u8g2.begin command. I did this with:
pinMode(OLED_RESET, OUTPUT);
digitalWrite(OLED_RESET, LOW);
delay(50); // Wait for OLED to fully power down
digitalWrite(OLED_RESET, HIGH);
delay(50); // Give time to initializeu8g2.begin();