ArmDeveloperEcosystem / lorawan-library-for-pico

Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡
BSD 3-Clause "New" or "Revised" License
125 stars 47 forks source link

[WIP] Add Waveshare Pico-LoRa-SX1262-868M support #15

Open ThomasLeister opened 2 years ago

ThomasLeister commented 2 years ago

This PR is for adding Pico-LoRa-SX1262-868M support.

Waveshare module:

The module manufacturer has modified the lorawan-library-for-pico to be compatible to the Waveshare module but has not merged back their changes. The original source is available here: ZIP | GitHub . Unfortunately everything is crowded into one commit and SX1276 support seems to be broken in favor of SX1262 support.

I've taken the manufacturer's sources (also BSD-3 clause licensed) and ported the important parts on top of a recent version of the upstream library. Also some updates on README.md have been done and updated example applications include a proper pin configuration struct for the Waveshare module. A compile time switch in CMakeLists.txt lets the user decide between SX1276 and SX1262 support.

SX1267 should not be broken, but working support for the chip is still unconfirmed, because I'm just owning a Waveshare module ;-)

To be done prior to merging this PR:

I'd be happy to get your opinion, @sandeepmistry . Let me know your opinion and suggestions and make this branch / PR ready for merge :-)

ThomasLeister commented 2 years ago

Eeprom problem seems to be fixed via #16

ThomasLeister commented 2 years ago
ep1cman commented 2 years ago

Can confirm SX1276 works as expected as the default

sandeepmistry commented 2 years ago

@ThomasLeister thank you for the pull request, and sorry for the delay.

We are still thinking about if the SX1262 is something we want to support in this library, and then I would have to get one that is supported for the US915 my testing.

In regards to your comment:

Maybe revisit the CMake switch mechanism. Maybe there's a better solution?

Since most RP2040 boards have ample flash space, I'm wondering if the small wrapper around the Semtech library could be used to auto detect the module version on init?

ThomasLeister commented 2 years ago

Sure, take your time to evaluate if this module should be supported by the library. If not, no worries. Then I'll just keep this branch in my personal repo.

As far as I have seen, there is no such WaveShare module available for regions other than Eu868. I just send WaveShare a message to get some information on their future plans. Maybe there will be US versions some day?

ThomasLeister commented 2 years ago

I have an update for you. The WaveShare support just replied to my mail:

Our engineer replied that the US915 and EU433 versions will be launched soon.

Sounds good! :)

ThomasLeister commented 2 years ago

Waveshare modules for EU868, US915 and EU433 are now available! https://www.waveshare.com/pico-lora-sx1262-868m.htm :clap:

gomond commented 1 year ago

The EU868 module works OK on US915 / AU915 just with minor power loss but well suitable for testing purposes.

kaspar-nl commented 10 months ago

Thank you so much for this branch. Hereby the confirmation that the following configuration works: