I need to replug the USB2Serial converter, that my serial UPS works

rosabox

Explorer
Joined
Jun 8, 2016
Messages
77
I have a "new" UPS for my TrueNAS (TrueNAS-12.0-U8.1), it's an APC Smart-UPS 3000 RM and it has only a serial port.
As there is no serial port on the TrueNAS server, I'm using an USB to Serial converter (FTDI chip).
I plugged the converter, connected the UPS, configured the UPS service in TrueNAS and all was working fine.
But today I had to reboot the TrueNAS server and after the reboot I got: "connect failed: Connection failure: Connection refused"
After unplugging and replugging the USB to Serial converter, it again works fine.
I looked to me as a permissions problem.
The UPS is connected to /dev/cuaU0 with uucp/dialer owner, there is also /dev/ttyU0 with root/uucp owner created, when plugging the converter in and I think this device had a different (root/wheel) after the reboot.
I have tried to change the group from wheel to uucp but that didn't help.
After a boot there two serial ports /dev/cuau0 and /dev/cuau1, after replugging the converter, there is a "new" port /dev/cuaU0.
I'm out of ideas.
What could be the problem and how to fix it?
 
Joined
Jun 2, 2019
Messages
591
Every time you connect or disconnect a USB peripheral and reboot the device bus enumeration may change.

Have to tried to leave the port setting set to auto?
 

rosabox

Explorer
Joined
Jun 8, 2016
Messages
77
I didn't try the auto setting.
I did try to boot the server without the converter and there are two serial ports /dev/cuau0 and /dev/cuau1 - the same as when booted with the converter, it seems that the converter port /dev/cuaU0 is not created during a (re)boot but is created after a replug.
 

rosabox

Explorer
Joined
Jun 8, 2016
Messages
77
I have tried the suggested auto setting and I get: "connect failed: "Connection failure: Connection refused" (after replugging the converter, the port /dev/cuaU0 is there)
Manually set to /dev/cuaU0 it works.
I have disabled a serial port in BIOS (there is only one there), after a reboot, without the converter, I get /dev/cuau1 only.
After connecting (plugging in) the converter, I get /dev/cuaU0 and /dev/cuau1.
After a reboot with the converter still plugged in I get: "Connection failure: Connection refused" again and there is no /dev/cuaU0
 

rosabox

Explorer
Joined
Jun 8, 2016
Messages
77
After upgrading to TrueNAS-13.0-U3.1, the problem is still present.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,681
This sounds like some issue with devd configuration to me. Unfortunately, I'm only motivated enough this morning to throw that out as a hint in case it helps you in your search.
 

rosabox

Explorer
Joined
Jun 8, 2016
Messages
77
I have looked at devd and the only relevant thing (I have found) in devd.conf is:


Code:
# Let the init(8) know there's a new USB serial interface it might
# want to run getty(8) for.  This includes device-side tty created
# by usb_template(4).
notify 100 {
    match "system"        "DEVFS";
    match "subsystem"    "CDEV";
    match "type"        "CREATE";
    match "cdev"        "ttyU[0-9]+";
    action "/sbin/init q";


But frankly I have no idea what, why , how ...
 
Top