sitter3 bug fix

This commit is contained in:
Sam 2023-06-22 22:01:51 +02:00
parent e21fd57743
commit 23a07470e6

View File

@ -144,20 +144,25 @@ class DAC(object):
self.firmware_string = "-" self.firmware_string = "-"
self.got_broadcast(bp) self.got_broadcast(bp)
try: #try:
t1 = time.time() t1 = time.time()
self.connect(self.last_broadcast.ip[0]) self.connect(self.last_broadcast.ip[0])
t = time.time() - t1 t = time.time() - t1
self.conn_status = "ok (%d ms)" % (t * 500) self.conn_status = "ok (%d ms)" % (t * 500)
if self.last_broadcast.sw_rev < 2:
self.firmware_string = "(old)"
if self.last_broadcast.sw_rev < 2: else:
self.firmware_string = "(old)" self.conn.sendall(b'v')
else: self.firmware_string = self.read(32).replace("\x00", " ").strip()
self.conn.sendall('v')
self.firmware_string = self.read(32).replace("\x00", " ").strip()
except (Exception, e): print('firmware string : ',self.firmware_string)
'''
except Exception as e:
print(e) print(e)
self.conn_status = str(e) self.conn_status = str(e)
'''
def connect(self, host, port = 7765): def connect(self, host, port = 7765):
"""Connect to the DAC over TCP.""" """Connect to the DAC over TCP."""