Setting kermit line on command-line instead of .kermrc

1.8k Views Asked by At

I am establishing a kermit connection to my target via a ~/.kermrc file as suggested...

set line /dev/ttyUSB0

set flow-control none

set carrier-watch off

set speed 115200

connect

... But I periodically must unpower the target, which then changes the ttyUSB enumeration, which means I need to change the USB enumeration in the ~/.kermrc file.

My question is, is there a way to dynamically populate the USB line number without modifying the ~/.kermrc. If I remove the 'set line /dev/ttyUSB' and attempt to populate via command-line like this...

kermit -l /dev/ttyUSB0

... the ~/.kermrc file is read first and the command-line line configuration is not respected, so you receive errors that a line number must be set before setting the additional options in the ~/.kermrc.

Thanks in advance for response.

1

There are 1 best solutions below

0
On

I know this is infinity later but in many modern systems there are udev rules that create symlinks for serial ports

check and see if you have a /dev/serial/by-id/ or /dev/serial/by-path/ directory (when your usb serial is connected). If you do inspect their content and you will see symbolic links. I usually use /dev/serial/by-id/usb-FTDI_USB_Null_Modem_Cable_XXXXXXXX-if00-port0 rather than /dev/ttyUSB0

As for your original question - yes you can pass arguments on the commandline - just remove yoru .kermrc or just set there parameters that can be set before the set line command as that one actually establishes a connection.

You could theoretically remove it altogether and just use a commandline (make it a bash function?)

kermit -l /dev/ttyUSB0 -b 115200 \
    -C "set flow-control none, set carrier-watch off"