Adafruit_SSD1306 conflicts with Serial Monitor

Running the simplest sketch on an ESP8266MOD, the Serial Monitor works fine at 115200 with Serial.print() until I call display.begin(), then the serial monitor fails to output anything (but the display works fine).

Is this known that the serial monitor is incompatible with OLED displays? Unusual? Is there a work-around?

Thank you!

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project.

Maybe there is a display.stop() or pause command I could call before using the serial monitor? I cannot find such.

I'm not really familiar with 8266. A possible explanation is that your display uses the same pins as are used for the serial communication.

A schematic and your code might be useful.

Only if you specifically make it so by using a serial display and share the same pins. You have a number of options.

  1. Run the display on a software serial port, using different pins

  2. Use a different version of the display, one that uses the I2C bus.

  3. Ditto on the SPI bus.

  4. Reconsider whether you really need both the display and the serial monitor at the same time. It seems rather pointless to me.

Blockquote

My schematic is:
D1 -> clock pin on the display
D2 -> data pin on the display

Is that not I2C?

I don't necessarily need them simultaneously save for convenient debugging. Seems odd.

It is known that OLED are compatible with serial monitor.

Yes

No work-around is needed, just fix your code/circuit.

A description of your circuit is not a schematic, especially not a partial one. But those are the correct pins for i2c. How is serial monitor connected?

You have either a wiring or code problem, or both.

Post the code, using code tags, and a hand drawn wiring diagram, and folks will be happy to provide helpful observations.

For posting hints, carefully read and follow the directions in the "How to get the best out of the forum" post, linked at the head of every forum topic.

Thanks so much, turns out I had the reset pin set to 1 instead of -1.
The corrected line now reads:

Adafruit_SSD1306 display(W, H, &Wire, -1);

I am just reading it through Arduino software on a pi4 through the same usb port I use to upload, is there another common way out of curiosity?

If you had posted the code in the original post, as the forum guide suggests, there's a good chance someone would have spotted that error for you earlier.

The board you appear to be using does not have a USB interface:

So I assumed you were using a usb-serial adapter of some kind, such as


so there was the possibility you had connected it incorrectly and maybe that was part of the problem.

1 Like

Ah, nah, it's just the same 8266 you see for sale literally everywhere on the internet, I have never seen it sold bare like that, probably wouldn't be asking a "hello world" question about the serial monitor if I was using it bare, lol.

The answer to whether or not the behavior was irregular was sufficient to make me pry deeper, thanks again.

There must be 50+ esp8266-based boards available. You were specific: ESP8266MOD, so I googled and found that.

So... To avoid confusion, get to the right answers quickly and avoid wasting your time and others time:

  • Post your code
  • Post your schematic
  • Post links to the components you are using

These suggestions and more are explained in the forum guide which can be found in the sticky post at the top of most forum sections. Everyone is encouraged to read them before posting for the first time.

Just to be clear, I should post a schematic and code when I ask questions?

It is not totally clear to me yet whether I should post schematic or code when asking questions.

Please advise.

lolz

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.