Code:
#!/usr/bin/env bash
BASEBPS=24000000
[ "$2" = "" ] && { echo 'use args <dev> <bps>'; exit; }
dev=$1
bps=$2
setserial $dev divisor $[ $BASEBPS / $bps ] spd_cust
stty -F $dev 38400 2> /dev/null
Execution:
~$ sudo ./setbaud.sh /dev/ttyUSB0 256000
Cannot get serial info: Innapropriate ioctl for device
Someone know if there is a way to solve this?