diff --git a/usr/openmv-ide.py b/usr/openmv-ide.py index 07d6d3476..a527029e2 100755 --- a/usr/openmv-ide.py +++ b/usr/openmv-ide.py @@ -192,14 +192,6 @@ class OMVGtk: sleep(wait) def connect(self): - try: - # open VCP and configure the terminal - self.serial = serial.Serial(self.config.get("main", "serial_port"), 115200, timeout=0.001) - gobject.gobject.idle_add(omvgtk.update_terminal) - except Exception as e: - self.show_message_dialog(gtk.MESSAGE_ERROR, "Failed to connect to OpenMV\n%s"%e) - return - try: # init openmv openmv.init() @@ -211,6 +203,14 @@ class OMVGtk: self.show_message_dialog(gtk.MESSAGE_ERROR, "Failed to connect to OpenMV\n%s"%e) return + try: + # open VCP and configure the terminal + self.serial = serial.Serial(self.config.get("main", "serial_port"), 115200, timeout=0.001) + gobject.gobject.idle_add(omvgtk.update_terminal) + except Exception as e: + self.show_message_dialog(gtk.MESSAGE_ERROR, "Failed to connect to OpenMV\n%s"%e) + return + self.connected = True self._update_title() self.connect_button.set_sensitive(False)