lorawan-library-for-pico icon indicating copy to clipboard operation
lorawan-library-for-pico copied to clipboard

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

Open ThomasLeister opened this issue 3 years ago • 9 comments
trafficstars

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

Waveshare module:

  • Shop: https://www.waveshare.com/pico-lora-sx1262-868m.htm
  • Wiki: https://www.waveshare.com/wiki/Pico-LoRa-SX1262-868M

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:

  • [x] Check if SX1276 support is still working properly (it is still the default for this library)
  • [ ] Check if all example applications work for SX1262 - so far only otaa_temperature_led has been tested.
  • [ ] Maybe revisit the CMake switch mechanism. Maybe there's a better solution?
  • [x] Check the problem with eeprom (original commit https://github.com/ArmDeveloperEcosystem/lorawan-library-for-pico/commit/e31d3c133f0effca9d3660e35b383506018eca39). The Pico does get stuck in "Duty cycle restricted" when that commit in included. If it is reverted / removed, the join process does work fine. Maybe related to #14 ?

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 avatar Jan 12 '22 17:01 ThomasLeister

Eeprom problem seems to be fixed via #16

ThomasLeister avatar Jan 16 '22 15:01 ThomasLeister

  • Removed the "Revert "Use board's last flash sector for eeprom storage" commit (force push!) => (EEPROM / Flash active, again.
  • Merged my eeprom fix to this branch

ThomasLeister avatar Jan 16 '22 15:01 ThomasLeister

Can confirm SX1276 works as expected as the default

ep1cman avatar Jan 18 '22 13:01 ep1cman

@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?

sandeepmistry avatar Feb 03 '22 18:02 sandeepmistry

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 avatar Feb 10 '22 11:02 ThomasLeister

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 avatar Feb 11 '22 06:02 ThomasLeister

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

ThomasLeister avatar Mar 19 '22 14:03 ThomasLeister

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

gomond avatar Jul 21 '22 14:07 gomond

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

  • Waveshare Pico-LoRa-SX1262-868M
  • Raspberry Pi Pico WH

kaspar-nl avatar Aug 26 '23 14:08 kaspar-nl