RAK2245 Pi Hat, TTN, no downlink traffic sent?

Hi!
I have a RAK2245 Pi Hat, running on a RasPi 3B with current Raspbian (tested both with latest image as well as with clean Raspbian & rak_common_for_gateway).

The gateway is configured with TTN. Receiving of packets and forwarding them to TTN works without any issue.

However, I have a problem with the downlink. On my test setup I have three devices:

  • the RAK2245 PiHat
  • a LoRa Class A device (based on RFM95 and ATmega328p)
  • a LoRa “sniffer” (based on TTGO LoRa32)

When my LoRa node (RFM95) sends a message, the message is received by the PiHat and forwarded to TTN. A downlink message then should be sent with RX1, but it actually is NOT sent from the PiHat.
When I run util_tx_test to send a package, I can see it on both my sniffer and my LoRa node:

/opt/ttn-gateway/lora_gateway/util_tx_test/util_tx_test -r 1257 -f 867.3 -m LORA -b 125 -s 8 -c 4 -l 8 -z 10 -x 1

However, the downlink message from TTN is not sent… :frowning:

This is some output from lora_pkt_fwd:

./start.sh
*** Beacon Packet Forwarder for Lora Gateway ***
Version: 4.0.1
*** Lora concentrator HAL library version info ***
Version: 5.0.1;
***
INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
lgw_board_setconf:427: Note: board configuration; lorawan_public:1, clksrc:1
INFO: no configuration for LBT
INFO: antenna_gain 0 dBi
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -166.000000, tx enabled 1, tx_notch_freq 0
lgw_rxrf_setconf:476: WARNING: NOT A VALID TX NOTCH FILTER FREQUENCY [126000..250000]Hz
lgw_rxrf_setconf:488: Note: rf_chain 0 configuration; en:1 freq:867500000 rssi_offset:-166.000000 radio_type:2 tx_enable:1 tx_notch_freq:0
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -166.000000, tx enabled 0, tx_notch_freq 0
lgw_rxrf_setconf:488: Note: rf_chain 1 configuration; en:1 freq:868500000 rssi_offset:-166.000000 radio_type:2 tx_enable:0 tx_notch_freq:0
INFO: Lora multi-SF channel 0>  radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 0 configuration; en:1 freq:-400000 SF_mask:0x7e
INFO: Lora multi-SF channel 1>  radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 1 configuration; en:1 freq:-200000 SF_mask:0x7e
INFO: Lora multi-SF channel 2>  radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 2 configuration; en:1 freq:0 SF_mask:0x7e
INFO: Lora multi-SF channel 3>  radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 3 configuration; en:1 freq:-400000 SF_mask:0x7e
INFO: Lora multi-SF channel 4>  radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 4 configuration; en:1 freq:-200000 SF_mask:0x7e
INFO: Lora multi-SF channel 5>  radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 5 configuration; en:1 freq:0 SF_mask:0x7e
INFO: Lora multi-SF channel 6>  radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 6 configuration; en:1 freq:200000 SF_mask:0x7e
INFO: Lora multi-SF channel 7>  radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
lgw_rxif_setconf:607: Note: LoRa 'multi' if_chain 7 configuration; en:1 freq:400000 SF_mask:0x7e
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
lgw_rxif_setconf:581: Note: LoRa 'std' if_chain 8 configuration; en:1 freq:-200000 bw:2 dr:2
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
lgw_rxif_setconf:637: Note: FSK if_chain 9 configuration; en:1 freq:300000 bw:3 dr:50000 (50000 real dr) sync:0xC194C1
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to DCA632FFFE0AFB72
INFO: server hostname or IP address is configured to "router.eu.thethings.network"
INFO: upstream port is configured to "1700"
INFO: downstream port is configured to "1700"
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: Reference latitude is configured to 49.XXXXXX deg
INFO: Reference longitude is configured to 10.XXXXXX deg
INFO: Reference altitude is configured to 299 meters
INFO: fake GPS is enabled
INFO: Auto-quit after 20 non-acknowledged PULL_DATA
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to DCA632FFFE0AFB72
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
lgw_start:823: Note: calibration started (time: 2300 ms)
lgw_start:844: Note: calibration finished (status = 183)
WARNING: problem in calibration of radio A for image rejection
Info: Initialising AGC firmware...
Info: putting back original RADIO_SELECT value
INFO: [main] concentrator started, packet can now be received
INFO: Disabling GPS mode for concentrator's counter...
INFO: host/sx1301 time offset=(1578603135s:533906µs) - drift=790790994µs
INFO: Enabling GPS mode for concentrator's counter.
INFO: [down] PULL_ACK received in 47 ms
INFO: [down] PULL_ACK received in 44 ms
INFO: [down] PULL_ACK received in 44 ms
##### 2020-01-09 20:52:48 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 0
# CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 0 (0 bytes)
# PUSH_DATA datagrams sent: 0 (0 bytes)
# PUSH_DATA acknowledged: 0.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 3 (100.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
# BEACON queued: 0
# BEACON sent so far: 0
# BEACON rejected: 0
### [JIT] ###
# SX1301 time (PPS): 2562696
src/jitqueue.c:448:jit_print_queue(): INFO: [jit] queue is empty
### [GPS] ###
# GPS *FAKE* coordinates: latitude 49.XXXXXX, longitude 10.XXXXX, altitude 299 m
##### END #####
JSON up: {"stat":{"time":"2020-01-09 20:52:48 GMT","lati":49.XXXXXX,"long":10.XXXXX,"alti":299,"rxnb":0,"rxok":0,"rxfw":0,"ackr":0.0,"dwnb":0,"txnb":0}}
INFO: [up] PUSH_ACK received in 44 ms
INFO: [down] PULL_ACK received in 46 ms
INFO: [down] PULL_ACK received in 44 ms
INFO: [down] PULL_ACK received in 43 ms
lgw_receive:1155: FIFO content: 1 10 0 5 1c
lgw_receive:1174: [4 17]
Note: LoRa packet
INFO: Received pkt from mote: 2601110B (fcnt=0)
JSON up: {"rxpk":[{"tmst":56214804,"chan":4,"rfch":0,"freq":867.300000,"stat":1,"modu":"LORA","datr":"SF8BW125","codr":"4/5","lsnr":11.8,"rssi":-42,"size":28,"data":"QAsRASYAAAABVdGCoUCtlQr8JMBGiKzmziMIKw=="}]}
INFO: [up] PUSH_ACK received in 44 ms
INFO: [down] PULL_RESP received  - token[234:114] :)
JSON down: {"txpk":{"imme":false,"tmst":57214804,"freq":867.3,"rfch":0,"powe":14,"modu":"LORA","datr":"SF8BW125","codr":"4/5","ipol":true,"size":15,"ncrc":true,"data":"YAsRASYAJgAB1Kl+nFRf"}}
src/jitqueue.c:140:jit_enqueue(): Current concentrator time is 56493146, pkt_type=0
src/jitqueue.c:117:jit_sort_queue(): sorting queue in ascending order packet timestamp - queue size:1
src/jitqueue.c:119:jit_sort_queue(): sorting queue done - swapped:0
src/jitqueue.c:452:jit_print_queue(): INFO: [jit] queue contains 1 packets:
src/jitqueue.c:453:jit_print_queue(): INFO: [jit] queue contains 0 beacons:
src/jitqueue.c:459:jit_print_queue():  - node[0]: count_us=57214804 - type=0
src/jitqueue.c:318:jit_enqueue(): enqueued packet with count_us=57214804 (size=15 bytes, toa=92000 us, type=0)
src/jitqueue.c:433:jit_peek(): peek packet with count_us=57214804 at index 0
src/jitqueue.c:448:jit_print_queue(): INFO: [jit] queue is empty
src/jitqueue.c:362:jit_dequeue(): dequeued packet with count_us=57214804 from index 0
INFO: tx_start_delay=1495 (1495.500000) - (1497, bw_delay=1.500000, notch_delay=0.000000)
Info: packet will be sent without CRC
INFO: Enabling TX notch filter
58.d3.33.3.69.1.7d.9.0.18.f.10.0.8.0.0.60.b.11.1.26.0.26.0.1.d4.a9.7e.9c.54.5f.end
src/lora_pkt_fwd.c:2643:thread_jit(): lgw_send done: count_us=57214804
INFO: Disabling GPS mode for concentrator's counter...
##### 2020-01-09 20:53:18 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 1
# CRC_OK: 100.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 1 (28 bytes)
# PUSH_DATA datagrams sent: 2 (367 bytes)
# PUSH_DATA acknowledged: 100.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 3 (100.00% acknowledged)
# PULL_RESP(onse) datagrams received: 1 (184 bytes)
# RF packets sent to concentrator: 1 (15 bytes)
# TX errors: 0
# TX rejected (collision packet): 0.00% (req:1, rej:0)
# TX rejected (collision beacon): 0.00% (req:1, rej:0)
# TX rejected (too late): 0.00% (req:1, rej:0)
# TX rejected (too early): 0.00% (req:1, rej:0)
# BEACON queued: 0
# BEACON sent so far: 0
# BEACON rejected: 0
### [JIT] ###
# SX1301 time (PPS): 62563557
src/jitqueue.c:448:jit_print_queue(): INFO: [jit] queue is empty
### [GPS] ###
# GPS *FAKE* coordinates: latitude 49.XXXXX, longitude 10.XXXXX, altitude 299 m
##### END #####
INFO: host/sx1301 time offset=(1578603135s:533411µs) - drift=-495µs
INFO: Enabling GPS mode for concentrator's counter.
JSON up: {"stat":{"time":"2020-01-09 20:53:18 GMT","lati":49.XXXXX,"long":10.XXXXX,"alti":299,"rxnb":1,"rxok":1,"rxfw":1,"ackr":100.0,"dwnb":1,"txnb":1}}
INFO: [up] PUSH_ACK received in 43 ms
INFO: [down] PULL_ACK received in 43 ms
[...]

