LoPy with TTN Nano Gateway and Arduino (and RFM95) with LMIC lib
-
I'm trying to connect an Adafruit Feather M0 with RFM95 as node via a LoPy as nano gateway to the TTN. What I did till now and what is working:
LoPy as TTN Nano Gateway
I updated my LoPy to the latest firmware version and installed the nano gateway software along this tutorial.
In config.py I used this (default) LoRa settings
# for EU868 LORA_FREQUENCY = 868100000 LORA_GW_DR = "SF7BW125" # DR_5 LORA_NODE_DR = 5
- the LoPy is showing up in the TTN console
- it receives packages, but unfortunately not the data from my node ;-) the incoming "foreign" packages are specified in the TTN console as, so this seems to be a working setup:
-- frequency: 868.1
-- mod: lora
-- CR: 4/5
-- data rate: SF7 BW125 - so I assume the gateway is working but not in combination with my node! :-(
Arduino / Adafruit Feather M0 with RFM95
I installed the Arduino-LMIC library from Matthijs Kooijman following this tutorial mostly, and with the help of some threads here [1] [2]. For details see https://community.hiveeyes.org/t/testing-adafruit-feather-m0-lora-rfm95-and-ttn/528
After installation I could send data to a public TTN gateway ("full" TTN Gateway, not a single channel) with a range of 1 km!
Addaption Nano Gateway
For working with the Nano Gateway I had to reduce the available channels in the LMIC code. I used the ttn-abp.ino example and commented all frequency lines out exept one:
LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // specify only the single (!) channel matching with the LoPy nano gateway! // uncomment all other // LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI); // LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // [...] // LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK), BAND_MILLI);
following this advice. https://forum.pycom.io/topic/1635/lorawan-gateway-using-lopy-and-sx1276-node/2
So I think I have done all necessary steps but the data of the Arduino/Feather/LMIC device is not showing up at TTN.
I have in both configuration files a frequency of 868.1 MHz. I wonder hwo can I check or change the other parameters like CR: 4/5 or data rate: SF7 BW125 to match or did I oversee an other point I have to adapt?
-
In addition a nice explanation from Andreas Spiess
-
I think I have found the solution after some research on the TTN board:
https://www.thethingsnetwork.org/forum/t/can-lmic-1-6-be-set-up-to-use-a-single-channel-and-sf/5207/11Beside uncommenting the non fitting channels you have to
- disable the (other) default channels and
- announce a fix spreading factor matching that on the LoPy / nano gateway
Now it is working! Great!