Nice display for ESP/Arduino stuff

For stand-alone microprocessors

Nice display for ESP/Arduino stuff

Postby Doug Coulter » Sun Jul 16, 2017 11:43 am

I recently ordered a few of these in some different color flavors.
https://www.amazon.com/gp/product/B00O2 ... UTF8&psc=1
They're pretty nice once you get them working. (So I'm keeping some notes here so I don't have to figure it all out again next project). They do use a lot of ram (1kbyte) so are marginal on Uno, but for ESP - this doesn't matter, and that's what I want them for.

I've had lousy luck with touchscreen displays on raspberry pies. It's not that they are bad - they work fine. But I don't have miniature fingers and I do have old-guy eyesight. A linux desktop, even pretty simplified, isn't going to fly on a dinky one, period. Yes, you could write a kiosk-type one app thing with big UI elements,,,,but at some point you always need a little more, like download the new version, restart it, whatever, and with that 3" stuff you just run out of finger space very fast.

On the other hand, a display-only thing that shows internal status of one of my lan of things devices and some info (signal strength, net name and IP address, whatever the sensors are showing) seems pretty handy even if I have to put on reading glasses and squint a little - I won't be using it that much, preferring a web page or similar on some computer by the couch, but for setting up and debugging and just being in the wrong room to access the master sometimes - this should rock.

Here it is running part of the Adafruit demo stuff on a NodeMcu ESP 8266-12e board (my current favorite for low effort development vs price).
100_3196.JPG
Sample

And the CPU: https://www.amazon.com/Makerfocus-ESP82 ... ds=nodemcu

OK, to do this, you have to get the Adafruit libraries, which are:
https://github.com/adafruit/Adafruit_SSD1306 for the device specific driver (which needs a couple of edits to work)
and
https://github.com/adafruit/Adafruit-GFX-Library which is their general graphics stuff which for example, makes it possible to do text on a pure pixel display.

The SSD1306 header file needs to be edited to make the 128x64 device the defined one - you have to comment out the smaller one and remove the // from this size.
The example file needs the I2C address changed to 0x3C (it's 3D by default).
If you're going to use this on an ESP 8266 (barely works on an uno anyway - it works but there's not much memory left to do your thing) - you need to change the OLED reset (which isn't actually needed at all with this part) #define from pin 4 to pin 16. If you don't do that, it's not gonna work as the pin4 seems to generate a stream of resets to the CPU itself on the ESP boards....You can chase your tail awhile on that one, the other changes are on Amazon and elsewhere.

I suppose you could edit the library to just not need that reset action at all. But then it wouldn't work with a bunch of other things Ada sells, for example.

My thinking here is that for some of my LoT stuff - it'd be nice to know if it thinks it's closed some relay, what temperature it thinks it's reading and so on, and even what the heck the net name or IP are on DHCP, the wifi signal strength and so on - without needing to see it remotely (which can be hard if you don't know some of that stuff already - this is a slick way to find it out, but of course, being me, not the only way).

So this is just a "how to get this display going at all" for the moment. That way, when I put it into real projects - and I will - I can point back here for the basic "how to get it working" stuff.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 2934
Joined: Wed Jul 14, 2010 8:05 pm
Location: Floyd county, VA, USA

Re: Nice display for ESP/Arduino stuff

Postby Doug Coulter » Sun Jul 16, 2017 3:20 pm

Might find this helpful...NodeMCU 12e pinouts, including the default SCL and SDA for I2C added by me. When that pin 4 (circular reset?) bug was showing, a lot of pins were toggling, so it was hard to be sure which were supposed to be the I2C pins...I used "the gimp" to add that to an image I found on the web.

In theory you can change these. However, due to the design of the driver libraries, it has to be done inside them - as they call Wire.begin themselves - with no parameters...sigh.
Some of this stuff is OK for simple breakouts, but it's obvious as time goes on that this doesn't represent the pinnacle of reusable software design. The neckbeards do it better especially if they don't have the time pressure. This all would have been a lot simpler had someone thought to use #defines or just constructor parameters in the user sketch or some similar mechanism. Editing libraries is not a good thing to do, especially when they depend on one another. How are you going to keep track of that in a complex dev environment that might use more than one display hardware type?

NodeMCU12e_pins.png
Don't use the numbers on the board silkscreen!


Notice that just to be extra confusing, where the arduino uno uses A4 and A5, this uses GPIO4 and 5 (digital). The board silkscreen maybe is the pins for the tensilica? The nice external labels here are what works with your arduino IDE stuff.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 2934
Joined: Wed Jul 14, 2010 8:05 pm
Location: Floyd county, VA, USA


Return to Embedded software

Who is online

Users browsing this forum: No registered users and 1 guest