Discussion:
[Nut-upsuser] NUT + OpenBSD + dc2500cc + APC Smart-UPS SC620 = problem
Kastus Shchuka
2014-05-02 07:26:33 UTC
Permalink
Hi,

I am trying to set up NUT on a mini-ITX system running OpenBSD 5.5.

I have an APC Smart-UPS SC620 which runs perfectly well on Ubuntu,
with nut-2.2.1. Ubuntu system uses ASUS motherboard.

On mini-ITX system, I have Intel d2500cc motherboard with 4 serial ports.
I've tested ports by connecting them with a null-modem cable and running cu
in 2 terminals. Type in one terminal, output shows in the other, and vice versa.

I disconnect UPS from Ubuntu system, connect it to OpenBSD, try apcsmart
driver, and in 15 seconds it comes back with a message "unable to detect
an APC Smart protocol UPS on port /dev/cua01". NUT is installed from OpenBSD
packages, version 2.7.1. APC Smart protocol driver 3.2 (2.7.1)

I suspect there is something special with serial ports on d2500cc motherboard
as I also tried, out of curiousity, apcupsd from OpenBSD ports, and it failed
to detect the UPS either.

I wonder if anybody else has successfully run NUT on d2500cc motherboard with
serial UPS?

Thanks,

Kastus
Charles Lepple
2014-05-03 12:20:38 UTC
Permalink
Post by Kastus Shchuka
Hi,
I am trying to set up NUT on a mini-ITX system running OpenBSD 5.5.
I have an APC Smart-UPS SC620 which runs perfectly well on Ubuntu,
with nut-2.2.1. Ubuntu system uses ASUS motherboard.
On mini-ITX system, I have Intel d2500cc motherboard with 4 serial ports.
I've tested ports by connecting them with a null-modem cable and running cu
in 2 terminals. Type in one terminal, output shows in the other, and vice versa.
Not sure if there is an easy way to do this in cu, but minicom has some defaults for file transfer programs. Is there an easy way to transfer a file, and see if characters get dropped under load?

Also, is that null-modem cable wired to test hardware handshaking?
Post by Kastus Shchuka
I disconnect UPS from Ubuntu system, connect it to OpenBSD, try apcsmart
driver, and in 15 seconds it comes back with a message "unable to detect
an APC Smart protocol UPS on port /dev/cua01". NUT is installed from OpenBSD
packages, version 2.7.1. APC Smart protocol driver 3.2 (2.7.1)
In the event we missed something with the new driver, can you try with apcsmart-old?

I don't remember the details, but there were some changes related to how the modem control lines are set up.

If you want to run the driver in debug mode, you probably only need to pass one "-D" flag to see at what point the detection fails.
Post by Kastus Shchuka
I suspect there is something special with serial ports on d2500cc motherboard
as I also tried, out of curiousity, apcupsd from OpenBSD ports, and it failed
to detect the UPS either.
Does apctest from apcupsd have any better diagnostics?
Post by Kastus Shchuka
I wonder if anybody else has successfully run NUT on d2500cc motherboard with
serial UPS?
Kastus Shchuka
2014-05-03 14:53:43 UTC
Permalink
Post by Charles Lepple
Post by Kastus Shchuka
Hi,
I am trying to set up NUT on a mini-ITX system running OpenBSD 5.5.
I have an APC Smart-UPS SC620 which runs perfectly well on Ubuntu,
with nut-2.2.1. Ubuntu system uses ASUS motherboard.
On mini-ITX system, I have Intel d2500cc motherboard with 4 serial ports.
I've tested ports by connecting them with a null-modem cable and running cu
in 2 terminals. Type in one terminal, output shows in the other, and vice versa.
Not sure if there is an easy way to do this in cu, but minicom has some defaults for file transfer programs. Is there an easy way to transfer a file, and see if characters get dropped under load?
I have not tried file transfer, I just typed in the terminal.
Post by Charles Lepple
Also, is that null-modem cable wired to test hardware handshaking?
It is actually a pair of DB9-RJ45 adapters connected with a regular cat5 patch cord. I use these adapters to connect to serial port on servers, switches, routers, etc., and I know it works there. All pins on the adapter are connected, so it should support hardware handshake.
Post by Charles Lepple
Post by Kastus Shchuka
I disconnect UPS from Ubuntu system, connect it to OpenBSD, try apcsmart
driver, and in 15 seconds it comes back with a message "unable to detect
an APC Smart protocol UPS on port /dev/cua01". NUT is installed from OpenBSD
packages, version 2.7.1. APC Smart protocol driver 3.2 (2.7.1)
In the event we missed something with the new driver, can you try with apcsmart-old?
Actually I tied that too, with the same level of luck, just forgot to mention that.
Post by Charles Lepple
I don't remember the details, but there were some changes related to how the modem control lines are set up.
If you want to run the driver in debug mode, you probably only need to pass one "-D" flag to see at what point the detection fails.
I used actually 5 "D"s, so the driver was pretty verbose, but it was timing out at the very start of communication, like printing out 5 lines and then timing out and giving up in 15 seconds.
Post by Charles Lepple
Post by Kastus Shchuka
I suspect there is something special with serial ports on d2500cc motherboard
as I also tried, out of curiousity, apcupsd from OpenBSD ports, and it failed
to detect the UPS either.
Does apctest from apcupsd have any better diagnostics?
No, it timed out almost exactly the same as NUT apcsmart driver.
Post by Charles Lepple
Post by Kastus Shchuka
I wonder if anybody else has successfully run NUT on d2500cc motherboard with
serial UPS?
Now the good news is that I tried connecting UPS through USB-serial adapter (with PL2303 chipset), and UPS was detected instantly, and everything worked.

