Adafruit Feather 32u4 LoRa -> Gateway

Hi @shamry, do check your DIO pin connections and the definition in the LMIC part. In most cases this will solve the starting problem. Sometimes the good old ’ blink’ example and a voltmeter will give a poor mans ’ logic analyzing’ of the output ports and possible shortcuts / routing problems. Cheers.

Hi, I’m using a Adafruit Feather M0 Radio with LoRa Radio Module, and I’m trying to get it working with the matthijskooijman/arduino-lmic library (master branch). I have changed the SPI speed to 8E6 in hal.cpp, and connected DIO2 and DIO3 to available GPIO’s.

const lmic_pinmap lmic_pins = {
    .nss = 8,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 4,
    .dio = {3, 6, 11},
};

I started out with the ttn-otaa example, and updated the correct appeui, deveui, and appkey.

At this point, the RFM module is sending out some signals (I have checked with my SDR dongle). The TTN dashboard changes the state of the node to ‘activated’, so I know the signal was detected by the gateway and was being forwarded tot TTN. On my SDR, I can see the gateway responding after 5 seconds, but It seems the Feather is not picking it up.

When I check the serial console, I can see the code is stuck at:

Starting
Packet queued
2209: EV_JOINING

I have been trying several things, but none of them are making it better. I tried, adding the extra os_runloop_once(), different GPIO’s for DIO’s, ABP example (works only 1 time, then stalls).
I also tried to get the #debug working, but havn’t succeed on this for the M0 and the printf’s.

I have spent a lot of hours trying to figure this out, but I’m out of ideas.

Update:

It seems that the ‘joining’ succeeds in about 1 out of 5 times. Setup, range, position etc is not changing, just pressing the reset button.

If its successful, i get the following in the console.

Starting
Packet queued
463250: EV_JOINING
1195255: EV_JOINED

In the TTN Dashboard, I can see the correct payload (RSSI -44, 2m away with a wall from the gateway). It seems that joining the network works correctly, but the EV_TXCOMPLETE event is never called. (so no rescheduling of the next transmit).

I find it strange that sometimes it works, but most of the time it doesn’t. I have tried to make it deterministic, but the successful join comes at random. I don’t have the tools or environment to test and debug it more thoroughly. I have no idea if this could be software or hardware.

1 Like

Thanks to all the help from this forum I am able to get my network up and running using Feather M0 and multitech conduit gateway(915 MHz).
I see very low RSSI values of -90 to -110 dBm even with the end device and gateway couple of meters apart.
The result is same with just a wire antenna or with a good antenna.So it doesnt seem to be an antenna problem . What might be the reason for this? Is there any setting tweaking that can be done to increase the RSSI?

Also I am facing another weird problem. I seem to not receive anything when I program my feather to a different laptop from the desktop I have been using. The laptop has arduino with all the necessary libraries and drivers installed and I can see on the serial console that the feather is transmitting but I dont receive anything. It works perfectly fine with the desktop. Any ideas what is causing it?

@sillevl Hi - did you get this working … I am having very similar problems with the rocketscream board

No, I haven’t had the time nor the resources to dive deeper into it. So no progress yet. I hope someone can solve this. Keep me up to date if you find anything helpful.

I have the Adafruit Feather Lora ‘sort of’ working. I connected DIO1 to D6 and DIO2 to D11, and for DIO0 and RST I relied on the connections that are already in place on the board. So my pin settings are

const lmic_pinmap lmic_pins = {
.nss = 8,
.rxtx = LMIC_UNUSED_PIN,
.rst = 4,
.dio = {3, 6, 11},
};
And finally I changed the SPI clock as indicated in this thread.

I now find that my Feather sends upon powerup (or reset) exactly one time a valid ‘hello world’ message to the Lora network, which is received correctly. On the console, I only see:

Serial monitor opened…
Packet queued

So it seems the board is hanging after the first succesful transmission. Anyone seen this kind of behaviour, or have some tips on where to look for the problem?

Please could you provide more graphical detail (picture, circuit etc) on the pin connections you made on the Feather M0 with LoRA radio?

Cheers
Paul

