B
I know this is an old post, but I have similar issues and after some debugging this is what I found:
The nanogateway gets the join request from the node using OTAA and it forwards it to TTN.
TTN sees the join requests and replies back to the gateway:
Adding some debugging I can display the data received from TTN and sent to the node using the _send_down_link function:
def _send_down_link(self, data, tmst, datarate, frequency):
self.lora.init(mode=LoRa.LORA, frequency=frequency, bandwidth=LoRa.BW_125KHZ,
sf=self._dr_to_sf(datarate), preamble=8, coding_rate=LoRa.CODING_4_5,
tx_iq=True)
while time.ticks_us() < tmst:
pass
print(binascii.hexlify(data).upper())
self.lora_sock.send(data)
Decoding the returned data shows that TTN is accepting the node to join:
https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/?data=20B6330995FA5AD1601C019F596C711FE11FF096E1C4915F94F183BEA903746F23
Assuming hex-encoded packet
20B6330995FA5AD1601C019F596C711FE11FF096E1C4915F94F183BEA903746F23
Message Type = Join Accept
AppNonce = 0933B6
NetID = 5AFA95
DevAddr = 011C60D1
MIC = 03746F23
However, the node keeps trying and is unable to join or takes several attempts until it is successful.
I hope this helps solving this issue...