Other Parts Discussed in Thread: IWR1642, IWRL6432, AWR1642
I have a IWRL6432Boost device which I've managed to use successfully for the Motion/Presence Demo, but now when I want to read the raw data transmitted over USB UART, I get nothing but empty dictionaries. The same code works perfectly for xWR1642Boost devices so I am unsure of what I am doing wrong here.
The code snippet I'm using is below, its very small.
---
# Package imports
from serial import Serial
import serial.tools.list_ports
import numpy as np
import time
## Change the configuration file name
configFileName = '6432config_pr.cfg'
com_uart = {}
com_data = {}
byteBuffer = np.zeros(2**15,dtype = 'uint8')
byteBufferLength = 0
# Serial configuration scheme
# Connect to the device via serial
def serialConfig(configFilename):
global com_uart
global com_data
# Windows configuration
com_uart = Serial("COM4", 115200) # 4 for 6432; 7 for 1642
com_data = Serial("COM5", 921600) # 5 for 6432; 6 for 1642
# Read in the configuration file and transmit to the device. Instead of hardcoding the config file to the device to allow for modification
config = [line.rstrip('\r\n') for line in open(configFileName)]
for i in config:
com_uart.write((i+'\n').encode())
print(i)
time.sleep(0.01)
print('\n')
return com_uart, com_data
# Configurate the serial port
com_uart, com_data = serialConfig(configFileName)
# Main loop
while True:
# Parser - separate into own function for ease
readBuffer = com_data.read(com_data.in_waiting)
# readBuffer = com_data.read(com_data.in_waiting)
byteVec = np.frombuffer(readBuffer, dtype = 'uint8')
byteCount = len(byteVec)
print(readBuffer)
time.sleep(0.03) # Sampling frequency of 30 Hz
--
The switches on my device are configured as follows, as recommended by the Visualizer for loading the Motion/Presence demo:
S1: 100011
S3: 0010
Thank you in advance!