Author Topic: LMIC-library and Moteino Mega  (Read 12941 times)

everhamme

  • Newbie
  • *
  • Posts: 2
Re: LMIC-library and Moteino Mega
« Reply #45 on: February 14, 2019, 05:43:10 PM »
Note:  I got LMIC working with Moteino Mega..

0. solder bridges for DIO1, DIO2, and RST
1. use LMIC library from here https://github.com/matthijskooijman/arduino-lmic
2. open src/lmic/config.h and set correct configuration (US915 for me)..  i also set
3. for ABP example set your keys..   use this pinmap

Code: [Select]
const lmic_pinmap lmic_pins = {
    .nss = 4,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 3,
    .dio = {2, 22, 21},
};

4.  for OTAA example set your keys (make sure to REVERSE order for APPEUI and DEVEUI)
5. for OTAA also after the LMIC_reset();  add these lines

Code: [Select]
  LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);
  LMIC_selectSubBand(1);
  LMIC.dn2Dr = DR_SF9;
  LMIC_setLinkCheckMode(0);
  LMIC_setDrTxpow(DR_SF7,14);
« Last Edit: February 14, 2019, 09:40:24 PM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6023
  • Country: us
    • LowPowerLab
Re: LMIC-library and Moteino Mega
« Reply #46 on: February 14, 2019, 09:41:33 PM »
everhamme,
Great, thanks for sharing that!

So no other hardware needed? Like the EUI64 chip for MACID?
Someone else was suggesting the FLASH-MEM (which incidentally also has a hardcoded 64bit ID) could be used the same way.

everhamme

  • Newbie
  • *
  • Posts: 2
Re: LMIC-library and Moteino Mega
« Reply #47 on: February 15, 2019, 01:07:31 PM »
everhamme,
Great, thanks for sharing that!

So no other hardware needed? Like the EUI64 chip for MACID?
Someone else was suggesting the FLASH-MEM (which incidentally also has a hardcoded 64bit ID) could be used the same way.

Not needed unless you want to programatically use the built in chip to reference/store  keys to allow for faster joining or if you're rolling out a product that uses hard-wired keys......  The LoRaWAN 1.1 spec does require that NSK and ASK keys get stored so if you restart/power down the device you don't need to initiate another OTAA join, which consumes resources and needs more bandwidth. But this isn't enforced yet.. so you can initiate as many OTAA joins as you'd like.     

I do like the implementation of this "provisioning" feature that MCCI uses on their LoRa devices ...https://github.com/mcci-catena/Catena-Sketches/tree/master/catena4450m101_sensor#lorawan-provisioning.  You don't need to compile and upload custom keys.. you can just use a terminal window to copy/paste keys.

MCCI takes their products a little further down the firmware/library side to ensure easy implementation for folks. 
« Last Edit: February 15, 2019, 01:18:27 PM by everhamme »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6023
  • Country: us
    • LowPowerLab
Re: LMIC-library and Moteino Mega
« Reply #48 on: February 15, 2019, 01:18:00 PM »
Thank you for these extra details, I appreciate it.