I have this working like I described here: https://www.thethingsnetwork.org/forum/t/lmic-on-adafruit-lora-feather-successfully-sends-message-to-ttn-and-then-halts-with-packet-queued/3762/17?u=sillevl

I think the Serial is the bigest problem. Try changing it to Serial1 or something other: LMiC on Adafruit Lora Feather successfully sends message to TTN and then halts with "Packet queued"

Thank you. The pic clears up my confusion.

For those of you interested in low power operation of the Lora Feather 32U4:

I experimented with the libraries power.h and Adafruit_SleepyDog.h

In the setup I switched as many parts of the processor off as possible, and switched back to half clock speed:

power_adc_disable();
power_usart0_disable();
power_twi_disable();
power_timer1_disable();
power_timer2_disable();
power_timer3_disable();
power_usart1_disable();
power_usb_disable();
USBCON |= (1 << FRZCLK);
PLLCSR &= ~(1 << PLLE);
USBCON &= ~(1 << USBE );
clock_prescale_set(clock_div_2);

(WARNING: this also switches the USB off, so remember to put a delay(10000); statement first, otherwise you may have trouble loading a new sketch on the board!!!

Then instead of using the parameter TX_INTERVAL to determine the transmit interval, I set this parameter to 1 and I implemented my own cycle in the routine onEvent like this:

for (int i=0; i<35; i++) {
Watchdog.sleep(8000);
}

This gives about 5 minute recycle time. The watchdog can only do 8 seconds max.

Results:

The sleep current is 310 uA
The ‘active’ current is 3.5 mA for about 10 seconds. Don’t know why this interval is so long, because the actual transmit and receive windows are only a fraction of that. I use 1 byte payload, which gives 45 ms transmit time. During the transmit the current is about 40-50 mA, but hard to measure because it’s only a fraction of a second.

I’d be interested to hear power saving tips from others!

1 Like

Some observations:

  • With half clock speed, the AES encryption takes more time to complete. Will do some oscilloscope measurements to see what is more efficient.
  • I have put TX_INTERVAL to 0

Further investigations ongoing :wink:

I did some additional measurements. My results:

  • At half clock speed, the active time is about 12 s with 3.8 mA
  • At normal clock speed, the active time is about 5.5 s with 5.7 mA

So actually, running at normal clock speed is more energy efficient: 8.7 uAh versus 12.7 uAh.

With SF7, the transmit time is 46 ms at 130 mA, so that consumes 1.7 uAh.

Is there an Cortex M0 equivalent to the AVR power.h?

I’m using Adafruit_SleepyDog.h, but are there any more libraries for the M0 that helps with power saving?

I am looking to set up a network consisting of some nodes based on Adafruit feather 32u4 Lora based board. Being a beginner into creating a network, I wanted to ask if anyone has created a network based on LoRa. I have 4 LoRa modules as nodes and 1 as the gateway. I want to aggregate my data on the gateway using Long Range communication of LoRa. Thanks!!

it seems that this is your first post here @ The Things Network… welcome and start to read a little bit here

Hi @soumyasamirana, the difficulty with the Feather Lora board is that you have to provide the LoraWan stack yourself. This has bee done and it works, but I don’t know if that library is also capable to run on the Gateway side of things, Another risk may be that the gateway code does not fit in a Feathers memory.

@soumyasamirana you’ll want to read up on the different parts of LoRaWAN if that’s really what you want or if you want to just use LoRa without all the backend stuff. LoRaWAN consists of the data gatherers, nodes, which send packeted messages to a gateway device. The gateway adds location information plus a bit more to the node message and sends all that to a network server. This is generally sent over ethernet(LAN or WiFi) across the Internet. So if you want your Feather to be a gateway it has to have that software to wrap the node message and it has to have a network connection so software for that too.

But if you just want a bunch of LoRa nodes connected, look at Adafruit for help since this site is all about the LoRaWAN system.

Hi, Thanks for your input. Can you tell me where can I get the LoraWan stack that you said has been done before ?

Hi, Thanks for your help.
I am not getting any information from Adafruit as you have mentioned earlier. Is their any other open source stack that I can run with the Adafruit module ?

@soumyasamirana, maybe Adafruit is not responding as they have these nice pages where they explain all?

1 Like