Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Serial Multiple Access #22

Open
abkfenris opened this issue Apr 21, 2017 · 0 comments
Open

Serial Multiple Access #22

abkfenris opened this issue Apr 21, 2017 · 0 comments

Comments

@abkfenris
Copy link
Owner

It appears that sometimes the board can have two containers running at once, then they may both be accessing the serial.

W
20.04.17 20:51:18 (-0400) Serial returned invalid info, trying again
20.04.17 20:51:22 (-0400) 2017-04-21 00:51:22.322945 1958.9mm 4.17v float 1.23ma
20.04.17 20:51:27 (-0400)   Wired connection 1 - 192.168.6.148
20.04.17 20:51:28 (-0400) Serial returned invalid info, trying again
20.04.17 20:51:29 (-0400) Serial returned invalid info, trying again
20.04.17 20:51:29 (-0400) Serial returned invalid info, trying again
20.04.17 20:51:29 (-0400) Traceback (most recent call last):
20.04.17 20:51:29 (-0400)   File "/usr/local/lib/python3.6/site-packages/serial/
serialposix.py", line 501, in read
20.04.17 20:51:29 (-0400)     'device reports readiness to read but returned no
data '
20.04.17 20:51:29 (-0400) serial.serialutil.SerialException: device reports read
iness to read but returned no data (device disconnected or multiple access on po
rt?)
20.04.17 20:51:29 (-0400)
20.04.17 20:51:29 (-0400) During handling of the above exception, another except
ion occurred:
20.04.17 20:51:29 (-0400)
20.04.17 20:51:29 (-0400) Traceback (most recent call last):
20.04.17 20:51:29 (-0400)   File "simple.py", line 198, in <module>
20.04.17 20:51:29 (-0400)     sensor_cycle(ser)
20.04.17 20:51:29 (-0400)   File "simple.py", line 120, in sensor_cycle
20.04.17 20:51:29 (-0400)     distance = clean_sample_mean(read_serial, ser, SEN
SOR_LOW, SENSOR_HIGH, MIN_SAMPLES, MAX_ATTEMPTS, MAX_STD_DEV)
20.04.17 20:51:29 (-0400)   File "simple.py", line 92, in clean_sample_mean
20.04.17 20:51:29 (-0400)     samples.append(sample_func(ser))
20.04.17 20:51:29 (-0400)   File "simple.py", line 79, in read_serial
20.04.17 20:51:29 (-0400)     data = ser.read(5).decode('ASCII')
20.04.17 20:51:29 (-0400)   File "/usr/local/lib/python3.6/site-packages/serial/
serialposix.py", line 508, in read
20.04.17 20:51:29 (-0400)     raise SerialException('read failed: {}'.format(e))
20.04.17 20:51:29 (-0400) serial.serialutil.SerialException: read failed: device
 reports readiness to read but returned no data (device disconnected or multiple
 access on port?)

Which will crash out the container.

The real fix would be never allowing multiple containers of the same job run at once, but it should be handled so it doesn't continuously stay up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant