Score:0

Serial: Could not obtain serial port with an NI PCI 8431/16 interface

cn flag

I have a problem with obtaining serial port with NI PCIe instrument card. I am running Ubuntu 20.04

Initially I tried to discover my serial port configuration with

sudo setserial -g /dev/ttyS*

It shows a list of serial port but with only /dev/ttyS0 showing an uart : 16550A, something like below

/dev/ttyS0, uart: 16550A, port :0x03f8, irq: 4
/dev/ttyS1, uart: unknown, port: 0x02f8, irq:3
/dev/ttyS2, uart: unknown, port: 0x03e8, irq:4
/dev/ttyS3, uart: unknown, port: 0x02e8, irq:3
.....

The rest doesn't even have port and irq being assigned. I believe that /dev/ttyS0 is assigned as a "generic" port and is not the port provided by the NI card.

Next I tried to query the pci information

sudo lspci -vvv > pci.txt

And found that the memory region for the card being disabled

.....
Region 0: memory at d8e00000(32bit, non prefectable) [disabled][size 4k]
....

I tried to use setpoint to enable it again

sudo setpci -s [device_id]:[memory_addr] COMMAND=0x02

Checking with lspci again, the word [disabled] is being removed. And then checking with setserial commands again, there is nothing change

Driver Reinstallation

Tried reinstalling the drivers ni-ubuntu2004-drivers-2023Q3.deb but seem nothing change

How to proceed

Wonder what else can I try? Is it a case of irq conflict or?

Thanks

Score:1
it flag

Does id show you're in the same group (probably serial) as ls -l /dev/tty*?

Many device access problems can be resolved through group membership changes.

Specifically, if ls -l /dev/ttyS0 shows that the group permissions (the second "rwx" triplet) is "rw" (e.g."-rw-rw----"), then, adding oneself to the group that owns the device will grant rw access.

Here's how:

# change to your device name 
device="/dev/ttyS0"
sudo adduser $USER $(stat -c "%G" $device)

This allows you membership in the group that can rw the device, but there is one more step.

To make all your processes members of the new group, logout and login. Group memberships are set up at login time.

To create a single process in the new group (for testing, prior to logout/login):

newgrp $(stat -c "%G" $device)  

or, just type the group name. See man newgrp.

user1538798 avatar
cn flag
your solution does not seem to deal with the problem i am facing...but anyway thanks
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.