Hello everyone, after checking the forum and weeks fo work trying to solve the issue I have decided to create a post to see if someone can give me a hand with this issue.
I am trying to use a nanogateway together with an end-device both hardwares are lopy4 433MHz
this is the error that the command window shows:
level=error msg=“uplink: processing uplink frame error” ctx_id=19a888c2-ceb3-4edb-9a3a-03fdc8ccbdfd error="run uplink response flow error: set downlink tx-info data-rate error: get data-rate error: lorawan/band: invalid data-rate"
I have checked the forum trying to find a solution that is valid to my specific case but none of the solutions made it work.
Will post some of the configuration of my server together with the code I am using on the end device:
Sorry for the quality but due to be a new member cannot post more than 1 image per post so I merged the configuration in a single image. (probably you will need to open the image in a new tab in order to read it )
I am using abp mode to connect the end device, in the next step I will share the code I am using
End Device Code + Packet
“”" ABP Node example compatible with the LoPy Nano Gateway “”"
from network import LoRa
import socket
import ubinascii
import struct
import time
import config
import machine
lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU433, device_class = LoRa.CLASS_C )
lora.init(
mode=LoRa.LORAWAN,
region=LoRa.EU433,
frequency=433375000,
sf=7,
bandwidth=LoRa.BW_125KHZ
)
#LORA_FREQUENCY = 433175000
# create an ABP authentication params
dev_addr = struct.unpack(">l", ubinascii.unhexlify('01de6677'))[0]
nwk_swkey = ubinascii.unhexlify('48fe21bb4a23d10c0eed2855c2c0f3e4')
app_swkey = ubinascii.unhexlify('361a74940c2f756b70d143119881ed2f')
# remove all the non-default channels
# 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, config.LORA_NODE_DR)
# make the socket non-blocking
s.setblocking(False)
for i in range(3, 16):
lora.remove_channel(i)
# set the 3 default channels to the same frequency
lora.add_channel(0, frequency=433175000, dr_min=0, dr_max=5)
lora.add_channel(1, frequency=433375000, dr_min=0, dr_max=5)
lora.add_channel(2, frequency=433575000, dr_min=0, dr_max=5)
# join a network using ABP (Activation By Personalization)
lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey), timeout=0, dr=5)
time.sleep(5.0)
for i in range (200):
pkt = 'c0 9b dc fb 32 6b 68 '
print('Sending:', pkt)
s.send(pkt)
time.sleep(4)
rx, port = s.recvfrom(256)
if rx:
print('Received: {}, on port: {}'.format(rx, port))
time.sleep(6)
I am using the docker-compose-master that is located in brocaar repo on github.
I have been dealing with this issue for a month today, so I finally decided to write a post and ask for help since I could not figure out how to solve the problem I am facing.
Thanks for your help.