OTAA does not join for US config. using last firmware
-
I changed frequencies as recommended.
Changed dr_max=4 instead of 5
Changed socket.SO_DR, 3
But funciton lora.has_joined(): always send falseWith abp works without problem. Do you see an error in my code. I read all the post about OTAA and nothing. Somebody from pycom engineering.
Best regards,
from network import LoRa import socket import binascii import struct import time # Initialize LoRa in LORAWAN mode. lora = LoRa(mode=LoRa.LORAWAN) # create an OTA authentication params dev_eui = binascii.unhexlify('70 B3 D5 49 9E A9 24 C0'.replace(' ','')) app_eui = binascii.unhexlify('70 B3 D5 7E F0 00 5A 3F'.replace(' ','')) app_key = binascii.unhexlify('36 AB 76 25 FE 77 77 68 81 68 3B 49 53 00 FF D6'.replace(' ','')) # remove channels for channel in range(0, 72): lora.remove_channel(channel) # set the default channel to the same frequency (must be before sending the OTAA join request) lora.add_channel(0, frequency=903900000, dr_min=0, dr_max=4) # join a network using OTAA lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0) # wait until the module has joined the network while not lora.has_joined(): time.sleep(2.5) print('Not joined yet...') # create a LoRa socket s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) # set the LoRaWAN data rate s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3) # make the socket blocking s.setblocking(False) time.sleep(5.0) for i in range (200): s.send(b'PKT #' + bytes([i])) time.sleep(4) rx = s.recv(256) if rx: print(rx) time.sleep(6) -
@blackansible
What are you using as your LoRaWAN gateway? -
@jmarcelino Lopy gateway
-
@blackansible
Try this modification in your nanogateway.py code:
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login