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

Changing between PA_BOOST and RFO pins #25

Closed shabaz123 closed 2 years ago

shabaz123 commented 2 years ago

Hello,

I've compiled the library and the temperature demo, and when using the RFM95W, although from a LoRaWAN protocol perspective it is successful, I'm seeing extremely short range (just a meter to the LoRaWAN gateway is successful), and I believe it could be due to the PA_BOOST pin or RFO pin usage being different to what the LoRaWAN library expects.

How can I switch between the pins? Is there a config setting, or do I need to make a code change in (say) lorawan.c? I'm still learning the source code, so I'm not familiar with precisely where or how to make the change, to confirm if this is the reason for the extremely short range.

Many thanks!

sandeepmistry commented 2 years ago

Hi @shabaz123,

You could try to hardcode the return value of the SX1276GetPaSelect function in src/boards/rp2040)/sx1276-board.c.

Let me know how this goes.

shabaz123 commented 2 years ago

Hi Sandeep,

Thank you, that worked! I added this line at the beginning of the function, and successfully tested with the RFM95W module connected to Pico, it successfully connected to TTN and I was able to receive the temperature, and also send bytes:

return RF_PACONFIG_PASELECT_PABOOST;

p.s. love all the work you've done over the years.. I recognise your name from BLE sensortag, BeagleBone Black, etc., stuff on GitHub years ago : )