Skip to content

Instantly share code, notes, and snippets.

@ustayready
Created October 18, 2023 16:37
Show Gist options
  • Save ustayready/9aa2abe4335398ef8173e82e1b3bdd95 to your computer and use it in GitHub Desktop.
Save ustayready/9aa2abe4335398ef8173e82e1b3bdd95 to your computer and use it in GitHub Desktop.
Minicom python
import subprocess
def start_minicom(serial_port):
try:
# Run minicom in the background to listen to the serial port
minicom_process = subprocess.Popen(['minicom', '-D', serial_port], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Wait for minicom to finish (you can add a loop to continue running if needed)
minicom_process.wait()
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
serial_port = "/dev/ttyUSB0" # Replace with your serial port device
start_minicom(serial_port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment