Static avr-libc library providing basic support for RFM95 radio modules
  • C 70.1%
  • Makefile 25.3%
  • Shell 4.6%
Find a file
2026-04-07 21:26:41 +02:00
nbproject Rename to librfm95 (#4) 2025-04-10 20:12:03 +02:00
sheets Add SX1276 datasheet and AN1200.24 2025-05-05 23:06:45 +02:00
.gitignore Fix build and Makefile 2025-03-24 18:53:07 +01:00
CODE_OF_CONDUCT.md Initial commit 2025-03-24 00:58:44 +01:00
librfm95.c Return actual size of payload received by receiver 2025-11-17 19:45:25 +01:00
librfm95.h Some recommendations from Semtech AN1200.24 (#7) 2025-05-05 22:05:27 +02:00
LICENSE Initial commit 2025-03-24 00:58:44 +01:00
Makefile Switch to MCU = avrxmega2 2025-12-09 19:05:27 +01:00
README.md Move to Forgejo 2026-04-07 21:26:41 +02:00
utils.h Initial commit 2025-03-24 00:58:44 +01:00

librfm95

About

Static avr-libc library providing basic support for RFM95 (SX1276) radio modules. Other RFM9x radios might work as well, but were not tested.

This is work in progress. Currently available is (FSK and LoRa):

  • Transmit a packet
  • Blocking receive a single packet with timeout
  • Async'ly receive a packet (MCU sleeps or does something else until reception)

Usage

  1. Include librfm.h and librfm.a in the project
  2. Implement the _rfm* functions in librfm.h in the application (this is to make the library device and CPU frequency independent)
  3. Route interrupts occurring on DIO0 and DIO4(FSK)/DIO1(LoRa) to rfmIrq()

Range

FSK

At over 12 km distance line of sight, reception and response were stable with an RSSI of -96 dBm and +9 dBm Tx power - with simple wire antennas. Quite impressive!

The configuration:

  • AGC auto on, boost on, 150% LNA current
  • Modulation shaping Gaussian filter BT = 0.5
  • Transmitter frequency deviation: 10 kHz
  • Receiver channel filter bandwith: 20.8 kHz

FieldTest5

LoRa

With LoRa, reception and response were stable with an RSSI of -116 dBm and +17 dBm Tx power at 18 km distance line of sight, with the following configuration (and as well just simple wire antennas):

  • LNA highest gain, boost on, 150% LNA current
  • Signal bandwidth: 41.7 kHz
  • Spreading factor: 10
  • Error correction code rate: 4/5
  • Low Data Rate Optimization

FieldTest8

So, as expected, and without taking the RSSI too literally, range is increased with LoRa, and the link is much more robust when there are obstacles in the path, such as buildings and terrain.

The latter seems to be the more advantageous improvement with LoRa, since the range with line of sight is already long with FSK.

Anyway, these radio modules work very well with both modulation schemes!

Here's the transmitter placed at Mont-Saint-Aubert, with a nice view to Mont de L'Enclus:

IMG_20250503_185357.jpg