ESP32 and SX1278 (Ai Thinker Ra01 and Ra02) reception

I have been using an ESP32 and SX1278 (Ai Thinker Ra01 and Ra02) module with OpenMQTTGateway using rtl_433_esp and found the reception to be poor. The device must be within 1 to 2 meters before I get good decoding. I have played around with the radio settings in the code with no luck and tried various antennas. What are others’ experiences with the SX1278 and potential solutions? PS. My radio knowledge is not the best so most of the time it is just fiddling with numbers :wink:

Next to the device, it’s perfect and 3 meters away or a wall then I receive nothing.

I have made a discovery that when I change the BitRate to e.g. 4.800 I suddenly start to get more successful decodes over further distances, the line now reads as follows on my local copy of RTL_433_ESP and a massive improvement. Seeing that the demodulation of OOK is happening in hardware it prob. gets better accuracy with more realistic OOK bitrates.

state = radio.setBitRate(4.800);

Not sure if 4.800 is the sweet spot but we could consider making it a variable.

PS. This was not just some random poking, I actually read the documentation from SEMTECH on the SX chip.

Now where I read correctly or whether it is still just a fluke, well, experts around here can comment :wink:


1 Like

@diepeterpan Let me try this on one of my boards and do a direct comparison. I should get some time over the next day or so.

So I updated one of my LilyGo boards( LilyGo TestB) with the same setting, and these are the results after about an hour. These 3 boards are sitting side by side on my desk, and for each the antenna is pointing upwards.

For sensors in my setup I have a total of 9

2 x LaCrosse Bv3
3 x Acurite-Tower
2 x Acurite 986 ( These are in my fridge and are I find are very hard to receive )
1 x LaCrosse TX141W
1 x SkyLink Motion

LilyGo with a BitRate set to 4800
6 sensors detected, pretty solid reception
And 1 bad reception ( Acurite Atlas )

LilyGo without bitrate set
7 Sensors detected
both my fridge sensors
But not LaCrosse Bv3 - 187
Pretty solid reception except for LaCrosse Bv3 - 187

7 Sensors detected
But results are a inconsistent

PS I looked into the bitrate configured on the CC1101, and it is 5000

I have done some more testing and testing and testing and with the following changes I receive better results. I do own the Oregon-CM160, Oregon-PCR800, and LaCrosse-WS2310. I do have a number of other devices too which my SDR dongle receives over a longer distance but not the ESP32 SX1278.


Same setup, after running overnight

Besides some false receptions, results did not change. Going to reset counters and run it again. during daylight hours ( have noticed that reception changes based on day/night and other weather conditions )

After a couple of hours this morning

TestB has the bitrate set, and the other does not. Also my CC1101 stopped ( its on a breadboard, and gets flakey once in a while. )

Based on my results, I would say that it is inconclusive, but YMMV. This is one of the frustrations with these boards as a general OOK receiver, the results are not always repeatable, and there are more external factors than we are taking into account.

1 Like

Understood, luckily I am able to compile my own customizations.

@diepeterpan - I was looking into why a new 433Mhz Temperature sensor I had acquired ( A Philips Sensor ) was not being picked up. And I found that the rtl_433 device decoder was a bit strict about the signal length. I was dropping the first and last bit of every signal, and this decoder did not like that.

After fixing the issue, have been running it all morning, and the data looks like this

The device with the new code base is OMG South, and OMG LilyGo is the current release, and TestB is the changes suggested by DiePeterPan.

This code base is here - GitHub - NorthernMan54/rtl_433_ESP at SignalStartEndTuning

Thank you, I have re-based my customizations to this and am running it now. No fancy stats and graphs but I am monitoring for missing data. So far this does appear to be better with my customizations for my environment.

My fancy graphs are node-red with the ui-dashboard installed. Then a fancy flow to collect the data

@DigiH @diepeterpan - what’s your votes on the fixes for received signal length ? For me a vote to promote would be that it does not degrade the existing reception, but improve reception for specific decoders ( ie Philips ).

1 Like

:+1: from me, as it also improved reception for my LaCrosse-TX141THBv2.

1 Like

I am running a few changes on 2 different SX1278 devices and am all for improvements.

These are my preferred settings on top of the signal improvement.



All are currently on GitHub - diepeterpan/rtl_433_ESP: Trial port of the rtl_433 Library for use with OpenMQTTGateway on a ESP32 and a CC1101 Transceiver

Whish there were more people that could run some of these changes, my CM160 electricity watt meters send at least every 60 seconds a reading which makes testing a lot easier.

1 Like

PS. I then graph the data :wink: Seeing when my fridge turns on and off, the hot water cylinder, etc. Oh and those gaps of 2 hours on the graph, that is blackouts or as we call it load-shedding, as the South African electricity provide don’t have enough power and have these rolling blackouts to protect the grid.

Also, an interesting find tried to get the code working on an ESP32 but did not succeed.

This example also used 1.2kbs, so I am sticking to it for now.

Did you mean “for use with SX1276/SX1278”, @diepeterpan? As the above shown changes shouldn’t affect any CC1101 gateway.

Running your branch on CC1101 and SX1278 gateways now …

@diepeterpan Let me load your changes onto my test device, and do an extended comparison again. Current release versus signal length fixes versus sx128x tuning + signal length fixes ( ie your branch )

And will let it run for a day or so to collect results

1 Like

That description comes from the parent which I branched/merged, I only have access to the SX1278 and does all my testing on it.

1 Like