# how to enable the serial port



## liuqiong7618 (Apr 22, 2011)

Hello everyone,

I have installed FreeBSD 6.4 for i386 on the PC, and there is one serial port attached with the motherboard. I want the APC UPS to communicate with PC via serial port. But the communication is lost by the APC monitor software.

When I input the command [cmd=]dmesg|grep sio[/cmd] to probe the serial info, the error will be displayed:


```
ioapic0 <Version 1.1> irqs 0-23 on motherboard
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
sio1: <Generic IRDA-compatible device> port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
```

I check the configuration "device.hints", the info as below:

```
hint.sio.0.port="0x3F8"
hint.sio.0.flags="0x10"
hint.sio.0.irq="4"
hint.sio.1.at="isa"
hint.sio.1.port="0x2F8"
hint.sio.1.irq="3"
hint.sio.2.at="isa"
hint.sio.2.disabled="1"
hint.sio.2.port="0x3E8"
hint.sio.2.irq="5"
hint.sio.3.at="isa"
hint.sio.3.disabled="1"
hint.sio.3.port="0x2E8"
hint.sio.3.irq="9"
```

I think the communication lost is not caused by the software and UPS, it maybe caused by the serial port configuration. Can somebody help to enable or activate my serial port?

Thank you very much.


----------



## tingo (Apr 22, 2011)

First, try to enable sio2 and sio3 (by changing the "disabled" line in device.hints) - your port might be one of those. Second, try to figure out (from BIOS screens) what settings (port, irq, etc.) your serial port uses and verify that it is the same as device.hints lists. Oh, and do a verbose boot to get more info.


----------



## wblock@ (Apr 22, 2011)

liuqiong7618 said:
			
		

> I have installed FreeBSD 6.4 for i386 on the PC, and there is one serial port attached with the motherboard. I want the APC UPS to communicate with PC via serial port. But the communication is lost by the APC monitor software.



Without seeing apcupsd.conf and exact error messages, we can only resort to guessing.  My guess is that you've just used the wrong serial device.
`% man sio | less -p FILES`

FreeBSD 6.4 is old.  Serial device names changed somewhere along the line, and you might be using an example meant for recent releases.


----------



## liuqiong7618 (Apr 23, 2011)

Hi all, I got the causation. I have installed the same version on the other PC, and I reject to install the SLIP/PPP network devices (this feature should be installed as default), the error will not be shown. So, I think the SLIP/PPP network will capture the COM1. I do not known how to uninstall this package or disable the feature?


----------



## SirDice (Apr 25, 2011)

liuqiong7618 said:
			
		

> I do not known how to uninstall this package or disable the feature?


Build a custom kernel without them.

Handbook: Chapter 8 Configuring the FreeBSD Kernel


----------



## danbi (Apr 26, 2011)

The kernel output just says that it probed for serial port at the given I/O port and got no interrupt back.

Probably the port is disabled in BIOS. Or (very unlikely, by default) is configured at some other address.

It is not likely ppp/slip will capture the port, because the kernel cannot attach a driver to it in the first place.


----------



## liuqiong7618 (Apr 27, 2011)

I have fixed this issue, I should set the rs232 device to /dev/cuad0, not /dev/cuaa0 in the apcupsd.conf. I am sorry, it is not caused by the system configuration; now the two PCs can communicate with the UPS gracefully, no matter what the error info (sio0: port may not be enabled) will be displayed or not.

So danbi is right, ppp/slip will not capture the port.


----------

