Howto connect Adafruit RFM95W Breakout 868 Mhz on Arduino MEGA 2560 to The Things Network

I would like to get started using TTN, using an Arduino MEGA 2560 and the Adafruit RFM95W Breakout 868 Mhz.
The breakout board is properly connected to the arduino and the sample sketch from Adafruit is running well (however, I do not have a receiver part, so I can only tell that the board is sending).
As specified by the Adafruit tutorial, I am using the RadioHead RH_RF95 library.
I already registered an application and a device, but then I don’t have a clue where to get started connecting to The Things Network.

Thanks in advance!

this setup will not work on the TTN network like this , you use that library… what’s the rest of your arduino / TTN LoRaWAN mega code ?

There is no code yet, I am just trying to get it to work and experiment if it is something I can use.
As I understand now, the RadioHead library is not going to work, so I need to look for another library.
While browsing at the TTN website/forum I see several people mention the LMIC library (for example used in Dragino shield). I studied several sketches and posts, but I still don’t get if that should work and if so, how to get the pin mapping right.

If I was you I buy a cheap arduino pro mini and connect it to your adafruit board.
there are many examples available (also on this site - use search)

Thanks for your suggestions, but my intention is to use the Mega. Anyone else some suggestions?

Several hours later I succeeded. The lmic library can be used on the Arduino Mega 2560, but I probably had the pin mapping/wiring wrong. Below you find the details of my setup.

Pin mapping:
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 10,
.rxtx = LMIC_UNUSED_PIN,
.rst = LMIC_UNUSED_PIN,
.dio = {4, 5, 7},
};

Did you get this working on the Due? I am having trouble getting it to work with the Non AVR LMIC library and the alternative pin mappings

The radio module’s GPIO pins are wired directly to the edge of the board according to adafruit. You need a level shifter for the GPIO pins, because they are not 5V safe. Adafruit considers the GPIO pins as an advanced option, because they personally have no use for them according to them.