Using a Heltec LoRa 32 433 Mhz with rtf_433_ESP

Well I finally spent some time this month working on getting the RadioLib library to work in OOK/ASK mode with a SX127x transceiver so that I could try it out instead of using a CC1101 as a receiver. And I have something that appears to work. I still need to do some more code cleanup etc, but I have something wired into OMG and receiving / decoding signals from my devices. Now for some testing to see if the receiver is more sensitive than a CC1101.

************* WELCOME TO OpenMQTTGateway **************
N: OpenMQTTGateway Version: esp32_heltec-v0.9.11-51-gc4f431b[development]
N: OTA Hostname: OMG_84CCA84A9154.local
T: Connecting to 67 Bonacres
T: Connecting to The_Beach
N: WiFi ok with manual config credentials
T: OpenMQTTGateway mac: 84:CC:A8:4A:91:54
T: OpenMQTTGateway ip: 192.168.1.119
T: Connecting to MQTT by mDNS without mqtt hostname
T: Browsing for MQTT service
T: 1 service(s) found
T: Service 0 Jesse found
T: IP 192.168.1.11 Port 1883
T: One MQTT server found setting parameters
rtl_433_ESP(6): Pre initReceiver: 199168
rtl_433_ESP(6): SX1278 gpio receive pin: 34
rtl_433_ESP(6): SX1278 receive frequency: 433.920013
rtl_433_ESP(6): sizeof(*cfg->demod) 16
rtl_433_ESP(6): sizeof(*cfg->demod) 16
rtl_433_ESP(6): size of bitbuffer: 6604
rtl_433_ESP(6): size of pulse_data: 9620
rtl_433_ESP(6): # of device(s) configured 101
rtl_433_ESP(6): ssizeof(r_device): 108
rtl_433_ESP(6): cfg->devices size: 10908
rtl_433_ESP(6): # of device(s) enabled 100
rtl_433_ESP(7): Enabling procRtl_433_Task
rtl_433_ESP(6): SX1278 SPI Config SCK: 5, MISO: 19, MOSI: 27, CS: 18
rtl_433_ESP(7): procRtl_433_Task awaiting signal
M       SX127x
rtl_433_ESP(6): SX1278 radio.begin() success!
rtl_433_ESP(6): SX1278 setOOK - success!
rtl_433_ESP(6): SX1278 setDataShapingOOK - success!
rtl_433_ESP(6): SX1278 setOokThresholdType - success!
rtl_433_ESP(6): SX1278 setOokPeakThresholdDecrement - success!
rtl_433_ESP(6): SX1278 setOokFixedOrFloorThreshold - success!
rtl_433_ESP(6): SX1278 setRSSIConfig - success!
rtl_433_ESP(6): SX1278 PREAMBLE_DETECT - success!
rtl_433_ESP(6): Post initReceiver: 106000
rtl_433_ESP(6): SX1278 setBitRate - success!
rtl_433_ESP(6): SX1278 setRxBandwidth - success!
rtl_433_ESP(6): SX1278 setCrcFiltering - success!
rtl_433_ESP(6): SX1278 setDirectSyncWord - success!
rtl_433_ESP(6): SX1278 disableBitSync - success!
rtl_433_ESP(6): SX1278 receiveDirect - success!
----- SX127x Status -----
RegOpMode: 0x2c
RegPacketConfig1: 0x00
RegPacketConfig2: 0x00
RegBitrateMsb: 0x03
RegBitrateLsb: 0xd0
RegRxBw: 0x01
RegAfcBw: 0x02
-------------------------
RegOokPeak: 0x08
RegOokFix: 0x0c
RegOokAvg: 0x72
-------------------------
RegDioMapping1: 0x00
----- SX127x Status -----
T: ZgatewayRTL_433 command topic: home/84CCA84A9154/commands/MQTTtoRTL_433
N: ZgatewayRTL_433 setup done 
T: enableActiveReceiver: 3
N: Switching to RTL_433 Receiver: 433.92Mhz
T: mqtt_max_packet_size: 2560
N: OpenMQTTGateway modules: ["rtl_433"]
N: ************** Setup OpenMQTTGateway end **************
W: MQTT connection...
N: Connected to broker
T: [ OMG->MQTT ] topic: home/84CCA84A9154/LWT msg: online 
T: [ OMG->MQTT ] topic: home/84CCA84A9154/version msg: esp32_heltec-v0.9.11-51-gc4f431b[development] 
T: Subscription OK to the subjects home/84CCA84A9154/commands/#
T: retrieving value of system characteristics Uptime (s):9
N: Send on /SYStoMQTT msg {"uptime":9,"version":"esp32_heltec-v0.9.11-51-gc4f431b[development]","freemem":98352,"mqttport":"1883","mqttsecure":false,"freestack":30528,"rssi":-55,"SSID":"The_Beach","BSSID":"20:C9:D0:1A:CA:85","ip":"192.168.1.119","mac":"84:CC:A8:4A:91:54","actRec":3,"RTLminRssi":-82,"RTLRssi":0,"RTLCnt":0,"modules":["rtl_433"]}
T: jsonPubl - ON
T: [ OMG->MQTT ] topic: home/84CCA84A9154/SYStoMQTT msg: {"uptime":9,"version":"esp32_heltec-v0.9.11-51-gc4f431b[development]","freemem":98352,"mqttport":"1883","mqttsecure":false,"freestack":30528,"rssi":-55,"SSID":"The_Beach","BSSID":"20:C9:D0:1A:CA:85","ip":"192.168.1.119","mac":"84:CC:A8:4A:91:54","actRec":3,"RTLminRssi":-82,"RTLRssi":0,"RTLCnt":0,"modules":["rtl_433"]} 

 rtl_433_ESP(7): procRtl_433_Task awaiting signal
