Lora Simple RX/TX WL55 problem #13184
Unanswered
alirezadh2
asked this question in
STM32 / Pyboard
Replies: 3 comments 8 replies
-
Try to re-edit your post using code tags. Start with 3 back-ticks py, line feed, your code, line feed and finish with 3 back ticks. Have you had the Simple RX/TX example working? Your sender method doesn't have any delays in it. |
Beta Was this translation helpful? Give feedback.
3 replies
-
I remove modem.calibrate() and also add delay on sending still not working: #Send:
from machine import Pin, SPI
import time
import pyb
import lora
import micropython
micropython.alloc_emergency_exception_buf(256)
def get_sync_modem():
from lora import WL55SubGhzModem
lora_cfg = { 'freq_khz': 868000 }
return WL55SubGhzModem(lora_cfg=lora_cfg)
def main_task():
counter=0
modem = get_sync_modem()
while True:
print("Sending...")
modem.send(f"Hello from AEMICS #{counter}".encode(),tx_at_ms=None)
time.sleep_ms(1000)
print("Sent!")
pyb.LED(1).toggle()
if __name__ == "__main__":
main_task()
#Receive:
from machine import Pin, SPI
import time
import pyb
import lora
import micropython
micropython.alloc_emergency_exception_buf(256)
def get_sync_modem():
from lora import WL55SubGhzModem
lora_cfg = { 'freq_khz': 868000 }
return WL55SubGhzModem(lora_cfg)
def main_task():
modem = get_sync_modem()
modem.rx_crc_error = True
while True:
print("Receiving...")
rx = modem.recv(timeout_ms=5000, rx_length=0xFF, rx_packet=None)
if rx:
print(f"Received: {repr(rx)}")
else:
print("Receive timeout!")
pyb.LED(1).toggle()
if __name__ == "__main__":
main_task() |
Beta Was this translation helpful? Give feedback.
0 replies
-
The Simple RX/TX example I was following uses: modem = get_modem() On 2nd thought maybe it is smart enough to work out which modem you have installed. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I used two Nucleo_WL55 boards and python code for simple lora communication and it does not working ( time out):
Send:
from umachine import Pin, SPI
import time
import pyb
import lora
import micropython
micropython.alloc_emergency_exception_buf(256)
def get_sync_modem():
from lora import WL55SubGhzModem
lora_cfg = { 'freq_khz': 868000 }
return WL55SubGhzModem(lora_cfg=lora_cfg)
def main_task():
counter=0
modem = get_sync_modem()
modem.calibrate()
while True:
print("Sending...")
modem.send(f"Hello from AEMICS #{counter}".encode(),tx_at_ms=None)
print("Sent!")
pyb.LED(1).toggle()
if name == "main":
main_task()
Receive:
from umachine import Pin, SPI
import time
import pyb
import lora
import micropython
micropython.alloc_emergency_exception_buf(256)
def get_sync_modem():
def main_task():
if name == "main":
main_task()
I got this errors:
Receiving...
_radio_isr
RX flags 0x200
Receive timeout!
Beta Was this translation helpful? Give feedback.
All reactions