While working with the 433MHz RF transmitter/receiver pair, I found an issue when trying to integrate a SH1106 OLED display module into the system. This problem was also reported on the r/Arduino subreddit.

This problem is solved by changing the display from Adafruit to u8g2. I don’t know why the one library works and the other doesn’t – some postulate that it’s due to memory constraints. And if you’re reading this after already trying the u8g2 library then the best advice I can offer is: check your constructor!
Obviously you’ll need to install the new library – a link to the github is here. Not sure what you need to do with said github – I would just be googling the process myself, so that’s what I suggest you do. Notwithstanding, the code below is designed to work with the same transmitter code as featured on this page.
//RX 433MHZ
//Hello World
#include <RH_ASK.h>
#include <SPI.h> // Not actualy used but needed to compile
#include <Wire.h>
#include <U8g2lib.h>
U8G2_SH1106_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
RH_ASK driver;
void setup() {
Serial.begin(115200);
Serial.println("Loading...");
if (!driver.init()) {
Serial.println("init failed");
}
u8g2.begin();
u8g2.setFont(u8g2_font_6x13_tf);
delay(1000);
}
void loop() {
uint8_t buf[11];
uint8_t buflen = sizeof(buf);
if (driver.recv(buf, &buflen)) {
Serial.print("Message: ");
Serial.println((char*)buf);
u8g2.firstPage();
do {
u8g2.drawStr(0, 10, (char*)buf);
} while (u8g2.nextPage());
}
}
The RX Code
The constructor for the display is critical and VERY specific. So, this is for the I2C OLED display with SH1106 driver, NOT the SSD1309, nor SPI version.
This link will take you to the list of constructors available for various displays.
The other thing to note is that the Arduino Nano doesn’t have enough memory for a full frame buffer, only a single page buffer. This backs up the previous theory of Adafruit memory constraints causing issues.
I’ve not tried double page buffering, because single page buffering works well enough for this proof of concept. And I’m lazy.
The basic concept of the code is that it checks if there is data in the RF433 RX buffer, and subsequently prints it to the serial monitor and display.
If there is no data in the buffer, then it checks again until there is.
For some strange reason there appears to be some ‘random’ characters after the message. I don’t know what they are, how they got there, nor how to remove them. I’m not even sure on how to process integers, either.
In all honesty, I’ve grown weary of these modules after failing to send simple integers, and the realisation that a 7inch aerial is not practical for ‘small’ applications.