Adafruit Feather 32u4 LoRa -> Gateway

I got hold of the M0 Lora feather an I got it to compile using the https://github.com/matthijskooijman/arduino-lmic/tree/non-avr-printf branch.

However it seems to hang after setup.

here is pin mapping that I am using

const lmic_pinmap lmic_pins = {
  .nss = 8,
  .rxtx = LMIC_UNUSED_PIN,      // (5) should be foreseen for later release (ok for A, needed for C)
  .rst = 4,
  .dio = {3, 1, 2},  // DIO0, DIO1, DIO2
};

Hi @kgbvax, Just take a look at my previous post in answer to Sean. The needed DIO pins of the RFM95 are not all connected on the Adafruit board. It is unclear which ones really are needed, but connecting DIO0, 1 and 2 brings a good result for me. I only changed the stated lmic_pinmap statement (and some soldering). Cheers.

Hmm, at least per schematic they are connected, this is where I got the .dio settings. Perhaps I will just measure whether this is correct…

Referring to the Adafruit docs only DIO0, CS and Reset are connected:
Since not all pins can be brought out to breakouts, due to the small size of the Feather, we use these to control the radio module
#8 - used as the radio CS (chip select) pin
#3 - used as the radio GPIO0 / IRQ (interrupt request) pin.
#4 - used as the radio Reset pin
Since these are not brought out there should be no risk of using them by accident!
There are also breakouts for 3 of the RFM’s GPIO pins (IO1, IO2, IO3 and IO5). You probably wont need these for most uses of the Feather but they are available in case you need 'em!
That is why you have to connect DIO1 and DIO2 to free D pins, and fill in this ports in the lmic_pinmap statement. IF these pins where connected, to which dataport? That is not in the schematic. But measuring is ‘proof of the pudding’. Cheers

You are right; heating the soldering iron…

Note that only one of DIO1 and DIO2 is needed for LoRa communication, the other is needed for FSK mode (IIRC the README of my lmic repository states which is which). DIO0 is needed for both.

Got it wired uo and it does not freeze. However not data is picked up.

I am bit lost with the various LMIC forks and branches. Which one is “good”? (For Feather M0, aka ARM).

I know the struggle. Try to help you.
First: use ONE library, and drop all others: https://github.com/matthijskooijman/arduino-lmic
I use Arduino 1.6.7, it works for 1.6.9 now as well
Put the right DIO pinning in the main code (as stated before). The numbers are the digital port numbers (that is a mapping in the arduino platform to the real port pins).
Decide for ‘the new platform’ or the ‘old croft’. It works for me for the new OTAA platform.
For OTAA: Follow the instructions of ‘ernestospace’ in Over-the-air-activation OTAA with LMIC (so create an application, get the APPEUI, decide/choose an DEVEUI and get the APPKEY from ttnctl)
Use the ttn.ino example.
For me, the code did NOT work, no joining (which is needed in OTAA). To original code:
// Start job
do_send(&sendjob);
}

void loop() {
    os_runloop_once();
}

My Code:
LMIC_setDrTxpow(DR_SF7, 14);
os_runloop_once();
Serial.println(“Send Job”);
LMIC.dn2Dr = SF9;
do_send(&sendjob);
}

void loop() {

os_runloop_once();

So i Did add a runloop once statement to get things working. Insert Serial debug statements to test the flow. I still think there are stability issues with the M0. Maybe because of the USB / serial emulation in code, may be because of the OSticks. No interrupts are used, because, well say: too difficult. At the end the hal should be re-engineered on the M0.
Cheers

1 Like

Regarding which branch, @kgbvax

I’m running the master branch of @matthijs library on a Feather M0 wired to the Adafruit Lora board (RFM95).

I had to reduce the SPI clock speed to 8E6 in hal.cpp.
Also fixed bug in disableChannel (for US/NA code path).

(both changes submitted as PR’s to repo)

  • Frank
1 Like

Thanks everybody for sharing info on the Feather M0! I got the ttn-example working after wiring up DIO1 and decreasing the SPI clock speed.

I’m however getting RSSI values around -100, which is lower than I expected… I’m using a 1/4 wave wire antenna and the gateway is about 5 m away, through a wall. Is this normal?

My other sensor with a SX1276MB1MAS mbed shield gives about RSSI -50 in the same spot (proper antenna on that one though)

1 Like

Very good catch. :)wink:
This is a hardware bug in the silicon of ATSAMD21G18A (in fact for all D21 chip if I’m not mistaken) for revision A, B & C. Maximum SPI clock is limited to 8 MHz both as master or slave. If your chip has marking D or newer, it should be able to run at half of the processor clock (48 MHz/2 = 24 MHz).

2 Likes

Has anyone actually gotten the Adafruit LoRa Feather working? I’m using the code of the great @matthijs but my board gets thrashed if the startup function includes os_init().

@jeffy not yet, but that’s why I’m asking: what Feather did you test with as a node?

I’m a DanW collector… finishing ? No never, then it will lose it’s value :wink:

Thanks for the reply @ursm!

I’m testing a Adafruit Feather 32u4 RFM95 LoRa Radio -915 MHz

Thanks to your help I got it to work! \o/

Speaking of DanW, have you heard from him? Can’t wait for some of his new updates.

No, maybe he’s on holiday

Hi Everyone,
I have a FeatherM0 lora module and a Multitech conduit Gateway.
I have installed the following library and trying to run the example code


I have made the required hardware and code changes as given in the previous posts.
I am using the US frequencies.
I get the following error when I compile the ttn code on Arduino IDE - ‘DR_SF12’ was not declared in this scope
Can someone please guide me how to rectify the error?

If you’re in the US, then maybe try this fork: https://github.com/GitableRoy/arduino-lmic