Not able to get downlink from console to node


I have set up a gateway using RAK module and created my own node using RMF95 module and an arduino board. I am able to transmit messages from node to gateway and view the data. However, I am not able to see any downlink messages. Just to confirm if I am doing it right, in the console page, under “Downlink” tab, I am adding a byte “FE”, click on “Confirmed” checkbox and click send. It says “Downlink message enqueued”. However, on the arduino serial monitor, it does not show any messages received.

I have added a screenshot of TTN console, arduino serial monitor. On the coding side, using LMIC as shown below. I have added only the setup function since all others are the same from LMIC library. Kindly check and help me get a downlink message.


void setup() {
  while (!Serial); // wait for Serial to be initialized
  delay(100);     // per sample code on inlora module test

  // For Pinoccio Scout boards
  digitalWrite(VCC_ENABLE, HIGH);

  os_init();    // LMIC init
  LMIC_reset(); // Reset the MAC state. Session and pending data transfers will be discarded.
  // Let LMIC compensate for +/- 1% clock error
  LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);
  // Set static session parameters. Instead of dynamically establishing a session
  // by joining the network, precomputed session parameters are be provided.
#ifdef PROGMEM
  // On AVR, these values are stored in flash and only copied to RAM
  // once. Copy them to a temporary buffer here, LMIC_setSession will
  // copy them into a buffer of its own again.
  uint8_t appskey[sizeof(APPSKEY)];
  uint8_t nwkskey[sizeof(NWKSKEY)];
  memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));
  memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));
  LMIC_setSession (0x13, DEVADDR, nwkskey, appskey);
  // If not running an AVR with PROGMEM, just use the arrays directly
  LMIC_setSession (0x13, DEVADDR, NWKSKEY, APPSKEY);

#if defined(CFG_in866)    // three channels are set for india as per ttn guidelines
  LMIC_setupChannel(0, 865062500, DR_RANGE_MAP(DR_SF7, DR_SF12),  BAND_CENTI);      // g-band
  LMIC_setupChannel(1, 865402500, DR_RANGE_MAP(DR_SF7, DR_SF12),  BAND_CENTI);      // g-band
  LMIC_setupChannel(2, 865985000, DR_RANGE_MAP(DR_SF7, DR_SF12),  BAND_CENTI);      // g-band
  LMIC_setupChannel(3, 866550000, DR_RANGE_MAP(DR_SF10, DR_SF10),  BAND_CENTI);      // g-band

  LMIC_setLinkCheckMode(0);   // Disable link check validation
  LMIC.dn2Dr = DR_SF10;        // TTN uses SF10 for its RX2 window in India
  LMIC_setDrTxpow(DR_SF7, 14);// Set data rate and transmit power for uplink
  digitalWrite(8, HIGH);
  do_send(&sendjob);          // Start the job and send packets
  digitalWrite(8, LOW);

I have even tried commenting and uncommenting the below code, but of no use:

  LMIC_setupChannel(3, 866550000, DR_RANGE_MAP(DR_SF10, DR_SF10),  BAND_CENTI);

  LMIC_setLinkCheckMode(0);   // Disable link check validation
  LMIC.dn2Dr = DR_SF10;        // TTN uses SF10 for its RX2 window in India
  LMIC_setDrTxpow(DR_SF7, 14);// Set data rate and transmit power for uplink
  1. Please don’t send acknowledged downlinks. That will only result in the node sending another packet to acknowledge the data has been received.
  2. The gateway metadata is not shown and we are seeing just part of one uplink, so there is no way to check RSSI/SNR. However I suspect you might have the node too close to the gateway. In that case the gateway can receive the data at a channel different from what was used to transmit and as a result the reply will be sent at the wrong frequency. Keep at least 3 meters (9 feet) between the antennas.
    Check the gateway console page to see what frequency the packet is received and what frequency is used to transmit a reply.
  3. What code is in your LMIC implementation (there are a couple available) to receive data and show it?
  1. Ok. No checkbox now
  2. RSSI is -30.00 dBm and SNR is 9.00 db. They were next to each other and have moved them a little further (3 feet approx) after reading few tips on the forum. Moved it further to 9 feet, but same result. 865.4025 is the uplink frequency in the console. Not sure where to check downlink frequency.
  3. I have used library. Only change is that I added #define CFG_in866 to lmic_project_config.h file

Just to test, I changed the node to OTAA and sent a dowlink. Surprizingly, it is working even when node is placed right next to gateway. Not working on ABP. Any suggestions?

ok. I got this working. The only change I did was changed
LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);
LMIC_setClockError(MAX_CLOCK_ERROR * 5 / 100);

1 Like

LoRaWAN timing is very tight and AVRs are not very good at keeping time that exact. Relaxing the timing as you did is the way to fix that. Or move to a more capable controller (Atmel ARM controllers are almost the same price as Atmel AVR controllers.

1 Like

Thanks for the response and suggestion. Cheers :slight_smile: