5
5
This is to avoid you accidentally updating a NEO-D9S with ZED-F9P firmware and vice versa.
6
6
(Don't worry if that happens. You can recover. But you need access to the SafeBoot pin to
7
7
force the module into a safe state for re-updating.)
8
+ If you _really_ know what you are doing, you can disable this check with the "Override" option.
8
9
9
10
ubxfwupdate.exe is a Windows executable. This tool will only work on Windows. Sorry about that.
10
11
26
27
RTK_u-blox_Update_GUI.py (this file!)
27
28
RTK.ico (icon file for the .exe)
28
29
RTK.png (icon for the GUI widget)
29
- ubxfwupdate.exe (copied from u-center)
30
- libMPSSE.dll (copied from u-center)
31
- flash.xml (copied from u-center)
30
+ ubxfwupdate.exe (copied from u-center v22.02 )
31
+ libMPSSE.dll (copied from u-center v22.02 )
32
+ flash.xml (copied from u-center v22.02 )
32
33
33
34
MIT license
34
35
41
42
from PyQt5 .QtCore import QSettings , QProcess , QTimer , Qt , QIODevice , pyqtSlot
42
43
from PyQt5 .QtWidgets import QWidget , QLabel , QComboBox , QGridLayout , \
43
44
QPushButton , QApplication , QLineEdit , QFileDialog , QPlainTextEdit , \
44
- QAction , QActionGroup , QMenu , QMenuBar , QMainWindow , QMessageBox
45
+ QAction , QActionGroup , QMenu , QMenuBar , QMainWindow , QMessageBox , \
46
+ QCheckBox
45
47
from PyQt5 .QtGui import QCloseEvent , QTextCursor , QIcon , QFont
46
48
from PyQt5 .QtSerialPort import QSerialPortInfo , QSerialPortInfo
47
49
@@ -133,11 +135,39 @@ def __init__(self, parent: QWidget = None) -> None:
133
135
self .upload_btn .setFont (myFont )
134
136
self .upload_btn .clicked .connect (self .on_upload_btn_pressed )
135
137
138
+ # Packet Dump Button
139
+ self .packet_dump_btn = QCheckBox (self .tr ('Packet Dump' ))
140
+ self .packet_dump_btn .setChecked (False )
141
+
142
+ # Safeboot Button
143
+ self .safeboot_btn = QCheckBox (self .tr ('Enter Safeboot' ))
144
+ self .safeboot_btn .setChecked (True )
145
+ self .safeboot_btn .toggled .connect (lambda :self .button_state (self .safeboot_btn ))
146
+
147
+ # Training Button
148
+ self .training_btn = QCheckBox (self .tr ('Training Sequence' ))
149
+ self .training_btn .setChecked (True )
150
+
151
+ # Reset After Button
152
+ self .reset_btn = QCheckBox (self .tr ('Reset After' ))
153
+ self .reset_btn .setChecked (True )
154
+
155
+ # Chip Erase Button
156
+ self .chip_erase_btn = QCheckBox (self .tr ('Chip Erase' ))
157
+ self .chip_erase_btn .setChecked (False )
158
+
159
+ # Override Button
160
+ self .override_btn = QCheckBox (self .tr ('Override' ))
161
+ self .override_btn .setChecked (False )
162
+ self .override_btn .toggled .connect (lambda :self .button_state (self .override_btn ))
163
+
136
164
# Messages Bar
137
165
self .messages_label = QLabel (self .tr ('Status / Warnings:' ))
138
166
139
167
# Messages Window
168
+ messageFont = QFont ("Courier" )
140
169
self .messageBox = QPlainTextEdit ()
170
+ self .messageBox .setFont (messageFont )
141
171
142
172
# Arrange Layout
143
173
layout = QGridLayout ()
@@ -159,15 +189,34 @@ def __init__(self, parent: QWidget = None) -> None:
159
189
layout .addWidget (self .baud_combobox , 4 , 1 )
160
190
layout .addWidget (self .upload_btn , 4 , 2 )
161
191
162
- layout .addWidget (self .messages_label , 5 , 0 )
163
- layout .addWidget (self .messageBox , 6 , 0 , 5 , 4 )
192
+ layout .addWidget (self .packet_dump_btn , 4 , 3 )
193
+ layout .addWidget (self .safeboot_btn , 5 , 3 )
194
+ layout .addWidget (self .training_btn , 6 , 3 )
195
+ layout .addWidget (self .reset_btn , 7 , 3 )
196
+ layout .addWidget (self .chip_erase_btn , 8 , 3 )
197
+ layout .addWidget (self .override_btn , 9 , 3 )
198
+
199
+ layout .addWidget (self .messages_label , 9 , 0 )
200
+ layout .addWidget (self .messageBox , 10 , 0 , 5 , 4 )
164
201
165
202
self .setLayout (layout )
166
203
167
204
self .settings = QSettings ()
168
205
#self._clean_settings() # This will delete all existing settings! Use with caution!
169
206
self ._load_settings ()
170
207
208
+ def button_state (self , b ) -> None :
209
+ if b .text () == "Safeboot" :
210
+ if b .isChecked () == True :
211
+ self .training_btn .setChecked (True )
212
+ self .training_btn .setEnabled (True )
213
+ else :
214
+ self .training_btn .setChecked (False )
215
+ self .training_btn .setEnabled (False )
216
+ elif b .text () == "Override" :
217
+ if b .isChecked () == True :
218
+ self .show_error_message (">>>>> Override enabled <<<<<\n Firmware version check is disabled" )
219
+
171
220
def writeMessage (self , msg ) -> None :
172
221
self .messageBox .moveCursor (QTextCursor .End )
173
222
self .messageBox .ensureCursorVisible ()
@@ -424,7 +473,8 @@ def on_upload_btn_pressed(self) -> None:
424
473
if endPos >= 0 :
425
474
self .writeMessage (printable [startPos : endPos ]) # Print the full product version
426
475
427
- if 1 : # Change this to 0 for "god mode" (always update - even if fwver does not match)
476
+ if self .override_btn .isChecked () == False :
477
+
428
478
if fwver == '' :
429
479
self .writeMessage ("Unable to read the receiver and software version. Aborting..." )
430
480
return
@@ -436,13 +486,35 @@ def on_upload_btn_pressed(self) -> None:
436
486
self .writeMessage ("\n The firmware appears invalid for this module. Aborting..." )
437
487
return
438
488
489
+ self .override_btn .setChecked (False )
490
+
439
491
self .writeMessage ("\n Updating firmware\n " )
440
492
441
493
command = []
442
494
command .extend (["-p" ,self .port ])
443
495
command .extend (["-b" ,self .baudRate + ":" + self .baudRate + ":115200" ])
444
496
if self .fisLocation_lineedit .text () != '' :
445
497
command .extend (["-F" , self .theFisName ])
498
+ if self .packet_dump_btn .isChecked () == True :
499
+ command .extend (["-v" ,"2" ])
500
+ else :
501
+ command .extend (["-v" ,"1" ])
502
+ if self .safeboot_btn .isChecked () == True :
503
+ command .extend (["-s" ,"1" ])
504
+ if self .training_btn .isChecked () == True :
505
+ command .extend (["-t" ,"1" ])
506
+ else :
507
+ command .extend (["-t" ,"0" ])
508
+ else :
509
+ command .extend (["-s" ,"0" ])
510
+ if self .reset_btn .isChecked () == True :
511
+ command .extend (["-R" ,"1" ])
512
+ else :
513
+ command .extend (["-R" ,"0" ])
514
+ if self .chip_erase_btn .isChecked () == True :
515
+ command .extend (["-C" ,"1" ])
516
+ else :
517
+ command .extend (["-C" ,"0" ])
446
518
command .append (self .theFirmwareName )
447
519
448
520
self .writeMessage ("ubxfwupdate.exe %s\n \n " % " " .join (command ))
0 commit comments