Adafruit Feather 32u4 LoRa -> Gateway

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

Thank you.
I am able to compile and upload the code with no errors now.
Now I am trying to receive packets on my Conduit Gateway.
For which I have to do the following

node add [DevAddr] [APPEUI] [DEVEUI] [NwkSKey] [AppSKey]

Where do I define the APPEUI and DEVEUI in the code?
I am getting an error "expected primary-expression before ‘}’ token " if I try to define them as follows
void os_getArtEui (u1_t* buf) {0x2B,0x7E,0x15,0x16,0x28,0xAE,0xD2,0xA6,}
void os_getDevEui (u1_t* buf) {0x2B,0x7E,0x15,0x16,0x28,0xAE,0xD2,0xA6,}
void os_getDevKey (u1_t* buf) {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,}

I have attached the screen shot of the LoRa configuration in my gateway

Sorry, I’m very confused. What is that line?
It looks like you want to register your node directly on your gateway? You have to register them on the TTN backend instead. There is a detailed guide here if you like the command line, or if you prefer a GUI, then just head over to https://staging.thethingsnetwork.org/ and then you will be able to create your applications, get an AppEUI assigned, and register devices to it.

Check the wiki, there’s a lot of info there: https://www.thethingsnetwork.org/wiki/Backend/Connect/Application

Hi @Galagaking … i was able to compile but when I run serial … it stuck at “starting” … using rockectsream m0 …and … it stuck at osinit( ). …