now I have this Errorand here my codeMy understanding is the data is a basic serial stream:A manual detailing the frames is available at https://drive.google.com/drive/folders/ ... 2crR_DO0uh - note though this is reported to by Hi-Link I cannot prove this one way or another so please check downloads carefully before use.The LD2450 module communicates with the outside world through a serial port with a default baud rate of 256000, 1 stop bit, and no parity bits.
I know the home automation folk tried the early firmware and found it unstable - this was fixed in a later firmware update but I have zero details on the versions so recommend you update to the latest code before use.
import serial
import time
# Настройки соединения с модулем
ser = serial.Serial(
port='/dev/ttyAMA0', # Подключение к порту ttyAMA0
baudrate=256000, # Скорость передачи данных
bytesize=serial.EIGHTBITS, # Размер байта
parity=serial.PARITY_NONE, # Без проверки паритета
stopbits=serial.STOPBITS_ONE, # Один стоп-бит
)
# Чтение данных
while True:
if ser.in_waiting:
data = ser.read(ser.in_waiting)
print(data.decode('utf-8')) # Декодирование и печать данных
time.sleep(0.1) # Краткая пауза перед следующим чтением
Statistics: Posted by karetnik — Mon Mar 25, 2024 10:13 pm