Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FHSS support #441

Merged
merged 4 commits into from
Jan 23, 2022
Merged

Add FHSS support #441

merged 4 commits into from
Jan 23, 2022

Conversation

nseidle
Copy link
Contributor

@nseidle nseidle commented Jan 13, 2022

The PR adds frequency hopping spread spectrum (FHSS) support.

  • Add a few helper functions to set freqHoppingPeriod, etc
  • Add two examples
  • Add keywords

My mild concern with this PR is the changing of setFrequencyRaw(). Originally the radio is put in standby before changing the frequency. FHSS requires the packet begin transmission then the freq is changed. This PR changes things a bit: if FHSS is enabled, the setFrequencyRaw skips putting the radio into standby mode.

I haven't added the helper functions to SX1277/1278/1279. I'll add those to the PR if you like what I've provided so far.

I exposed a clearFHSSInt() function so that users could do the channel hop from an ISR. An alternative approach would be to feed the library with a channel array and the library handles the hops. I don't like this as much but it would allow you to keep the clearing of interrupts internal.

I could add an additional helper called setFHSSPeriod() that accepts a user time in ms and does the hop frequency calculation based on Tsym but I thought I'd keep it simple. Let me know if that's wanted.

@avinabmalla
Copy link

Verified to work using an RTL-SDR.

SDRSharp_FHSS.mp4

src/modules/SX127x/SX127x.cpp Outdated Show resolved Hide resolved
@jgromes
Copy link
Owner

jgromes commented Jan 14, 2022

@nseidle thanks for this! I'm not very concerned about changing behavior of setFrequencyRaw(), as long as it's only done in FHSS mode.

I left some comments, mostly regarding the coding style and clarity.

I assume this was tested with hardware?

I haven't added the helper functions to SX1277/1278/1279.

Please add them if necessary, all of the SX127x support FHSS. This should also be added to SX1272/73, to keep all the SX127x modules consistent.

@nseidle
Copy link
Contributor Author

nseidle commented Jan 17, 2022

I didn't realize FHSS was included in the SX1272/73. I've moved the functions into SX127x.

I think I've got all the style changes in place. Let me know if there's something I missed.

Everything is tested using the SparkFun BlackBoard C + LoRa SX1276 1W breakout, and a SparkFun ESP32 Thing Pluc C + SX1276 HopeRF 100mW shield. So different micros and different SX1276 module companies, but I have not tested on anything but the SX1276.

@jgromes jgromes merged commit bd0158c into jgromes:master Jan 23, 2022
@jgromes
Copy link
Owner

jgromes commented Jan 23, 2022

I exposed a clearFHSSInt() function so that users could do the channel hop from an ISR

This is the preferred method, same as Rx/Tx with interrupt.

I could add an additional helper called setFHSSPeriod() that accepts a user time in ms and does the hop frequency calculation

I don't think that's needed at the moment, we can add it later.

Thanks for the changes, everything looks OK to be merged now.
Also thank you very much for the contribution, it's really appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants