Skip to content

Loko ground station Lora radio timeout issue in UART #19

@Alvenvain

Description

@Alvenvain

Looking at the serial communication between ESP32 and Lora E5, noticed that I got timeouts on the serial communication from the Lora radio

Issue is that there is no CR LF sent on the initiation of the radio, causing the buffer to fill up instead
Added CR LF after each command sent and Radio respond correctly

def lora_set(freq_hz):
    # Convert Hz to MHz for LoRa module
    freq_mhz = freq_hz // 1000000

    LORA_UART.write("AT+MODE=TEST\r\n")
    sleep_ms(1000)
    print('Lora Resp:', LORA_UART.read())
    LORA_UART.write(
        "AT+TEST=RFCFG,{},SF12,125,12,15,14,ON,OFF,OFF\r\n".format(freq_mhz))
    sleep_ms(1000)
    print('Lora Resp:', LORA_UART.read())
def lora_data_receive():
    LORA_UART.write('AT+TEST=RXLRPKT\r\n')
    sleep_ms(500)
    print('Lora RX:', LORA_UART.read())

Debug after change

Lora Resp: b'+MODE: TEST\r\n'
Lora Resp: b'+TEST: RFCFG F:915000000, SF12, BW125K, TXPR:12, RXPR:15, POW:14dBm, CRC:ON, IQ:OFF, NET:OFF\r\n'
Lora RX: b'+TEST: RXLRPKT\r\n'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions