Esp32 + SSD1306 Oled 128x64 i2C #935
Replies: 5 comments 2 replies
-
Thank you for sharing how much you are enjoying working with the Moddable SDK! From your manifest, it looks like you are doing quite a bit of exploring. I have some questions about the issue you are seeing:
|
Beta Was this translation helpful? Give feedback.
-
Hi Peter! Thank you for your fast reply.
Im not sure what else to try. Anything comes to mind? |
Beta Was this translation helpful? Give feedback.
-
Good morning! As you mentioned, I hadnt declared the reset pin. After reading different forums I learned the reset pin should be defined with the value of -1 when its not present. Or at least thats how different users were able to use it with the same hardware + sdd1306 driver, programming in arduino.
No luck, sadly. The same problem persists. Is there anything else I should be declaring? On the other hand, taking a look at the "Heltec OLED Wifi Kit 32" thread, I noticed the solution was based on setting the reset pin on low and then high. I don't think this is of any help in the situation we're dealing with here... or am I missing something? Thanks! Cheers! |
Beta Was this translation helpful? Give feedback.
-
Hi there,
Did you ever get this working? I meant to comment about this earlier.
Here are some things to try.
- I would force some delays into the i2c driver.
- I think the reset pin works across the vcc/gnd. I am not very
experienced with hardware. But I don't think you need 5 cables going to
the display.
- Do you have this working with Arduino? Reviewing the thread I did not
see that you used this with arduino first.
- Can you use the Heltec board? It works out of the box and is low cost.
This discussion seems useful as a quick overview.
https://forum.arduino.cc/t/ssd1306-reset-pin/291767/6
This seems useful.
"I can't tell about the problem with the Adafruit library if the reset pin
isn't declared.
I haven't studied that library and am not planning on doing so soon,
perhaps you could have a peek inside that to find out what's going on with
that reset pin in there.
Have a look at that picture on the banggood site.
It shows the ribbon cable, and it has numbers 1 and 30 printed on it.
See if you can follow it to pins 20 and 21, and whether they are connected
or not (you can't always see all connections).
See if pin 14 (/Reset) is connected to a resistor (from VCC) and a
capacitor (to GND)."
Good luck,
Matt
…On Tue, Sep 6, 2022 at 4:54 AM Alex Goodman ***@***.***> wrote:
Good morning!
I took a few days to go through the thread you mentioned and read some
more about the ssd1306 driver and the Oled i2c.
The screen I'm dealing with has 4 PINs, with no reset (the wiring is in
the picture below). It only has sda, scl, vcc and gnd pins (very convenient
for saving pins in the esp32).
[image: Nodemcu + oled 4 pin i2c connection]
<https://user-images.githubusercontent.com/18197264/188625093-ef2c9028-84a8-414c-a83a-a363d4c70024.jpeg>
As you mentioned, I hadnt declared the reset pin. After reading different
forums I learned the reset pin should be defined with the value of -1 when
its not present. Or at least thats how different users were able to use it
with the same hardware + sdd1306 driver, programming in arduino.
So, the next test was to include this reset pin in my manifest:
... "defines": { "ssd1306": { "width": 128, "height": 64, "spi": false,
"i2c": true, "scl_pin": 22, "sda_pin": 21, "rst_pin": -1, "address":
"0x3C", "dither": true, "hz": 600000 } }, ...
No luck, sadly. The same problem persists. Is there anything else I should
be declaring?
On the other hand, taking a look at the "Heltec OLED Wifi Kit 32" thread,
I noticed the solution was based on setting the reset pin on low and then
high. I don't think this is of any help in the situation we're dealing with
here... or am I missing something?
Thanks! Cheers!
—
Reply to this email directly, view it on GitHub
<#935 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AISN6KQYFLH7XCRDINUHV4DV44WGRANCNFSM577IAITQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
.com>
|
Beta Was this translation helpful? Give feedback.
-
I don't have time to answer all...but see below. I highly
recommend getting this working in Arduino first and then it is much easier
to help reverse that in the moddable sdk from there.
On Thu, Sep 22, 2022 at 12:51 PM Alex Goodman ***@***.***> wrote:
Hi Matt!
Thank you for your reply. I havent been able to work this out yet (i got a
little frustrated so I went on with some other tests with other modules of
the ModdableSDK).
Answer to your questions in order:
1- I would force some delays into the i2c driver: Im not sure how to go
about this point. Is there a config in the moddable sdk to add this delay
you mention? My apologies, im new at working with hardware and their
drivers.
You will make some changes to the SDK and recompile. You will add the
delays in the .c file. Most likely drivers/ssd1306/modssd1306.c. You can
just remove the #ifdef for the reset so those delays are always added. You
can add extra with modDelayMilliseconds();
These lines add the delay when we have a reset pin set:
https://github.com/Moddable-OpenSource/moddable/blob/7276ac7ba2d3d5e28301faf9e0a918ee415e2c57/modules/drivers/ssd1306/modSsd1306.c#L233-L241
2- I think the reset pin works across the vcc/gnd. I am not very
experienced with hardware. But I don't think you need 5 cables going to
the display: There is very little or no info on the internet about using
these 4 pin ssd1306 OLEDs with moddable so Ive been reading some arduino
forums to check the wiring connection from other users... As you say, it
seems it doesnt need 5 cables going into it.
The note at the bottom seems to the be jump with a resistor.
3- Do you have this working with Arduino? I didnt try this in arduino. I
came across this screen while I was starting to dig into Moddable and went
ahead and incorporated it to my ESP32 + Moddable tests.
I recommend getting this going with a sample first.
4- Can you use the Heltec board? I hadnt read about this board before you
mentioned it. Im afraid theyre not that well known down here in Argentina.
The reason Im running these tests with an esp32 nodemcu is because its one
of the most powerful low cost availables. Still, i will try to get my hands
on one of those if i get a chance, maybe order one online, but the main
purpose of these tests is to get the most available one working/passing all
the tests.
The HiLetgo board is the same if a vendor has it in Argentina.
https://smile.amazon.com/gp/product/B07DKD79Y9/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
5- LAST BUT NOT LEAST: the citacion below talks about pins 21 and 22 being
connected together in order for the driver to be able to control a 4 pin
I2C. Its fairly difficult to see the connection in back, but it seems they
arent together. I would like to keep the soldering technique i read around
as the last resort. If there is no way to go about this the software/driver
way, Ill try to solder these pins together (its so small Im afraid ill just
ruin it!).
You don't need to solder to do something like this. Do you have the WROOM
on a bread board? If so you just jump(connect) the pins there. Or jump it
on the 4 cables.
… Have a look at that picture on the banggood site.
It shows the ribbon cable, and it has numbers 1 and 30 printed on it.
See if you can follow it to pins 20 and 21, and whether they are connected
or not (you can't always see all connections).
See if pin 14 (/Reset) is connected to a resistor (from VCC) and a
capacitor (to GND)."
Ill be trying some more stuff in the next few days. Thank you so much.
—
Reply to this email directly, view it on GitHub
<#935 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AISN6KXIS4IEJAQDPDVWQKDV7S2CLANCNFSM577IAITQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
.com>
|
Beta Was this translation helpful? Give feedback.
-
Hello there!
First of all, id like to say Ive been testing the Moddable sdk the last few months and im absolutely happy with this discovery. Ive been looking for a JS/Node solution to microcontroller programming for a long time. Congratulations, this project is great!
My problem right now is getting a monochrome ssd1306 Oled 128x64 working with an Esp32/nodemcu on I2C. The screen turns on but only a small fraction of it seems to be responding as it should and the rest of its area is just random pixels, some on and some are off.
My manifest looks like this (theres also other modules loaded since im testing many things for a project):
The main.js is using an example for testing the screen:
I attach a picture of the screen. Marked in red is the area that seems to be running the example code.
Thank you in advance! Cheers,
Alex
Beta Was this translation helpful? Give feedback.
All reactions