Hi,
I have a Lopy with Pysense 2.x and I’m trying to connect to TTN. However, I only get the “Accept join-request” in the Live Data tab of TTN Console of my end device.
Here is the code I’ve been using so far:
pycom.heartbeat(False)
pycom.rgbled(0x111100) # Yellow
lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868)
app_eui = ubinascii.unhexlify('1EA96CDF138F07DF')
app_key = ubinascii.unhexlify('4C8EB51FF05C97D8FA49C2C1465AA30F')
print('Joinning')
lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
for wait_time in [2,4,6,8,10,12,14]:
if not lora.has_joined():
time.sleep(2)
print("Waited {}s".format(wait_time))
if not lora.has_joined():
pycom.rgbled(0x110000) # Red
print("Can't join")
else:
pycom.rgbled(0x001100) # Green
print('Joinned !')
It never reach the join part:
Joinning
Waited 2s
Waited 4s
Waited 6s
Waited 8s
Waited 10s
Waited 12s
Waited 14s
Can't join
The DevEUI
is correct, I got it from binascii.hexlify(lora.mac()
. I’ve also tried by using a generated one from TTN and using it in my code with no success as well.
I’ve also tried using a zero-filled AppEUI
with no luck.
My AppKey
is correct as well.
I’m in Europe, France and I’ve created my end device with thoses settings:
- Frequency plan: Europe 863-870Mhz (SF9 for RX2 - recommended)
- LoRaWAN version: MAC V1.0.2 as specified here
- Regional Parameters version: PHY 1.0.2 REV A (as specified in the same document above)
I can’t figure what’s not working, since there is no error or message to look for.