T
@peterp Is this beta release still active?
I thought I would attempt to use it and contribute back with my experience.
I tried with xome lora code that has previously worked but I now get Errorno. 122 EMSGIZE problems on a message that is less than 12bytes!!!!!!
Here is an extract from the output log from my code as well as an extract of the code around where the error is being reported. Previously this line of code has successfully sent data via TTN.
2020/12/07 18:44:06: HW init done
init NV vars
init lora
RegionAU915ComputeRxWindowParameters
DR: 10, BW: 2
tSymbol: 2.048000
RegionAU915ComputeRxWindowParameters
DR: 8, BW: 2
tSymbol: 8.192000
2020/12/07 18:44:09: Trying to join TTN Network!
2020/12/07 18:44:12: Trying to join TTN Network!
2020/12/07 18:44:14: Trying to join TTN Network!
LoRa network joined!!!!!
2020/12/07 18:44:16: lora parameters appear to have saved successfully
date/time = 20 12 3 9 27
sending LoRa data
RegionAU915ComputeRxWindowParameters
DR: 13, BW: 2
tSymbol: 0.256000
RegionAU915ComputeRxWindowParameters
DR: 8, BW: 2
tSymbol: 8.192000
Traceback (most recent call last):
File "main.py", line 90, in <module>
File "DipBoot.py", line 31, in BootMain
File "DipApp.py", line 906, in AppMain
File "DipApp.py", line 714, in CommsCheck
OSError: [Errno 122] EMSGSIZE
2020/12/07 18:44:18: Pycom MicroPython 1.20.3.b0 [v1.11-db33be7] on 2020-07-01; FiPy with ESP32
Type "help()" for more information.
>>>
Here is the code snipet.
# create a LoRa socket
LoRaSock = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
# set the LoRaWAN data rate
LoRaSock.setsockopt(socket.SOL_LORA, socket.SO_DR, 5)
# make the socket blocking
# (waits for the data to be sent and for the 2 receive windows to expire)
# this should take about 2 seconds.
LoRaSock.setblocking(True)
# IF THERE IS SOMETHING WRONG WITH THE SETUP WE WILL PROBABLY HANG IN HERE.
# send some data
# Cayenne, LPP style data format
# channel 1 = level data, analogue input, 2 bytes
# channel 2 = battery, analogue input, 2 bytes
print('sending LoRa data')
LoRaSock.send(bytes([0x01, 0x02])+pack('>h',nvvar['Level']&0xffff)+bytes([0x02, 0x02])+pack('>h',nvvar['Batt']&0xffff))
# make the socket non-blocking
# (because if there's no data received it will block forever...)
LoRaSock.setblocking(False)
# get any data received (if any...)
LoRaRxdata = LoRaSock.recv(64)
print("data received = ", LoRaRxdata)
lora.nvram_save()
LoRaSock.close()
The error message ocurs on the LoRaSock.send line.
Any suggestions????
Peter.