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

(Hafkenscheid) #1

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 ?

(Hafkenscheid) #3

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)

(Hafkenscheid) #5

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


ok goodluck rewriting the lmic :wink: (or finding one online)

(Hafkenscheid) #7

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,
.dio = {4, 5, 7},

(R Sdavid) #8

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