bitbank2 / ss_oled

Simple and small library to control 1-bpp OLED displays (Linux + Arduino)
GNU General Public License v3.0
190 stars 34 forks source link

Reset must be done earlier for some displays #28

Closed cyberman54 closed 4 years ago

cyberman54 commented 4 years ago

Reset must be done earlier for some displays (e.g. a SSD1306 found on Heltec Wifi Lora32 boards). I made this change earlier und you merged it already. Seems it has gone lost with latest update. Please merge again and increase version/release number. Thank you!

bitbank2 commented 4 years ago

Your code change doesn't make sense. You moved the reset to be after assigning a couple of variables which takes on the order of sub-microseconds. Why would moving that code make any difference?

bitbank2 commented 4 years ago

There's also a Vext control on those Heltec LoRa boards which must be enabled to give power to the OLED (before you try to communicate with it).

mikethebee commented 4 years ago

I moved the reset function and can confirm that the unmodified paxcounter code now runs without core dumping loop. HTH, Mike

cyberman54 commented 4 years ago

@bitbank2 It's NOT the Vext control on Heltec boards, i am aware of this and my application deals with that. I am not sure what exactly is the root cause here. It seems that I2C communication with the SSD1306 controller fails if it is not properly resetted. So it is critical that reset happens BEFORE I2CInit() is called.

bitbank2 commented 4 years ago

I saw the issue in the code. The Github DiFF didn't show it clearly. It's not about reseting before I2CInit(), it's about pinging the OLED address. It won't respond with an ACK before being reset.

cyberman54 commented 4 years ago

could you please increas3 version number? thx

bitbank2 commented 4 years ago

done

bitbank2 commented 4 years ago

P.S. I've switched my dev efforts to focus on my new library (OneBitDisplay). This will take over from ss_oled.

mikethebee commented 4 years ago

Thanks for the update. IMO you've certainly done some great work in creating and supporting this library. - Mike

bitbank2 commented 4 years ago

@mikethebee Thanks for letting me know. It's really hard to tell how many people are interested in my work.

mikethebee commented 4 years ago

I am still learning myself about the etiquette of git and opensource. I am a hacking programmer currently looking at using the Heltec ESP32 with LoRa and oled display for some community projects. The paxcounter code has been the base and compiles with around 50+ libraries to do it's magic. Without those libraries I would not be able to make progress on the real goals (collecting data and interfacing virtual and real worlds). I hadn't really thought enough about those (including yours) libraries and the hard work that goes into them, until a problem occurs that was passed down stream. Working across different cultures and nerd types can make for a tough environment for an opensource developer putting their head above the parapet. I will think how I can help raise awareness of the value of such work, and hope to be in a position to make a donation in the near future. Thanks again. Mike