In the TTN Gateway console, I see both the received (uplink) packet as well as the downlink package to be sent. The “Event Data” of the downlink packet is:

{
  "gw_id": "eui-dca632fffe0afb72",
  "payload": "YAsRASYAJgAB1Kl+nFRf",
  "f_cnt": 38,
  "lora": {
    "spreading_factor": 8,
    "bandwidth": 125,
    "air_time": 92672000
  },
  "coding_rate": "4/5",
  "timestamp": "2020-01-09T20:53:12.008Z",
  "dev_addr": "2601110B",
  "frequency": 867300000
}

TX basically works (tested with util_tx_test). It even looks like lora_pkt_fwd sends the downlink message (src/lora_pkt_fwd.c:2643:thread_jit(): lgw_send done). But there’s nothing on the air…

What else can I do for tracing down the reason? Did I miss something?

(GPS is temporarily disabled as I have no GPS signal on my desk; antenna is connected though)

Thanks for any hint!

As you can see from your log, the gateway does reply to the node with a downlink message, but you describe not seeing it from TTN. You need to make sure that you are properly configured in TTN and can receive the downlink message at other times.

I do see the downlink message in the TTN console, but it is not sent by the RAK2245 gateway.

For me the log looks like the gateway sends the message, but it isn’t received by any device (I have two independend LoRa “receivers” with different software stacks running for this test). All devices are only few meters apart.

