jgillula / rpi-rfm69

Python RFM69 library for Raspberry Pi
GNU General Public License v3.0
31 stars 20 forks source link

Set a specific frequency #14

Closed fconrotte closed 2 years ago

fconrotte commented 2 years ago

Hello

For the CanSat project ( https://cansat.esa.int/ ) students use the RFM69 antenna to communicate from their mini-satellite to their ground station.

Many CanSats are launched at the same time so we need to ensure that frequency do not overlap.

We give each team a specific frequency, separated by 0.1Mhz around 433Mhz (433.1MHz, 433.2MHz, 433.3MHz etc)

It seems to me that it is feasible to specify the exact frequency by change the 433 registers in this file: https://github.com/jgillula/rpi-rfm69/blob/main/RFM69/registers.py#L301

Do you see any blocking point to make this work ? If not I will test and propose a pull request.

Thanks

Fred

fconrotte commented 2 years ago

I realized that the set_frequency method exists

https://github.com/jgillula/rpi-rfm69/blob/main/RFM69/radio.py#L154

But I would like to add a new one called "set_frequency_in_Hz"

It would convert the frequency from text to hexadecimal by applying the formula

tohex(round( frequency_in_Hz / 61.03515625))

Reference: https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/rfm69-h-default-frequency-values-not-the-real-ones/

jgillula commented 2 years ago

Sure, I'm open to that pull request!

jgillula commented 2 years ago

Closed with #17