SSD1306Ascii icon indicating copy to clipboard operation
SSD1306Ascii copied to clipboard

New SSD1306 128x64 I2C modules producing garbled text but work fine with Adafruit library

Open peteDDD opened this issue 11 months ago • 2 comments

I have been using this great library for at least 5 years now. I really appreciate the small size and the great feature set which is much better for managing constantly changing ascii screens. Thanks!

Now for the last few batches of SSD1306 .96-inch 128x64 modules, they are all displaying garbled text. In fact, I threw out a bunch of them thinking they were bad from the factory... I decided though to test them using the example Adafruit library code and they worked just fine. No garbled text. The thing is, I prefer your library as I have built many of your functions into my code that the Adafruit library just does not have. I have tried multiple fonts and two I2C speeds but get similar results.

I am using your example code for the test. Also please see attached photos of the display output from this code.

Again, this is the second batch of displays from different manufacturers that have shown these problems. This one is labeled: "TS00356a-0.96-Lanban-Bai Display Module 12864 LCD Screen Board for Arduino Color: SSD1306 White"

Any clues for me?

THANKS!

#include <Arduino.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"

// 0X3C+SA0 - 0x3C or 0x3D
#define OLED_I2C_ADDRESS 0x3C

// Initialize display
SSD1306AsciiWire oled;

// forward declaration
void clearField(uint8_t col, uint8_t row, uint8_t width);

void setup()
{
  Wire.begin();
  // two clock speeds tried
  Wire.setClock(400000L); // Fast I2C mode
  // Wire.setClock(100000L); // Slow I2C mode

  Serial.begin(9600);

  // Initialize OLED - try these options one at a time:
  oled.begin(&Adafruit128x64, OLED_I2C_ADDRESS); // Current - produces garbled characters   
  // oled.begin(&SH1106_128x64, OLED_I2C_ADDRESS);        // Try this option for SH1106 displays
  // Alternative options if needed:
  // oled.begin(&Adafruit128x32, OLED_I2C_ADDRESS);    // For 128x32 displays
  // oled.begin(&Adafruit64x32, OLED_I2C_ADDRESS);     // For 64x32 displays

  // Set font  Three fonts tried
  // oled.setFont(Callibri15);
  // oled.setFont(System5x7);
  oled.setFont(Adafruit5x7);

  // Clear the display
  oled.clear();

  // First row - double size text
  oled.set2X(); // Double size text
  oled.println("Hello!");

  delay(2000);

  // Second row - normal size text
  oled.set1X(); // Normal size text
  oled.println("OLED Display");

  // Third row
  oled.println("Testing 123");
}

void loop()
{
  // Your loop code here8X64
}

Platformio.ini:

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
;upload_port = COM4
board_build.variants_dir = variants
board_build.variant = mcupro
lib_ldf_mode = chain
lib_extra_dirs = ~/Documents/Arduino/libraries

lib_deps = 
    greiman/SSD1306Ascii @ ^1.3.5

peteDDD avatar Dec 16 '24 16:12 peteDDD

Any clues for me?

I suspect the controller is not strictly SSD1306 compatible.

Unfortunately I no longer have time to maintain this library.

greiman avatar Dec 16 '24 20:12 greiman

ok. but thanks for what was a great library!

On Mon, Dec 16, 2024 at 3:14 PM Bill Greiman @.***> wrote:

Any clues for me?

I suspect the controller is not strictly SSD1306 compatible.

Unfortunately I no longer have time to maintain this library.

— Reply to this email directly, view it on GitHub https://github.com/greiman/SSD1306Ascii/issues/123#issuecomment-2546633676, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQI5JSJ4JY7QYVQV2SLUAD2F4YBFAVCNFSM6AAAAABTWQ2O4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBWGYZTGNRXGY . You are receiving this because you authored the thread.Message ID: @.***>

peteDDD avatar Dec 16 '24 22:12 peteDDD

Hi, I want to report that I am facing the same or similar problem with the new, recently purchased, SSD1306 7-pin SPI modules. I have been successfully using this wonderful library with these 7-pin SPI modules since 2016. But some modules I recently purchased in 2025 simply don't work with this library, but they do work with the Adafruit libraries. I am reporting this issue for the record. Many thanks for this excellent library which I have used for my flight simulator autopilot displays.

tomahawk66 avatar Sep 22 '25 11:09 tomahawk66

tomahawk66 There are now several new variations on the SSD1306 in recent OLED modules.

I need to acquire samples in order to address this issue. Currently I am very busy so don't know when I will update this library for these controllers.

Edit:

But some modules I recently purchased in 2025 simply don't work

Could you give me a link to sites where I can buy test examples?

greiman avatar Sep 22 '25 12:09 greiman

Hi,

I am based in India and I purchased these at local sites:

https://kitsguru.com/products/0-96-inch-oled-display-module-spi-i2c-iic-128-64-7-pin-white?variant=46694638092540&srsltid=AfmBOop9EaPqIGPzkw5uYEYAzAcpWxTsIokgJ6Q2zppjkylNiOqGfy5S and https://www.ktron.in/product/oled-display-0-96-inch-spi-white-7-pin/?utm_term&utm_campaign=smartShoppingAds4&utm_source=adwords&utm_medium=ppc&hsa_acc=6332829093&hsa_cam=18276269511&hsa_grp&hsa_ad&hsa_src=x&hsa_tgt&hsa_kw&hsa_mt&hsa_net=adwords&hsa_ver=3&gad_source=1&gad_campaignid=17841850987&gclid=Cj0KCQjw58PGBhCkARIsADbDilyCcj_n-3N-Th9A7tFB7ky_0JqjLjv3Kc4PhyRbRWsBd7wCwq-qrk0aAvULEALw_wcB&v=c86ee0d9d7ed and https://www.flyrobo.in/0.96-inch-spi-i2c-oled-128-64-display-module-7-pin-blue?srsltid=AfmBOopIReGCGj5kYe_V2YPIIxA8KCJo9dRJJmcP1ooXgcSqQfptxATx

These suppliers would have sourced these from China, of course.

If you can provide me a postal address I can attempt mailing one of each of these to you.

Many thanks!

tomahawk66 avatar Sep 23 '25 01:09 tomahawk66

tomahawk66 If you can send one of each of those modules, I will attempt to find a fix.

You can try to sending to this address:

Madera Solutions 3563 Aikin Pl Santa Rosa, CA 95404 USA

greiman avatar Sep 23 '25 16:09 greiman