hallard / Mini-LoRa

Arduino Mini Lora Battery/Sensors Board
175 stars 38 forks source link

Mini-Lora, LMIC and TTN #7

Closed jocelynduc closed 4 years ago

jocelynduc commented 4 years ago

Hi,

Does somebody has a working example with this node, using LMIC library and TTN?

Can't get it working (EV_JOINING, nothing more). Is maybe my pin map incorrect?

const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = A0,
    .dio = {2, 7, 8},
};

Thanks

crox-net commented 4 years ago

Hi,

I have a "hello world" working with TTN. Working on a better example that I can publish (including making good use of the TPL5110), but maybe you beat me to it :-)

This works for me:

// Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 15,
    .dio = {2, 7, 8},
};
jocelynduc commented 4 years ago

Hi,

Good idea! A ready-to-use implementation for this node (and TTN) is missing, especially for beginners like me ;) I know there are tons of LMIC examples, but not able to get it working.

I think it's more a device configuration problem (TTN keys) right now, as I am able to send a JOIN request with OTAA or a message with ABP (visible in TTN gateway console, but not in Application).

Do you work with OTAA or ABP? Can you share a bit more?

A good use of the TPL5110, I am not sure if I can really help with the correct way to do it. I saw some tutorials where the Arduino was directly feed from the DRVN output of the TPL, in order to power it off completely in case of DONE. In our case, the DONE/DRVN are mapped on pins A1 and A2 (and not RAW), so my idea was to deal with it with some LowPower library and interrupts

I share my current work, maybe it can help... or correct me if I am totally wrong ;) https://bitbucket.org/jocelynduc/lora-mini-node/src/master/lora-mini-node.ino

With a #define switch, I can choose:

crox-net commented 4 years ago

Thanks for sharing!

I've put what I have here: crox-net/mini-lora-examples

My understanding is indeed that in this design the TPL5110 will not cut power to the MCU, but just "wake" it using a pin change interrupt on A2 (aka pin 16, PCINT10).

crox-net commented 4 years ago

Getting there :-) I've just published a new sketch (ttn-otaa-bme280-tpl5110) at the link above.

Rock-N-RollaMann commented 4 years ago

Hey, one reason your device may not be connecting is because of a bug in the new updated "LMIC Library". It was happening with me with my device although I am using a feather m0 from adafruit. I just downgraded to a lower version of the library. I was pulling my hair for like 4 days trying to figure out why my device wasn't working anymore. Hope this helps!