Are there any other gateways connected to EUI of your gateway in TTN? Maybe you can take a screenshot and give me a picture of the TTN interface.:grinning:

Can you replace the server with the built-in chirpstack and try again?

Thank you for your hints so far.
It looks like a local problem on my Class A node.

I did another test with a plain LMIC-based code on a LoRa32 and received downlink packets through the RAK2245 gateway without any issues.

I’ll investigate this the next days and will do a final posting once I found out the reasons for not receiving downlink data in my initial test setup.

@klk any update on this issue? I am facing this problem now.

Hi. Please give us more information, so we can help you better. Hardware (Gateway, Nodes), Setup, Region etc…

I am in US region.

I have a Lora node build of LMIC library & Arduiono Pro-mini.

I am using BasicStation Gateway from https://github.com/lorabasics/basicstation.git. I am using RasPi3 and RAK2245 in my gateway.

My Lora node is sending the JREQ and the Gateway is receiving it 100%. Gateway is sending JACC and as an indication, Gateway is sending a message to my network server. This message is sent once the JACC message is transmitted completely.

However my Lora node is NOT receiving this JACC message. Questions are …

  1. Is the preamble used by the Gateway same as preamble expected by Lora Node (0x34)?
  2. JACC is being send at 923.3 MHz. Do I need to set my Gateway transmitter to that frequency as a part of my setting, in the station.conf file?

I tried the below command to generate a continuous stream of packets for my LoraNode to receive

%>util_tx_continuous -f 923 -r 1257 --dig 0 --mix 8 --pa 0 --mod LORA --sf 7 --bw 500

and saw

lgw_setup_sx125x:426: ERROR: UNEXPECTED VALUE 0 FOR RADIO TYPE

Looks like the Gateway is continuously sending the packets (TX LED is active). My Lora node (Node A) is NOT receiving any of these test packets from Gateway in any of the RX windows.

Any help is appreciated.