I guess there is something wrong with serial ports on d2500cc, or maybe I am not using them correctly. There are 4 ports on the board, 2 with DB9 connectors on the back and 2 on the board itself. By default, port numbering starts from the headless ones, so DB9s are com3 and com4. There is a special setting in BIOS which swaps headless ports with DB9s, making DB9s com1 and com2. I tried all combinations without any luck. What is strange is that OpenBSD kernel detects 2 ports only, not 4, so I do not exclude a problem with OpenBSD kernel driver.

Funny thing is that I picked d2500cc for this project precisely because it has onboard serial ports trying to avoid the need to use USB-serial adapter, and in the end I have to use the adapter, and it works. I still have to run full set of tests including shutdown, etc., but I am pretty sure at this point that it will work fine. So for now, the problem seems to be solved for me, maybe not in the way I wanted, but I can control the UPS from my new OpenBSD firewall now.

If I have time, I will try to install Linux on this system and see if it can use the serial ports on d2500cc.

Thanks,

Kastus
Charles Lepple
2014-05-06 02:47:34 UTC
Permalink
Post by Kastus Shchuka
I guess there is something wrong with serial ports on d2500cc, or maybe I am not using them correctly. There are 4 ports on the board, 2 with DB9 connectors on the back and 2 on the board itself.
If you do get Linux up and running, check to see what IRQs it assigns to each port. I don't know whether OpenBSD requires interrupts, but I know that a lot of modern OSes tend not to poll the serial port registers.

A Linux live CD might help if you don't want to permanently install it.
--
Charles Lepple
clepple at gmail
Stuart Henderson
2014-05-07 23:43:25 UTC
Permalink
Post by Kastus Shchuka
I guess there is something wrong with serial ports on d2500cc, or
maybe I am not using them correctly. There are 4 ports on the board, 2
with DB9 connectors on the back and 2 on the board itself. By default,
port numbering starts from the headless ones, so DB9s are com3 and com4.
There is a special setting in BIOS which swaps headless ports with DB9s,
making DB9s com1 and com2. I tried all combinations without any luck.
What is strange is that OpenBSD kernel detects 2 ports only, not 4, so I
do not exclude a problem with OpenBSD kernel driver.
For ISA serial ports, OpenBSD only does static configuration,
by default it looks at the following addresses/irqs:

com0 at isa? port 0x3f8 irq 4 # standard PC serial ports
com1 at isa? port 0x2f8 irq 3
com2 at isa? port 0x3e8 irq 5

and this is compiled-in but disabled by default:

com3 at isa? disable port 0x2e8 irq 9 # (conflicts with some video cards)

addresses/irqs can be edited in a kernel on disk with "config -ef /bsd",
see config(8) for a bit more information, at boot time - "boot -c" takes you
into the same editor as config(8) - or by compiling a custom kernel.
Though, all things being equal, if the ports use different settings than
these defaults, I'd probably try to adjust the BIOS to match what the OS
wants.

If you don't get any further this way, try asking on an OpenBSD list
(include dmesg output)..

Loading...