Created
October 18, 2023 16:37
-
-
Save ustayready/9aa2abe4335398ef8173e82e1b3bdd95 to your computer and use it in GitHub Desktop.
Minicom python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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