def on_closing(self): self.running = False if self.serial_port and self.serial_port.is_open: self.serial_port.close() self.root.destroy()
def create_widgets(self): # Top frame: port settings settings_frame = tk.LabelFrame(self.root, text="Serial Settings", padx=5, pady=5) settings_frame.pack(fill="x", padx=10, pady=5)
def send_text_data(self): if not self.serial_port or not self.serial_port.is_open: messagebox.showerror("Error", "Port not opened.") return data = self.send_text.get("1.0", tk.END).encode('utf-8') self.serial_port.write(data) sscom english version
# GUI self.create_widgets()
self.open_btn = tk.Button(settings_frame, text="Open Port", command=self.toggle_port, bg="lightgreen") self.open_btn.grid(row=0, column=4, padx=10) def on_closing(self): self
Switch to mode by checking the option next to the send pane. Enter 48 65 6C 6C 6F (which is "Hello" in hex). Click Send. The receive window should display "Hello" in ASCII.
: Sending AT commands to modules (like LoRaWAN or GPS) to check their operational status. Version & Download Information The receive window should display "Hello" in ASCII
: Match the baud rate and settings to your hardware’s specifications (e.g., 9600, 8, N, 1).
: Displays incoming data from the serial port in Hex or String format. Command Sending