I want to connect my Raspberry pico to my DWM1001-dev via UART in order to get localization information. I successfully flashed all 4 of my DWMs using the user guide and I can see them in the Android app.
So far I connected the DWM TX to GP5 and the DWM RX to GP4. I also connected the ground pins together. I powered up my DWM with an external battery.
Then I used an USB cable to connect my Raspberry to my computer and I wrote a short code to help me visualize the data in the Thonny IDE:
import utime
import machine
UART_USED = 1
BAUDRATE = 115200
TX_PIN = machine.Pin(4)
RX_PIN = machine.Pin(5)
uart = machine.UART(UART_USED,
baudrate=BAUDRATE,
tx=TX_PIN,
rx=RX_PIN
)
print(uart)
while True:
if uart.any():
data = uart.read(10)
print(“Received data:”, data)
else:
print(“NO MESSAGE”)
utime.sleep(1)
I always get “NO MESSAGE” because uart.any() returns False. I am new to all this stuff and I wanted to make something very simple. I don’t know where I messed up.
Thank you in advance for your help.