Combining libraries for sx1276 radio module with ESP32

userHead John.Doe5272 2026-08-01 06:17:39 141 Views1 Replies

I am working on a project that requires two distinct functionalities from a single SX1276 LoRa module, that is receiving sensor data from a WH65 weather station unit via the 868mHz frequency, and transmitting the sensor data to a remote server within line of sight via the 915mHz frequency. The receiving and transmitting functions can each be supported by 2 separate libraries, that is the rtl_433_ESP & the RadioLib libraries, respectively.

 

Is it possible to combine the two pre-existing libraries to accomodate both functions?  Or would it be better to use another radio module specifically for receiving from the weather station?

2026-08-03 10:30:38

wo radios is the cleaner route. The SX1276 is half-duplex — it can't listen and transmit at the same time — and both libraries talk directly to the SPI registers, so they'll step on each other's configuration.
rtl_433_ESP puts the chip in OOK or FSK mode for weather station decoding, while RadioLib typically uses LoRa for the transmit side. Switching between those modulation modes requires flipping the LongRangeMode bit in sleep state and reconfiguring a bunch of registers. Doing that back and forth in one sketch is messy — each library expects the chip to stay in the state it set up.
OpenMQTTGateway does bundle both libraries, but that's for receive-only setups (rtl_433_ESP for sensor decoding, RadioLib as the low-level driver). They're not trying to transmit LoRa on the same module right after receiving OOK.
If you want to stick with one module, you'd need to fully de-init one library, switch frequency and modulation, then init the other — and accept that you can't receive weather data while you're transmitting. Two modules (one tuned to 868 MHz for rtl_433_ESP, one to 915 MHz for RadioLib) lets both sides run independently without the state juggling.

userHeadPic Jason.Miao