sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.61k stars 621 forks source link

Using two SPI for two lora modules (rfm95s) #562

Open note5 opened 2 years ago

note5 commented 2 years ago

I would like to use two rfm95 chips as receivers with different spreadings factors and frequecies, How can I instantiate the library so that I can have two instances for two spi connections ?

Kongduino commented 2 years ago

Use the default Lora class for one module, and instantiate another class instance, say LoRaClass LoRa1; for the other.

note5 commented 2 years ago

Thank you, Can we also have the spreading factor be open so that we can listen for any spreading factor on a particular frequency ?

Kongduino commented 2 years ago

No, everything (frequency, SF, BW, CR) has to be set to a certain setting. What you can do is hop between settings – usually it's done for frequencies, rather than other settings – and ask the LoRa chip whether there's anything incoming. The problem is, if you have transmissions on the same freq at different SF settings, the answer will always be yes, but the results will be unpredictable. If you want to have several channels on the same chip, try with frequencies, rather than anything else.