[FIX] hw_blackbox_be, hw_scale: don't rely on serial ID to be unique
After plugging in multiple identical serial to USB interfaces, only the last one will be available under /dev/serial/by-id/ because they'll have identical IDs. Instead use /dev/serial/by-path/ which does not have this issue.
This commit is contained in:
parent
acf027ac98
commit
290eb4ea2e
|
@ -37,7 +37,7 @@ class Blackbox(Thread):
|
||||||
# request. The first device to give an answer that makes sense
|
# request. The first device to give an answer that makes sense
|
||||||
# wins.
|
# wins.
|
||||||
def _find_device_path_by_probing(self):
|
def _find_device_path_by_probing(self):
|
||||||
path = "/dev/serial/by-id/"
|
path = "/dev/serial/by-path/"
|
||||||
probe_message = self._wrap_low_level_message_around("S000")
|
probe_message = self._wrap_low_level_message_around("S000")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Scale(Thread):
|
||||||
self.lock = Lock()
|
self.lock = Lock()
|
||||||
self.scalelock = Lock()
|
self.scalelock = Lock()
|
||||||
self.status = {'status':'connecting', 'messages':[]}
|
self.status = {'status':'connecting', 'messages':[]}
|
||||||
self.input_dir = '/dev/serial/by-id/'
|
self.input_dir = '/dev/serial/by-path/'
|
||||||
self.weight = 0
|
self.weight = 0
|
||||||
self.weight_info = 'ok'
|
self.weight_info = 'ok'
|
||||||
self.device = None
|
self.device = None
|
||||||
|
|
Loading…
Reference in New Issue