rtl_433_ESP(6): Signal length: 266088, Gap length: 5003358, Signal RSSI: -67, train: 1, messageCount: 1, pulses: 273
rtl_433_ESP(7): processSignal() about to place signal on rtl_433_Queue
rtl_433_ESP(7): processSignal() signal placed on rtl_433_Queue
rtl_433_ESP(7): procRtl_433_Task signal received
rtl_433_ESP(6): Pre run_ook_demods: 91896
rtl_433_ESP(6): data_output {"model":"Acurite-Tower","id":9899,"channel":"C","battery_ok":1,"temperature_C":18.1,"humidity":64,"mic":"CHECKSUM","protocol":"Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning, 3N1, Atlas","rssi":-67,"duration":266241}
N: Send on /RTL_433toMQTT msg {"model":"Acurite-Tower","id":9899,"channel":"C","battery_ok":1,"temperature_C":18.1,"humidity":64,"mic":"CHECKSUM","protocol":"Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning, 3N1, Atlas","rssi":-67,"duration":266241}
T: jsonPubl - ON
T: [ OMG->MQTT ] topic: home/84CCA84A9154/RTL_433toMQTT msg: {"model":"Acurite-Tower","id":9899,"channel":"C","battery_ok":1,"temperature_C":18.1,"humidity":64,"mic":"CHECKSUM","protocol":"Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning, 3N1, Atlas","rssi":-67,"duration":266241} 
T: Post rtl_433_Callback: 87860
rtl_433_ESP(6): data_output {"model":"Acurite-Tower","id":9899,"channel":"C","battery_ok":1,"temperature_C":18.1,"humidity":64,"mic":"CHECKSUM","protocol":"Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning, 3N1, Atlas","rssi":-67,"duration":266241}
N: Send on /RTL_433toMQTT msg {"model":"Acurite-Tower","id":9899,"channel":"C","battery_ok":1,"temperature_C":18.1,"humidity":64,"mic":"CHECKSUM","protocol":"Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning, 3N1, Atlas","rssi":-67,"duration":266241}
T: jsonPubl - ON
T: [ OMG->MQTT ] topic: home/84CCA84A9154/RTL_433toMQTT msg: {"model":"Acurite-Tower","id":9899,"channel":"C","battery_ok":1,"temperature_C":18.1,"humidity":64,"mic":"CHECKSUM","protocol":"Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning, 3N1, Atlas","rssi":-67,"duration":266241} 
T: Post rtl_433_Callback: 86272
rtl_433_ESP(6): Signal processing time: 90346
rtl_433_ESP(6): Post run_ook_demods memory 81816
rtl_433_ESP(6): # of messages decoded 2
2 Likes

Great news. This would simplify a lot 433mhz board setups!

And enabling the display for OMG, would be another great addition.

2 Likes

Reception comparison between RX127x ( Heltec ), CC1101 ( OMG North and South ), and a RTL_SDR running rtl_433.

Please note that each receiver is in a different location.

