How to connect Grove Lora Radio modules to TTN

I’ve succesfully worked with several different RFM95 modules and the LMIC library.

This year, at my school, I’ve bought a whole bunge of Arduino’s with grove connectors on it. I want to teach my students to work with Arduino’s and also with TTN. I’ve some Dragino sheilds and just recently I’v bought 10 Grove Lora Radio’s, thinking this would be just like any another RFM95 module. I’ve tried the LMIC library, but with no succes. I think the LMIC library is based on SPI but the Grove Lora Radio’s connects the RFM95 through a serial connection. So I think that there is some kind of Lora protocol firmware on the module and you can send commands to is, but don’t know how.

I would like to use the Grove Lora Radio’s with TTN, has anybody succeeded.

It looks like this uses some rather dubious and less than wonderfully credited knock-off of the Radio Head library to provide an Arduino interface that then proxies via UART to the ATmega168 on the radio module.

What’s odd is their page links to a stock LMiC

There might be three courses of action:

  • Try Grove’s forums for existing posts, ask for support, etc
  • See if you can figure out enough (from the Radio Head knock-off, etc) about the on-board firmware to be able to do LoRaWAN operations through it. Getting timing right for downlink windows may be particularly tricky
  • Replace the ATmega168 firmware with something more suitable, for example move the SPI radio and precise timing related part of LMiC over there, but keep the state / data / crypto parts on the host and run them a little bit asynchronously. Or do nothing but proxy the SPI and figure out what sort of delay you need to expect…

There are a few LoRa modules that have a processor in front of them to provide a UART front end, Ebyte for instance do a range.They seem to be designed for point to point LoRa applications.

Whilst a TTN library might be possible for such modules, I am not aware of one.

Thanks for your replies.

I’ve managed to use to of those radio’s in a peer-to-peer connection and that worked. So I can create some project with my students with LoRa. But I’ve bought them to use with LoRaWAN like TTN!

Just as loratracker and cslorabox said, this Radio module uses the ATMega168 as an interface between the RFM95W (SPI) and my Arduino (serial connection). I’m not capable (nor do I have time) of writing my own library, so for the time beeing this is for me a dead end.

Strange dough (as cslorabox already mentioned), the Wiki page of Seeed studios link to the LMIC library.

On the back of the Radio module there are 6 soldering pads suggesting you can make an SPI connection and this way skip the ATMega168, I can see the following pins: GND, MOSI, 3V3, RST, SCK, MISO. (These soldering pads are direcly at the back of the RFM95W module, so nog through hole). I will try to connect those to my Arduino, but then I need some help with the right configuration in the LMIC librarry:

I will try the following connections between the Radio Module and an 3.3V Arduino UNO:
GND <=> GND
MOSI <=> D11
3V3 <=> 3V3
RST <=> D9
SCK <=> D13
MiSO <=> D12

What settings should I then use with LMIC,

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

Or do I need to use a multimeter and find out the connection between the soldering pads and the RFM95W. What should I measure and how does that correspond with the lmic_pinmap?

Or do I need to add some extra leads directly with the RFM95W module?

Those pins are probably there to allow for programming of the ATmega168 during manufacture.

They will be connected to some of the pins used by the LoRa device, so you would likely have to disable the ATmega168, then link in the other required pins for the LoRa device;

rst, nss, dio0, dio1, dio2.

Not at all easy and even harder to make it all reliable.

Is it really worth all the bother ?

Exactly, those are for ISP programming of the ATmega.

And while if you can get the NSS and radio reset you can make software poll status instead of using the DIO pins, there’s the added risk that if you hold the on-board ATmega in reset while doing other operations on the SPI pin, you can accidentally trigger an ISP erase. You wouldn’t think that’s very likely, but I’ve had it happen twice.

Your options are either to work with the existing firmware, replace the existing firmware, or use a different radio module.

Both of you, thanks for this advise. I think you are both right and those pins are for programming the ATMega168. As long as there is no specific firmware for LoRaWAN, I’ll park this problem. I will use my Dragino shields in the classroom and will build small peer-to-peer networks with the Grove LoRa Radio’s.