# Wiring RPI Pico with Adafruit RFM9x LoRa Radio

**URL:** <https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557>\
**Category:** LMIC\
**Created:** [April 19, 2022, 11:00am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557 "2022-04-19T11:00:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 19, 2022, 11:00am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/1 "2022-04-19T11:00:27Z")

</div>

Hello,  
I’ trying to reproduce the setup described in the README.md doc file of LMIC-Node (§8.1 Serial Monitor: i.e. an RPI Pico with an RFM9x Radio module).

Looking at file bsf\_pico.h I can see that 2 wires are needed from Pico GPIO 9 \<-\> DIO0 (of Lora Module), and from  
Pico GPIO 10 \<-\> DIO1 (of Lora Module)

However, if I look at the pinout description of the LoRa Radio  
[https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts/pinouts](https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts/pinouts)  
I can not identify DIO0, or DIO1.  
On the Radio Module the connections labelled EN (Enable) and G0 (GPIO0 - IRQ) are still free.  
For this reason I assume that the connections should be:  
Pico GPIO 9 \<-\> G0 (of Lora Module), and from  
Pico GPIO 10 \<-\> EN  
I will be extremly grateful to you, if you could confirm me this.  
Thank you in advance. Cheers

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 19, 2022, 11:28am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/2 "2022-04-19T11:28:10Z")

</div>

Can you post a picture of the RFM module - the collection I have all have the DIO pins very clearly marked and no EN or G markings. And I have other SX1276 boards will all sorts of markings so it would be good to be sure about the identity of the board you have.

EN would imply enable which is not what the DIO1 pin needs to do - it communicates back the RxTimeout as you discovered with your Adafruit Feather.

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [April 19, 2022, 12:12pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/3 "2022-04-19T12:12:41Z")

</div>

> [@psereni](#):
>
> Pico GPIO 10 ↔ EN

Nope, that the enable pin for the Adafruit boards on board AP2112K regulator, see the schematic below, you get to it by clicking on ‘Downloads’ link on the page you (almost) provided a link too;

> **[Adafruit RFM69HCW and RFM9X LoRa Packet Radio Breakouts](https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts/downloads)**
>
> Sending data over long distances is like magic, and now you can be a magician with this range of powerful and easy-to-use radio modules. Sure, sometimes you want to talk to a computer (a good time to use WiFi) or perhaps communicate with a Phone...

And also on the schematic you can see G0 (DIO0) is next to EN and it should be clear where DIO1 is.

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [April 19, 2022, 2:12pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/4 "2022-04-19T14:12:45Z")

</div>

> [@psereni](#):
>
> I can not identify DIO0, or DIO1

As @LoRaTracker already mentioned Adafruit apparently uses labels G0 - G5 for DIO0 - DIO5 on this module.

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 19, 2022, 2:28pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/5 "2022-04-19T14:28:31Z")

</div>

OK, thank you so much

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 19, 2022, 5:33pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/6 "2022-04-19T17:33:08Z")

</div>

The link went to [http://pinout](http://pinout) which I misread as meaning to go to [http://pinout.xyz](http://pinout.xyz) which is the RPi site for the Pi pins hence my asking for a picture. I’ve edited in the URL in the original post.

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 19, 2022, 7:38pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/7 "2022-04-19T19:38:52Z")

</div>

Here a picture, anyway  
 ![LoRaRadioRFM9x](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/0/f/0f5c31a18eb582719a4398c632479cc30010c225.png)

And here the product page from Adafruit

