vyarin / air-quality-monitor

Air Quality Monitor
0 stars 1 forks source link

Two instances of the first start character as specified by the PMS5003 datasheet read instead of one #1

Open vyarin opened 2 weeks ago

vyarin commented 2 weeks ago

Describe the bug When reading sensor data using HAL_UART_Receive(), the buffer contains two instances of the first start character, 0x42. This results in frequent checksum failures, possibly due to the extra start character shifting the indices of the checksum over.

To Reproduce Read PMS5003 data using HAL_UART_Receive(&huart1, rx_buffer, 32, 1000) Use the debugger to view the elements of rx_buffer

Expected behavior Only one instance of 0x42 should be present, located at index 0 of the buffer array.

vyarin commented 1 week ago

Sensor seems to be reading at times, so perhaps what I am reading in the debugger are coincidently the failed receives