File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ def stop_device(self):
77
77
self .update_timer .stop ()
78
78
79
79
def send_ping (self ):
80
+ self .old_dict = dict () # re-transmit all params every second to handle packet loss
80
81
self .port .write (b'DPING\r \n ' )
81
82
82
83
def new_serial_data (self ):
@@ -87,10 +88,17 @@ def new_serial_data(self):
87
88
88
89
if line .startswith (b'$' ) and line .count (b'$' ) == 1 :
89
90
parts = line [1 :].split (b' ' )
90
- self .sock .sendto (b'\r \n ' .join (parts ), teleplotAddr )
91
+ try :
92
+ self .sock .sendto (b'\r \n ' .join (parts ), teleplotAddr )
93
+ except OSError :
94
+ pass
91
95
break
92
96
93
- logger .info (line .decode ('utf-8' ))
97
+ try :
98
+ logger .info (line .decode ('utf-8' ))
99
+ except UnicodeDecodeError :
100
+ pass
101
+
94
102
if line == FOCSTIM_BOOT_MARKER :
95
103
self .boot_marker_detected = True
96
104
self .version_string_detected = False
You can’t perform that action at this time.
0 commit comments