Python termios error using /dev/ttyFIM0

Hi All,
I have a very simple test program to set the serial attributes for /dev/ttyFIM0. I am getting a termio.error: (22, ‘Invalid argument’) error message when I try to set a new speed attribute. Plus a print of the get attribute list doesn’t look right either. Here is my program:
import os
import termios

serfd = ‘/dev/ttyFIM0’, os.O_RDWR | os.O_NOCTTY)
print ‘termios =’, termios.tcgetattr( serfd)
old = termios.tcgetattr(serfd)
old[4] = 38400 # ispeed
old[5] = 38400 # ospeed
termios.tcsetattr(serfd, termios.TCSANOW, old)

The print show 13 and 13 for the baud rate which is bogus.
try/except left out for clarity
My platform is ConnectME 9210 and I am using Linux 5.7 tools.

Any help is appreciated.

I do NOT know how to answer you, but I asked an engineer and this with what HE SAID (NOT ‘ME’ SAID! I’m just messenger)

== Engineers response:

The first thing I would check is if /dev/ttyFIM0 exists, I am almost sure he gets this error because the port driver didn’t load or something like that. He can also try to write a C program or even try it from the shell using script like this:



Example: /dev/ttyS0 9600

Set up device

stty -F $1 $2

Let cat read the device $1 in the background

cat $1 &

Capture PID of background process so it is possible to terminate it when done


Read commands from user, send them to device $1

while read cmd
echo “$cmd”
done > $1

Terminate background read process

kill $bgPid
taken from here:

He should also compare his results with the same actions using non-FIM serial port.