Using minicom under linux as terminal program

General discussions related to the Altair 8800 Clone

Using minicom under linux as terminal program

Postby Synoptic » March 13th, 2014, 12:09 pm

Minicom works very well, excepts, it lacks the binary sending mode.

However, it is possible to add that feature.

Taken from http://www.dannysung.com/wmain/linux/tips/sending-binary-files-via-minicom/
First step is to install pv.

On RPM-based systems, just type:
Code: Select all
sudo yum install pv


On Debian-based systems, type:
Code: Select all
apt-get install pv


Now create this script, and place it in your ~/bin/ directory as (for example) bin-xfr.
Code: Select all
#!/bin/sh
INFILE=/dev/null
OUTFILE=/dev/null
 
while [ $# -gt 0 ]; do
 case "$1" in
 -i)
 shift
 INFILE="$1"
 ;;
 -o)
 shift
 OUTFILE="$1"
 ;;
 -h|--help)
 echo "$0 -i infile -o outfile"
 ;;
 *)
 INFILE="$1"
 esac
 shift
done
cat << EOF
binary-xfer utility for minicom
Sending file ${INFILE} to ${OUTFILE}
EOF
 
/usr/bin/pv --force -i 0.25 -B 128  ${INFILE}  2>&1 > ${OUTFILE}
# Use the line below if you don't have pv!
 
# /bin/cat ${INFILE} > ${OUTFILE}
cat << EOF
 
File transfer complete
EOF
sleep 1


Now go over to minicom and go to the configuration menu (via CTRL-A,O), then “File transfer protocols”. You can add a section there called “binary”, point it at your file, and specify:

Code: Select all
 Name: Binary
    Program: /home/MYUSERNAME/bin/bin-xfer -o %l -i
    Name: Y
    U/D:  U
    FullScr: Y
    IO-Red: N
    Multi:N

Then leave the menu and save your options. Next time you send a file (via CTRL-A,S), you should see “Binary” listed as an option.

The only caveat, is the firmware filename should not have special character in its name (space for example).
Last edited by Synoptic on March 18th, 2023, 2:40 pm, edited 1 time in total.
Synoptic
 
Posts: 48
Joined: February 28th, 2014, 2:15 pm

Re: Using minicom under linux as terminal program

Postby AltairClone » March 13th, 2014, 4:08 pm

Great info -- Thanks!

Mike
AltairClone
Site Admin
 
Posts: 632
Joined: April 5th, 2013, 10:55 am


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 16 guests

cron