0

is there a way to use the Minicom functions in a python script? I need to transfer files via serial port on a raspberry pi 4 to another raspberry pi 4. Minicom offers this functionality and it works indeed when using the console interface.

But I need to trigger the file transfer automatically in my python script and I am not able to type this in the console.

Any kind of feedback is always appreciated.

Thanks. Michael

4
  • I would imagine you could do it fairly easily with pexpect. See pexpect.readthedocs.io/en/stable Commented Jul 16, 2023 at 7:53
  • Hallo @MarkSetchell. Looks like that this is what I need. I am already struggeling when spawing my minicom process, as there is no actual process generated. I am using: child = pexpect.spawn("minicom -b 115200 -o -D /dev/ttyS0") When I am checking my current processes with ps -ef | grep minicom There is no such process.... Can you help? Commented Jul 17, 2023 at 9:29
  • Hello @MarkSetchell. I get my process now, but I can not parse the response with: child.expect("CTRL-Z", timeout=120) Any ideas? Commented Jul 17, 2023 at 9:30
  • Maybe you can look at my new question: stackoverflow.com/questions/76703024/… Commented Jul 17, 2023 at 9:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.