uart respode from Lora611

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
srbpavel
Posts: 7
Joined: Tue Jan 19, 2021 5:09 pm

uart respode from Lora611

Post by srbpavel » Tue Jan 19, 2021 5:36 pm

hi, please i am starting to learn with my lora device, but i have a got problem receiving replay for AT commands

Code: Select all

from machine import UART
lora=UART(1, 9600)
lora.init(tx=19, rx=23) #pins are ok, as already tested with my gps device
lora
UART(1, baudrate=9600, bits=8, parity=None, stop=1, tx=19, rx=23, rts=-1, cts=-1, txbuf=256, rxbuf=256, timeout=0, timeout_char=1)
lora.write('AAFAAA') # should return module name and version as mention in datasheet
#or 
lora.write(b'\xaa\xaf\xaa') 
lora.read() # nothing to read also lora.any() is 0
the module led blinks, as mentioned in manual. probably i am sending wrong syntax as i believe it will be more complicated. there is so many info about lora, different AT commands for various devices but did not succeed to move further

please advice additional resources to study

https://www.nicerf.com/product_149_67.html
NiceRF Lora611AES-100mW

thanks, pav

User avatar
Roberthh
Posts: 2454
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: uart respode from Lora611

Post by Roberthh » Tue Jan 19, 2021 7:27 pm

uart.read() does not wait for data to arrive. You have to wait a little bit, until data is present. uart-any() tells you, how much is available to read,
You did not mention which board you are using, but it looks like a ESP32 one.

srbpavel
Posts: 7
Joined: Tue Jan 19, 2021 5:09 pm

Re: uart respode from Lora611

Post by srbpavel » Wed Jan 20, 2021 8:07 am

thank you, got the results now. i did a few mistakes

a: first, i have wrongly understand manual, so for AT commands to work the module SET pin needs to be put LOW

b: as you mention, uart.read() does not wait, so for my test purpose i create infinite loop and grab the results

thank you again, pavel

srbpavel
Posts: 7
Joined: Tue Jan 19, 2021 5:09 pm

Re: uart respode from Lora611

Post by srbpavel » Wed Jan 20, 2021 8:15 am

forgot to mention - yes i have got esp32 mh et live / 40pin

https://doc.riot-os.org/group__boards__ ... nikit.html

Post Reply