I currently have a RAK3172 module with the following connections to a raspberry pi pico, via the RAK3272S Ver B board:
- 3v3 - 3v3
- GND - GND
- UART2_TX - GP0
- UART2_RX - GP1
I am using the following micropython code and the Thonny IDE, to attempt to configure the RAK3172 to make a connection to an application on the things network:
uart = UART(0, 115200) # use RPI PICO GP0 and GP1
# Use lines below to display the firmware version and config settings
# uart.write('at+version\r\n')
# uart.write('at+get_config=lora:status\r\n')
# data = uart.read()
# if data:
# decoded_data = data.decode('utf-8')
# print("Check Config:" + decoded_data)
## Setup the wireless module OTAA, Class, Region, keys##
uart.write("at+set_config=lora:join_mode:1\r\n")
decoded_data = ""
print("set to OTAA")
while decoded_data != "OK\r\n":
data = uart.read()
if data:
decoded_data = data.decode("utf-8")
print("OTAA done!\r\n" + decoded_data)
decoded_data = ""
uart.write("at+set_config=lora:class:0\r\n")
print("set to Class A")
while decoded_data != "OK\r\n":
data = uart.read()
if data:
decoded_data = data.decode("utf-8")
print("Class A done!\r\n" + decoded_data)
decoded_data = ""
uart.write("at+set_config=lora:region:EU868\r\n")
print("set to EU868 region")
while decoded_data != "OK\r\n":
data = uart.read()
if data:
decoded_data = data.decode("utf-8")
print("EU868 done!\r\n" + decoded_data)
decoded_data = ""
uart.write("at+set_config=lora:dev_eui:" + DevEUI + "\r\n")
print("set to DEVEUI")
while decoded_data != "OK\r\n":
data = uart.read()
if data:
decoded_data = data.decode("utf-8")
print("DEVUI done!\r\n" + decoded_data)
decoded_data = ""
uart.write("at+set_config=lora:app_eui:" + AppEUI + "\r\n")
print("set to APPEUI")
while decoded_data != "OK\r\n":
data = uart.read()
if data:
decoded_data = data.decode("utf-8")
print("APPEUI done!\r\n" + decoded_data)
decoded_data = ""
uart.write("at+set_config=lora:app_key:" + AppKey + "\r\n")
print("set to APPKEY")
while decoded_data != "OK\r\n":
data = uart.read()
if data:
decoded_data = data.decode("utf-8")
print("APPKEY done!\r\n" + decoded_data)
## END OF SETTING UP ##
However the code is not working and gives the following output:
set to OTAA
OTAA done!
at+set_config=lora:join_mode:1
Any assistance in resolving this issue would be greatly appreciated