Less rights to open COM port

Moderator: Moderators

Less rights to open COM port

Postby bbernhard » 14.12.2008, 23:29

Maybe this helps any other user.
Valid for Linux version:

The p50x library gives no good feedback in case the user has too less rights to open com /dev/ttySx

20081214.231951.685 r9999I main OP50x 1261 ----------------------------------------
20081214.231951.685 r9999I main OP50x 1262 p50x 1.2.0
20081214.231951.685 r9999I main OP50x 1263 ----------------------------------------
20081214.231951.685 r9999I main OP50x 1265 iOP50x[NEW]: com1,2400,none,8,2,cts
20081214.231951.685 r9999I main OP50x 1269 p50x timeout=1000
20081214.231951.685 r9999I main OP50x 1270 p50x ctsretry=1000
20081214.231951.685 r9999I main OP50x 1271 p50x readfb=1
20081214.231951.685 r9999I main OP50x 1272 p50x fbmod=0
20081214.231951.685 r9999I main OP50x 1273 p50x swtime=250
20081214.231951.685 r9999I main OP50x 1274 ----------------------------------------
20081214.231951.685 r9999I main OSerial 0156 rocs_serial_open:open rc=13 read=-1 write=-1
20081214.231951.685 r9999E main OP50x 1301 Could not init p50x port!


to compare the log of ddx library is much better:
20081214.232629.636 r9999I main ODDX 0559 ----------------------------------------
20081214.232629.636 r9999I main ODDX 0560 DDX Digital Direct Xtra
20081214.232629.636 r9999I main ODDX 0561 ----------------------------------------
20081214.232629.636 r9999I main ODDX 0562 ddx 1.2.0
20081214.232629.636 r9999I main ODDX 0563 ----------------------------------------
20081214.232629.636 r9999I main ODDX 0566 ddx boosterport=/dev/ttyS0
...
...
20081214.232629.636 r9999I main ODDX 0607 ----------------------------------------
20081214.232629.636 r9999I main ODDX 0610 Starting DDX...
20081214.232629.636 r9999E main impl/ddx 0048 no access rights to open device [/dev/ttyS0]
20081214.232629.636 r9999W main impl/ddx 0149 Serial port misfunction. Data output disabled
20081214.232629.636 r9999c main impl/ddx 0120 Access to port 0x378 denied.


best rgds
bb
HO Scale mostly from Kleinbahn and Roco -
OpenDCC GBMBoost, LightControl, TLE-S88-Bridge, LDT and some DiY stuff, Win10
bbernhard
 

Postby start123 » 15.12.2008, 00:11

Hi BB,

Had some similar problems when starting the rocrail server as regular user. I think it's related to some device permissions in the Linux environment. Starting rocrail as user "root" helped to eliminate the problem for me, though maybe there's some other solution (something like chmod 777 /dev/ttyS0, but aarghh - that's not the way it should have ment by the Linux-Developers...)
Anyone to have a better solution?
Ciao,
Rolf
start123
 

Postby jeanmichel » 15.12.2008, 00:15

Hi,

just add the user to a group which allows com access (dialout or something like that).

Jean-Michel
jeanmichel
 


Return to P50 and P50x