Arduino Pro Mini RFM95 pinmap problem

Here is the Pin used by RFM95 on the Arduino
Pins usage on Arduino
D2 - RFM95_INT
D9 - RFM9x_RS
D10 - RFM9x_CS
D11 - RFM9x MOSI
D12 - RFM9x MISO
D13 - RFM9x SCK

So my mapping is it correct?

const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 9,
    .dio = {2, 6, 7},
};

Have you checked the circuit diagram and the jumpers you might need to add?

How did you get hold of LMIC? From where, how installed? Can you look online for it? Or search on your computer?

What do you mean by connecting with jumpers?

I installed LMIC via the bookstore library. I installed MCCI LORAWAN LMIC

Here is the equipment’s link : LoRa Radio Shield (868MHz) | Makerfabs

I noted the absence of jumper but my main problem remains the pin mapping and I still don’t know if my pin mapping is good

If you do not fit jumpers there is no connection between the rfm95 and the Arduino for Dio1, Dio2 and Dio5. Does LMIC need any of these signals???

Which version?

Regardless of version, it will have included the README.

The README has the instructions. The instructions will tell you about things like the configuration and pin mapping and oooo so much more.

The “bookshelf” icon or library as it is known as includes a link to the source which is another way of finding the README.

BTW, you didn’t install the MCCI library as the MCCI copyright message isn’t at the top of the entire file you provided. But the version number should say where you got it from.

Yes LMIC uses its pins. In the README of the LMIC folder here is what is filled in
" The LMIC library needs only access to DIO0, DIO1 and DIO2, the other DIOx pins can be left disconnected.
In LoRa mode the DIO pins are used as follows:

  • DIO0: TxDone and RxDone
  • DIO1: RxTimeout ".

And on the card I haden’t connected these pins using jumpers.
I will test and get back to you on the result obtained by implementing all its prerequisites.

I saw the README.
I installed the version v4.1.1.
And here is what is said following the Pin Mapping :
“The names refer to the pins on the transceiver side, the numbers refer
to the Arduino pin numbers (to use the analog pins, use constants like
A0). For the DIO pins, the three numbers refer to DIO0, DIO1 and DIO2
respectively. Any pins that are not needed should be specified as
LMIC_UNUSED_PIN. The NSS and dio0 pins are required. The others can
potentially left out (depending on the environments and requirements,
see the notes above for when a pin can or cannot be left out).”

And also on the card I didn’t connecte these pins using jumpers.
I will test and get back to you on the result obtained by implementing all its prerequisites.

There’s no point duplicating the information in replies, we can all see them.

Hmmmm, I wonder how you ended up with the older (deprecated) repro’s radio.c which you quoted above as it is the only one that has the assert on line 689.

As this thread is getting rather protracted, the short version of your problem is that the code is requesting the version of the radio chip and not getting back the result it expects. This means one or more of:

  • The shield is not plugged in quite right for the Mega - check that the pin numbers on the shield align with the pins on the Mega.
  • The shield has an issue of some sort, ie it’s broken.
  • The Arduino has an issue of some sort, it it’s broken

The thing to try after checking the pin matching when you plug it in if that doesn’t make it work is to scroll up this thread to the very top and use @LoRaTracker’s library to run some diagnostics.

It that’s not able to talk to the radio I’d unplug the shield, try another SPI device to test that on the Mega and if that works, use jumper cables to link the shield to the Arduino. If another SPI device won’t work, then I’d suspect the Mega or the other device. So having another Mega would be useful. Or an Uno, which won’t have the space to run the LMIC but you can at least run the diagnostic library.

A user called phairou did raise the same issue a few days ago over in the Arduino forums, same pictures etc. Although the documention requested on the shield pinouts was apprently not available at the time.

The documentation linked in this series of posts suggests the shield uses pins 13,12,11 for SPI, which wont work on a Mega 2560.

Screenshot - 04_06_2023 , 13_29_49

J8 appears to be the SPI\ISP connector which is what the shield should really be using to pickup the appropriate SPI connections.

Sorry, that’s when I had the old version of LMIC. Now it no longer puts \LMIC-Arduino\src\lmic\radio.c:689 but rather \MCCI_LoRaWAN_LMIC_library\src\lmic\oslmic.c:53.
I have done the Pin mapping below following the board branch shown here https://www.makerfabs.com/desfile/files/LoRa%20%20Radio%20Shield%20user’s%20manual.pdf:
const lmic_pinmap lmic_pins = {
.nss=10,
.rxtx = LMIC_UNUSED_PIN,
.rst=9,
.dio = {, 6, 7},
}

But I still have the same error. All weekend I was on this and still not resolved.

Hello, yes it was me.
I didn’t quite understand your intervention.

I said;

“The documentation linked in this series of posts suggests the shield uses pins 13,12,11 for SPI, which wont work on a Mega 2560”

Meaning, the documentation you linked to above;

https://www.makerfabs.com/lora-radio-shield-868mhz.html

Has a schematic of the board which suggests the shield is for a Arduino UNO and wont work on a Mega 2560.

1 Like

Ah OK. Yeah, I got that kind of response too. I think I will have to change my LoRa shield. Which shield operating at 868 MHz would you recommend?

LoRa devices are 3.3V logic devices as are most all of the other devices that you would connect to a modern Arduino.

Trying to connect LoRa devices to very old style 5V logic level Arduinos such as the UNO and Mega2560 can cause problems.

Myself I cannot recall the last time I used a 5V logic Arduino for anything serious, maybe 5 or 10 years ago …

And what does that line tell you?

Please don’t quote ALL of a reply - it is sufficient to select the relevant portion.