Wemos Lolin ESP32 OLED Module For Arduino ESP32 OLED WiFi + Bluetooth

I too am beginning my planning for an altimeter for my PPC. The additional features are quite interesting also. Please be so kind as to send any info on your success with your altimeter, etc project.

This is a bit off topic, but I posted on using MicroPython with that ESP32 and Oled before in this thread.
It is even possible to redirect the MicroPython REPL (Read, Evaluate, Print, Loop) to the OLED.
Yes, a bit small, but for me 16x8 console is really impressive:

This is from matching "screen" session, the posting is from thread on keyboard missing to make this ESP32 with Oled a full blown computer when running from lipo:

...
>>> import sys
>>> sys.implementation
(name='micropython', version=(1, 9, 4))
>>> 5**4**3
542101086242752217003726400434970855712890625
>>>

This is my fork that makes the for Raspberry FBConsole usable for ESP32 again:

A colleague told me that V-USB project is the way to go to connect a USB keyboard, have not tried that.
This would be the (5$) USB wireless keyboard I would connect:

I ordered one of these boards (hasn't arrived yet) but I couldn't find a spec sheet or something that could tell me how to power it from something else than the USB port.

I see it has some pins named 3V3, 5V and Vin. Since it can be run from USB (5V) but seems to use 3.3V internally, I assume it has an onboard voltage regulator. Is it safe to connect a battery to Vin? What's the allowed range of the voltage connected to Vin? Is it possible to connect a 1 or 2 cell LiPo?

marcobinz:
I see it has some pins named 3V3, 5V and Vin. Since it can be run from USB (5V) but seems to use 3.3V internally, I assume it has an onboard voltage regulator. Is it safe to connect a battery to Vin? What's the allowed range of the voltage connected to Vin? Is it possible to connect a 1 or 2 cell LiPo?

I did power with 1S lipo, but the 3.7V or 4.2V fully loaded are too much.
I used 1.8V-5V step converter to 3.3V and powered via 3V3 and GND:
https://de.aliexpress.com/item/32817719981.html

It is more than a year ago that I last used the OLED ESP32, and at that time mostly with MicroPython.

Today I looked up the start of this thread and brought everything up and running again.
Then I added Keypad library and made a small OLED keypad demo.
Since pins 4 and 5 are used for display I2C, I had to use the only left 8 consecutive pins GPIO0..GPIO1 for keypad connector.
Since GPIO1 is used, no "Serial" output can be done, but that is fine since output is done on OLED.

This is the 43 lines sketch used:

#include <Wire.h>
#include "SSD1306Wire.h"

SSD1306Wire display(0x3c, 5, 4);

#include <Keypad.h>

const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {0, 2, 14, 12};
byte colPins[COLS] = {13, 15, 3, 1};

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

String line = "Press keys:";
char key;

void draw(String &s) {
  display.clear();
  display.drawStringMaxWidth(0, 0, 128, s);
  display.display();
}

void setup() {
  display.init();
  display.flipScreenVertically();
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.setFont(ArialMT_Plain_16);
  draw(line);
}

void loop() {
  if (key = keypad.getKey()){
    if (line.length()%11==0) line += ' '; // drawStringMaxWidth() workaround
    draw(line += key);
  }
}

Here you can see it in action:

I am doing this as contract work for my son. He does not like SmartLife app for controlling smart socket or smart light, and wants to use 4x4 keypad instead. His brother 3D-printed keypad cover for him already:

Now I have to reverse engineer the protocol used, and let eg. the ESP32 turn smart plug on/off. I used Ettercap MITM ARP poisoning to capture traffic between Android (192.168.178.56) and plug (192.168.178.109) with Wireshark on a Raspberry Pi. Surprisingly traffic is in clear, the highlighted line is MQTT message from amazonws server 35.158.232.97 to the plug. 0x4002008[56] messages turn plug on/off. A good start sofar, but more analysis needed. Especially later the smart lights allow to set color values. Protocol is TUYA against port 13968 of the plug. Initially only port 6668 is open on the plug: