OLED gibberish on display

Hi

I have a LILIGO ESP32 with OLED, this is a LoRa receiver and prints messured values.

Sometimes, or rather often, I read gibberish.

Is there a simle command that can handle this?

image

Here is display code:

 // Display the information to OLED
  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);

  // NB! This is values before convert to float in "readPacket()"
  // MAX 21 char pr linje
  display.setCursor(0, 1);       // pixel 0 fra venstre, pixel 1 fra topp
  display.print("Annis bier:)  " + hiveName);
  display.setCursor(0 , 7);   display.print("---------------------");
  display.setCursor(0 , 15);  display.print("Vekt Kg: ");
  display.setCursor(85, 15);  display.print(weight);
  display.setCursor(0 , 25);  display.print("Temperatur:");
  display.setCursor(85, 25);  display.print(temperatureKube);
  display.setCursor(0 , 35);  display.print("Luftfukt %RH:");
  display.setCursor(85, 35);  display.print(humidity);
  display.setCursor(0 , 45);  display.print("Pakke nr:");
  display.setCursor(85, 45);  display.print(packetID);
  display.setCursor(0 , 55);  display.print("Signal >-170:");
  display.setCursor(85, 55);  display.print (rssi);                  
  display.display();

You have been watching too much Harry Potter.

You believe the problem is in the code you posted. You cannot find and fix the problem yourself. Therefore there is a 50% or greater chance that the problem is not in the code you think it's in.

Please read the forum guide and follow it.

1 Like

Its unlikely there is a magic wand type command that will fix your code, especially as is often said on here, the problem is probably the code you did not post.

With any project it makes sense to have simple programs that test a particular function or bit of hardware. Its possible you have a hardware issue with the display.

If I had that problem your seeing I load up simple program that keeps writing to and clearing the display only. Leave it run for a while, do you see the same problem ?

1 Like

Hi

I have code I cant share, it is paid/cooperation and asked not to publish, that's why I did not share the code. Sorry for that.

:slight_smile: For my generation MacGyver is the hero!

But you gave me help; check all code that can do something with the display.

Regarding HW, I have tested 3 boards, so I dont think it is HW related.

So if the forum fixes the code, do we get a cut of the fee ?

1 Like

In this case, we will not be able to correct the error.
Sorry for that.

1 Like

This is a valid question, personally I could share the code, but that's not so easy when I have agreed to not publish it. Maybe I can take out part of it, due to 'secret code' is only math, nothing with display function. But then again, not all code available for revision.

Hint:

For this error, I think, most important parts of the code are - receiving data from the Lora and process them for displaying on the screen

Thanks for helping, I will for sure look into it, maybe I get some time this evening.

Mentioning many problems will not result in a working project, but I can try to write down a few problems.

We don't have enough information.
Is that a I2C OLED display ? Does the project recover from that ? What happens if the LoRa is turned off ? and so on.

I assume that the timing of the display together with the library is no problem. Those OLED displays can handle fast timing.

Possible problems:

  1. Voltage dip or voltage too low. This would be my first guess. Measure the voltage, add a large capacitor.
  2. Memory problem. A stack or array problem can create this. If the bug only influences the OLED library, then the OLED might even recover from such a bug.
  3. No pullup resistors on the I2C bus.
  4. Interference from RF signals.

Thanks!

So, there is more to it than the code.... of course there is (-:

LILYGO® TTGO LoRa32 V2.1 1.6.1 ESP32 LoRa Development Board 0.96 Inch OLED TF Card, i run 868 Mhz

1: I use a original Samsung Charger, no extra cap. I can try another charger, or use my bench power supply. I can try to add a cap. Is it possible to add it to pin 3.3 and GND?

2: I did not think about mem problems. In code I don't use the memory (Preferences), but the code of course use mem. Libraries I use is:

> #include <WiFi.h>
> #include <PubSubClient.h>    // MQTT
> #include <SPI.h>
> #include <LoRa.h>
> #include <Adafruit_GFX.h>
> #include <Adafruit_SSD1306.h>

3: The Liligo loraOled chip is all in one. I have not added a pullup

4: This I have had in mind, not sure how to fix it, probably need some CRC code witch I have not implemented so far.

Eh? People sell out their country for less. Good ethics, tho.

Those extra characters are not in your code (you do not use card suits, graphics, or most of the accent characters). That is from a comms issue (I2C).

If you connected three boards incorrectly, you will have the same error. Make a drawing of your classified project. Are you posting from work? They have eyes.

[edit] You are working with radio/radar... your I2C lines need to be very short. Maybe your radio/radar equipment is inducting the its noise onto the I2C lines.

[post edit] Packet radio. HAM station.

Hi

Its not super advanced. I reseive weight, temp, humidity and alarm on LoRa. This I present on Grafana. Display not so important, but my wife like to se the data live.

This is a private project, monitoring bee hives. When finished I will monitor 10 pcs.

Since yesterday I i have not worked on this issue, maybe this weekend.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.