When looking at the data I was using my LaCrosse TX141-BV3 as a comparison. It was physically closest to the Heltec board and the rtl_433, so the number of received signals should be the same/similar for both. Looks like I need to do more investigation and tuning with the package.

I should also do a distance test as well.

1 Like

I moved the LaCrosse TX141-BV3 to the back of my property, and now only the CC1101 is picking up a signal LOL. Looking at the RSSI Data, you can see that the LaCrosse TX141-BV3 has the weakest signal.

Interesting that the cc1101 picks signal and not the SDR.

Thatā€™s partially due to the physical location of each receiver, the RTL_433 is in the basement attached to a RPI, while the OMG North and South are at the North and South ends of the property.

When I did this, I should have been watching the uptime for the Heltec device, as it was panicing every 5 to 10 minutes. With a different non-sensical backtrace each time, the only thing I found that was consistent was when the HEAP dropped below 80K it would panic shortly afterwards.

So I spent some effort on memory management, and am fingers crossed stable. Just running long term stability tests now.

With the signals I did receive I had thought that with the Heltec I would receive significantly better results, but so far no. After I complete the stability tests, going to look at the AGC and other options on the Heltec.

My next update - have resolved the random panic issue and at the same time identified what was consuming majority of the RAM in my module. Identified that the blueline device decoder is mallocā€™ing 64k of ram on initialization, so I removed it as a included module, and memory usage is now significantly lower ( it may be possible to run rtl_433 and bluetooth at the same time now ;-). I also spent time with the SX127x data sheet and twiddling the various knobs, and have improved the signal reception consistency, and it now receives the same or more signals than my other devices.

Range is not significantly different than a CC1101 though, but I have more knob turning to do.

In the image you can see that my LaCrosse TX141BV3 is not being received by the Heltec device.

For my next round of tests, I will try and place the receivers in the same location, so the results are more comparable.

1 Like

Latest update

The three devices are all placed within 1 foot of each other, so the data is directly comparable. What is surprising is that the CC1101 pickups up my Acutrite 986, and the others donā€™t. The CC1101 was also using the RadioLib library to manage the receiver.

Also the CC1101 picks up a lot of noise devices ā€œunknownā€ and interlogix, where as the others donā€™t

I was very surprised that the Heltec SX127X was better at receiving signals than the rtl_sdr.

Significant code changes made with this test package include the usage of RTOS tasks for signal decoding and detecting start/end of signal ( borrowed the pattern from the recent BT changes ), and the addition of an automatic adjustment of the RSSI signal present threshold. I changed it to be a delta applied to the average RSSI level aka noise level. Previously this was hard coded at -82 db, and it is currently 9db over the noise level. Also the SX127x receiver code adjusts its OOK Floor threshold value automatically.

Those values over time

image

2 Likes

Thatā€™s very interesting, seems that maybe we are getting the ultimate RF receiver :slight_smile:

Small Progress Update

For the last few weeks I have been doing some more fine tuning of the code base, and am getting close to the initial release of a package for more wide spread testing. The initial testing release, will be a pull request for OMG that rtl_433_ESP uses RadioLib instead of SmartRC-CC1101-Driver-Lib. Shortly afterwards ( once fall hits here in Canada ), will do a second pull request with RC-SWITCH and PiLight also using RadioLib.

This is from my regression testing, with 3 ESP32 boards on the bench, first a Heltec board, second a CC1101 with the original version of rtl_433_ESP, and third a CC1101 with the RadioLib version of rtl_433_ESP.

3 Likes

The draft pull request is here - Update of rtl_433_ESP to version 0.1.2 - Draft Pull Request by NorthernMan54 Ā· Pull Request #1275 Ā· 1technophile/OpenMQTTGateway Ā· GitHub

Iā€™m still working thru the multi-receiver module feature, and should have that ready in a few weeks.

1 Like

Should we release a version of omg without the multi receiver? The current proposed combination is already very interesting by itself.

I think we should wait.

I have a rough version of multi-receiver working, I just need to finish the changes and publish. This version also required changing rtl_433_ESP as I need to allow the initialization steps be re-runnable and not malloc on additional inits.

Iā€™m also working on getting the display to work, and am working thru getting the Log output onto the display.
IMG_8730.heic copy
IMG_8729.heic copy

1 Like

Thatā€™s cool!

Letā€™s wait

Here is an draft pull request with the display working. Still needs more work, but you can pull it into your setup for a look see

1 Like

This should be good to be merged

I have completed my clean up and simplified the package.

1 Like