Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4861

Python • Re: UART communication between sensor and RPI zero 2W with python

$
0
0
You have a timeout set at 1 second. Are you certain the response is not timing out? The read here is waiting for 9 characters.
Try this:

Code:

try:  ser_resp = ser.read(9)except:  print("timeout")

Statistics: Posted by SurferTim — Wed Oct 30, 2024 3:52 pm



Viewing all articles
Browse latest Browse all 4861

Trending Articles