We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f32dd0 commit 7f8af90Copy full SHA for 7f8af90
generate/templates/device.py.in
@@ -47,7 +47,9 @@ class PingDevice(object):
47
print("Opening %s at %d bps" % (device_name, baudrate))
48
49
## Serial object for device communication
50
- self.iodev = serial.Serial(device_name, baudrate)
+ # write_timeout fixes it getting stuck forever atempting to write to
51
+ # /dev/ttyAMA0 on Raspberry Pis, this raises an exception instead.
52
+ self.iodev = serial.Serial(device_name, baudrate, write_timeout=1.0)
53
self.iodev.send_break()
54
self.iodev.write("U".encode("ascii"))
55
0 commit comments