I have a minicom script which sends some commands via serial and expects something back(which works) but im having trouble exiting the minicom screen.
Below is the minicom script:
success1:
print \nSuccessfully received running!
send "exit"
exit 0
success2:
print \nSuccessfully received degrading!
! killall -9 minicom
exit
I was using ! killall -9 minicom
which is recommended on their documentation but unfortunately, when running the script on Jenkins, it fails due to exit code 137 (Another process sent a signal 9). However this does exit minicom, just not successfully.
On the other hand, the 'send "exit"' just logs out of the device, and doesnt exit minicom.
How can i exit minicom and receive a 0 exit code?
minicom
will start arunscript
process while the pipe here just terminatesminicom
directly beforerunscript
runs test_minicom.macro. An improvement for this:{ sleep 1; while pgrep runscript > /dev/null; do sleep 1; done; cat escape.txt; } | minicom -D /dev/ttyUSB0 -S test_minicom.macro -C capture.txt
. – Spital