I want to make the LoPy to be able to reliably send a large payload, the max of 242 bytes. Right now, I just want to get to sending 150 bytes, which I did multiple times this morning. However, after a reboot, it stopped letting me send messages > 100 bytes.
from network import LoRa import socket import binascii lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.US915, bandwidth=LoRa.BW_125KHZ, sf=7, adr=True) dev_addr = 0x00000000 nwk_skey = binascii.unhexlify("0000000000000000000000000000000000") app_skey = binascii.unhexlify("0000000000000000000000000000000000") for i in range(8, 72): lora.remove_channel(i) start = 903900000 f_inc = 200000 curr = start for i in range(8): print(curr) lora.add_channel(index=i, frequency=curr, dr_min=0, dr_max=4) curr += f_inc lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_skey, app_skey)) s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) big_buffer = bytes([0xFF] * 150) s.send(big_buffer)
What should the
sf be to achiever this? And should
adr be enabled? I’ve tried many combinations and can’t quite it right. Thanks.