[https://www.adafruit.com/product/3072](https://www.adafruit.com/product/3072)

Thanks again, Cheers

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [April 20, 2022, 10:00am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/8 "2022-04-20T10:00:06Z")

</div>

FYI, a pinout for the LoRa module can be found here: [LoRa module pinout](https://github.com/lnlp/pinout-diagrams/blob/d749e135e243975ed0e8af9bba4f7b0efa78f2ab/LoRa%20modules/SX127x%20RFM9x%20HDP1xA%20LoRa%20Module%20Pinout.pdf).

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 21, 2022, 9:56am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/9 "2022-04-21T09:56:19Z")

</div>

Hallo and sorry for disturbing you once more.

I’m trying to use an RPI Pico as end node using the LMIC Library under PlatformIO.

The problem is, that I can succesfully build the project on my host computer but I always get “Upload Error 1” when I try to upload the file on the RPI Pico.  
Following [https://docs.platformio.org/en/latest//faq.html#solution-3-run-from-terminal](https://docs.platformio.org/en/latest//faq.html#solution-3-run-from-terminal) I also tried an upload from the command line, without any difference (screenshot attached)  
 ![Screenshot_2022-04-21_11-25-36](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/a/f/af4e56b761951dcf35013695e2dcc77357337d81.jpeg)

I noticed, however, that the upload process is trying to upload file **firmware.elf**. As far as I know, I should upload file **firmware.uf2** instead.  
Can this explain the problem?  
Have I forgot a setting anywhere? How can I modify this?  
Thank you very much for any help.  
Cheers.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 21, 2022, 10:07am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/10 "2022-04-21T10:07:22Z")

</div>

I’ve moved this topic so we can umbrella a type of issue in to one, just in case there is anything to cross reference between them.

The .uf2 format is for drag & drop so you could do that manually.

I’ve not used the picotool upload method as I’ve repurposed a Pico as an SWD programmer, as well as having other programmers but most of my Pico programming is on a Pi 4 which also runs as a programmer. So plenty of combos to check.

The other thing is that the .elf is reporting a binary that appears to be destined to run from RAM rather than flash.

Have you got Blinky working on a Pico before you tried this?

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 21, 2022, 10:24am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/11 "2022-04-21T10:24:58Z")

</div>

No, not yet. I will try a blinky test.

By the way, my first experiment used a RPI 4 as host computer, but I did not manage to build the Platform IO Project.  
Now I’m using a Linux Laptop and the build runs well.

Thank you

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 21, 2022, 11:07am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/12 "2022-04-21T11:07:43Z")

</div>

First I followed [https://tutoduino.fr/en/pico-platformio/](https://tutoduino.fr/en/pico-platformio/) to modify permissions on USB ports.

Blinky test worked fine.

LMIC-Node test went a step further but ended with "Failed to open directory “RPI-RP2” - Error opening directory “/media/paolo/RPI-RP2”: permission denied.

Any help will be greatly appreciated

Cheers.

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 21, 2022, 11:12am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/13 "2022-04-21T11:12:45Z")

</div>

Wait. Second test apparently worked. I need to invest more time.

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 22, 2022, 8:36am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/14 "2022-04-22T08:36:37Z")

</div>

Hello,  
upload of LMIC-Node code works. It was my error.

I met however a problem which causes a Failure (Picture  
 ![Screenshot_2022-04-22_09-49-20](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/7/2/72de7550f0f27a0f9b3c84adf612a66da47ab739.png)  
).  
Any idea?

Thanks a lot. Cheers.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 22, 2022, 9:34am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/15 "2022-04-22T09:34:23Z")

</div>

What is the code on line 53 of oslmic.c?

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 22, 2022, 10:21am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/16 "2022-04-22T10:21:03Z")

</div>

Line 53 of oslmic.c is the last instruction of

```auto
void os_init(){
     if(os_init_ex((const void *)&lmic_pins))
           return();
     ASSERT(0);
}

```

i.e. line 53 is ASSERT(0);

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 22, 2022, 10:49am UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/17 "2022-04-22T10:49:36Z")

</div>

Yeah, already knew that, what does it “say” to you that the assert is triggered?

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 22, 2022, 1:43pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/18 "2022-04-22T13:43:31Z")

</div>

Thank you.

this tells me that somenthing went wrong in os\_init\_ex(). are the pins wrong connected?

---

<div class="post-metadata">

**Author:** ![psereni](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/psereni/32/35697_2.png) [@psereni](https://www.thethingsnetwork.org/forum/u/psereni)\
**Post date:** [April 22, 2022, 1:51pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/19 "2022-04-22T13:51:30Z")

</div>

Or maybe I’m trying to initialize the wrong OS?

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 22, 2022, 2:22pm UTC](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557/20 "2022-04-22T14:22:42Z")

</div>

> [@psereni](#):
>
> Or maybe I’m trying to initialize the wrong OS?

No, there is a very simple RTOS in the heart of LMIC, but the function does say Initialise the OS with these pin settings so …

> [@psereni](#):
>
> are the pins wrong connected?

yes, it is saying the pins defined in the code aren’t giving a response from the radio. Usually it’s well detailed in the documentation for LMIC-node but you have control over how you connect the radio to the Pico so you have to tell the code how you have connected it.

[Next page](https://www.thethingsnetwork.org/forum/t/wiring-rpi-pico-with-adafruit-rfm9x-lora-radio/56557.md?page=2)
