I have recently been wanting to play with LoRa radios because reasons. This gives me a way of sending short messages between devices using a lightweight protocol with a range of a couple of kilometres on a bad day. I ended up picking up a Challenger 2040 LoRa manufactured by iLabs from The PiHut, mostly because all the others were out of stock. I then spent three days just getting the radio to initialize in my code.

As the Challenger 2040 LoRa has a lot of unhelpful documentation, this is a practical getting started guide using Platform IO, an alternative to the Arduino IDE, in Visual Studio Code on Windows for this board. Some familiarity with VS Code and Platform IO is assumed.
Installing RP2040 Support for Platform IO
If you have used the Pico 2040 before then you have probably done this already, but if not here is a summary for Windows users – this is for a new installation. The full instructions are on readthedocs.io, if you have it installed already and see the depreciation warning, check the full instructions:
Prerequisites:
- Exit from VS Code
- Enable long path support:
- Windows 10/11 Home users may need to activate gpedit, see this Major Geeks how-to
- Click Window key and type gpedit.msc, then press the Enter key. This launches the Local Group Policy Editor.
- Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem.
- Double click Enable NTFS/Win32 long paths and close the dialog.
- Install git from: https://git-scm.com/download/win using the defaults.
- Restart the computer – this adds git to the path.
- Open an Administrator Console/Terminal (Terminal > Right Mouse Click and choose Run As Administrator), then:
- Enable long paths in git: git config ——system core.longpaths true
Adding to Platform IO
Now load up VS Code, and in Platform IO create new project, Give it a name (rp2040test) and select Raspberry Pi Pico as the board and Arduino as the framework.

Click Finish and let it do its thing. This will give us a platformio.ini file to edit.
|
1 2 3 4 |
[env:pico] platform = raspberrypi board = pico framework = arduino |
Update this file to be like:
|
1 2 3 4 5 |
[env:pico] platform = https://github.com/maxgerhardt/platform-raspberrypi.git board = pico framework = arduino board_build.core = earlephilhower |
When you save the file it takes a few minutes to automatically add the RP2040 SDK and long list of development boards including the Challenger 2040 LoRa to those available in Platform IO. You can now create a new project and choose the Challenger 2040 LoRa from the list of boards, which will give you this default platformio.ini:
|
1 2 3 4 |
[env:challenger_2040_lora] platform = raspberrypi board = challenger_2040_lora framework = arduino |
but I prefer to use the one below.
Initializing the LoRa Radio
This is the part that took me the most time to get working, here is the cheat-sheet. Set platformio.ini as:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[env] platform = https://github.com/maxgerhardt/platform-raspberrypi.git framework = arduino board_build.core = earlephilhower board_build.filesystem_size = 0.5m [env:challenger_2040_lora] platform = https://github.com/maxgerhardt/platform-raspberrypi.git framework = arduino board_build.core = earlephilhower board_build.filesystem_size = 0.5m board = challenger_2040_lora lib_deps = sandeepmistry/LoRa@^0.8.0 |
this also includes the LoRa library.
This is a modified version of the LoRaDumpRegisters.ino example just to show it working. The changes are to have it selecting SPI1 and setting the correct pins for the radio. Remember to set the correct frequency for your region:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
#include <Arduino.h> #include <SPI.h> #include <LoRa.h> const long lora_frequency = 868E6; // LoRa Frequency //const long lora_frequency = 915E6; // https://github.com/earlephilhower/arduino-pico/blob/master/variants/challenger_2040_lora/pins_arduino.h const int lora_cs = RFM95W_SS; // 9 LoRa radio chip select const int lora_rst = RFM95W_RST; // 13 LoRa radio reset const int lora_irq = RFM95W_DIO0; // 14 must be a hardware interrupt pin void setup() { Serial.begin(9600); while (!Serial) { ; } Serial.println("ready"); LoRa.setSPI(SPI1); // the library defaults to SPI0 LoRa.setPins(lora_cs, lora_rst, lora_irq); if (!LoRa.begin(lora_frequency)) { Serial.println("LoRa init failed. Check your connections."); while (true); // if failed, do nothing } LoRa.dumpRegisters(Serial); Serial.println("LoRa init succeeded."); } void loop() { } |
The expected output on the serial port is a list of numbers in hexadecimal format ending with “LoRa init succeeded.”
I hope this is useful and saves much faffing about.













































