Link to home
Start Free TrialLog in
Avatar of cspiro
cspiro

asked on

Getting mgetty+sendfax to work in LINUX

I've just installed a connexant intenal fax modem into a LINUX RHEL4 box.  I've also downloaded and installed the modem driver from linuxiant for the LINUX kernal on the box.  I would like to use mgetty+sendfax but get errors.  Starting with senfax I get the error 'Trying fax device '/dev/ttyS0 ... locked'.  The internal modem is installed in the second of the black slots in the machine.  The first slot is white and does not have the proper shape for the internal modem. Can someone here help me get mgetty+sendfax up and running?  If so, let me know if you need additional information to start.  THANKS!
Avatar of WizRd-Linux
WizRd-Linux
Flag of Australia image

Firstly check the output of "dmesg", this will tell you what serial port the modem can be addressed on.  Once you have this there would be a configuration file for sendfax somewhere that you can specify the Serial port, or alternatively you could do it from the command line.
Avatar of cspiro
cspiro

ASKER

What a relief to hear from a human being who knows what I'm talking about.  

I ran dmesg and found that something is on ttyS0.  Here is abbreviated output:
[root@spiroc ~]# dmesg | grep "ttyS0"
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

Also, here is the output for lspci -v:
04:01.0 Communication controller: Conexant HSF 56k Data/Fax Modem
        Subsystem: Conexant: Unknown device 200f
        Flags: bus master, medium devsel, latency 64, IRQ 177
        Memory at dfbf0000 (32-bit, non-prefetchable) [size=64K]
        I/O ports at dcf8 [size=8]
        Capabilities: [40] Power Management version 2

Mysteriosly, after rebooting the linux box and I try sendfax I get this:
[root@spiroc ~]# sendfax 8069931111 /home/mdws/private/fax.g3
Trying fax device '/dev/ttyS0'... OK.
The modem doesn't respond!

The sendfax.config file is as follows:
[root@spiroc mgetty+sendfax]# cat sendfax.config
#
# sendfax configuration file
#
# this is a sample configuration file, see mgetty.info for details
#
# comment lines start with a "#", empty lines are ignored

# ----- global section -----
#
# In this section, you put the global defaults, per-port stuff is below

# tell everybody what's going on
verbose y

# ... and send everything to the log file (quite detailed)
debug 5

# which devices to use for outgoing faxes
#fax-devices modem
fax-devices ttyS0

# which fax number to transmit to the receiving station
fax-id 8139861111

# which command is used to dial out? (Could be ATD, ATDP, ATX3D0W...)
# dial-prefix ATDT

# try transmitting every page three times, continue if 3rd try fails as well
max-tries 3
max-tries-continue y

# ----- port specific section -----
#
# Here you can put things that are valid only for one line, not the others
#

# Modem on ttyS0 needs special initialization to do h/w handshaking
 port ttyS0
 modem-handshake AT&K4

# Modem on ttyS1 doesn't work reliably in class 2.0, use class 2 instead
# port ttyS1
# modem-type cls2

When looking at the sendfax log, I get:

[root@mdwebsolutions log]# tail -100 sendfax.log
10/04 08:40:21  sendfax: experimental test release 1.1.31-Jul24
10/04 08:40:21   sendfax.c compiled at Aug 20 2004, 14:58:30
10/04 08:40:21  sending fax to 8069931111
10/04 08:40:21  checking /home/mdws/private/fax.g3
10/04 08:40:21   makelock(ttyS0) called
10/04 08:40:21   do_makelock: lock='/var/lock/LCK..ttyS0'
10/04 08:40:21   lock made
10/04 08:40:21   tss: set speed to 38400 (017)
10/04 08:40:21   tio_set_flow_control( HARD )
10/04 08:40:21 yS0   fax_open_device succeeded, ttyS0 -> 4
10/04 08:40:21 yS0   reading specific data for port 'ttyS0'
10/04 08:40:21 yS0   reading /etc/mgetty+sendfax/sendfax.config...
10/04 08:40:21 yS0   conf lib: read: 'verbose y'
10/04 08:40:21 yS0   conf lib: read: 'debug 5'
10/04 08:40:21 yS0   conf lib: read: 'fax-devices ttyS0'
10/04 08:40:21 yS0   conf lib: read: 'fax-id 8139863330'
10/04 08:40:21 yS0   conf lib: read: 'max-tries 3'
10/04 08:40:21 yS0   conf lib: read: 'max-tries-continue y'
10/04 08:40:21 yS0   conf lib: read: 'port ttyS0'
10/04 08:40:21 yS0   section: port ttyS0, **found**
10/04 08:40:21 yS0   conf lib: read: 'modem-handshake AT&K4'
10/04 08:40:21 yS0   key: 'fax-devices', type=1, flags=4, data=(ignored)
10/04 08:40:21 yS0   key: 'modem-init', type=1, flags=0, data=(empty)
10/04 08:40:21 yS0   key: 'modem-handshake', type=1, flags=3, data=AT&K4
10/04 08:40:21 yS0   key: 'modem-type', type=1, flags=1, data=auto
10/04 08:40:21 yS0   key: 'modem-quirks', type=0, flags=0, data=(empty)
10/04 08:40:21 yS0   key: 'fax-send-flow', type=4, flags=1, data=7
10/04 08:40:21 yS0   key: 'fax-rec-flow', type=4, flags=1, data=7
10/04 08:40:21 yS0   key: 'max-tries', type=0, flags=3, data=3
10/04 08:40:21 yS0   key: 'max-tries-continue', type=3, flags=3, data=TRUE
10/04 08:40:21 yS0   key: 'speed', type=0, flags=1, data=38400
10/04 08:40:21 yS0   key: 'switchbd', type=0, flags=1, data=0
10/04 08:40:21 yS0   key: 'open-delay', type=0, flags=0, data=(empty)
10/04 08:40:21 yS0   key: 'ignore-carrier', type=3, flags=1, data=TRUE
10/04 08:40:21 yS0   key: 'dial-prefix', type=1, flags=1, data=ATD
10/04 08:40:21 yS0   key: 'fax-id', type=1, flags=3, data=8139863330
10/04 08:40:21 yS0   key: 'poll-dir', type=1, flags=1, data=.
10/04 08:40:21 yS0   key: 'normal-res', type=3, flags=1, data=FALSE
10/04 08:40:21 yS0   key: 'fax-min-speed', type=0, flags=1, data=0
10/04 08:40:21 yS0   key: 'fax-max-speed', type=0, flags=1, data=14400
10/04 08:40:21 yS0   key: 'debug', type=0, flags=3, data=5
10/04 08:40:21 yS0   key: 'verbose', type=3, flags=2, data=TRUE
10/04 08:40:21 yS0   key: '', type=3, flags=1, data=FALSE
10/04 08:40:21 yS0   key: 'page-header', type=1, flags=0, data=(empty)
10/04 08:40:21 yS0   key: '', type=3, flags=1, data=FALSE
10/04 08:40:21 yS0   key: '', type=3, flags=1, data=FALSE
10/04 08:40:21 yS0   key: '', type=1, flags=1, data=
10/04 08:40:21 yS0   tss: set speed to 38400 (017)
10/04 08:40:21 yS0  mdm_send: 'ATV1Q0'
10/04 08:40:31 yS0  Warning: got alarm signal!
10/04 08:40:31 yS0  mdm_read_byte: read returned -1: Interrupted system call
10/04 08:40:31 yS0  mdm_get_line: cannot read byte, return: Interrupted system call -> ERROR
10/04 08:40:32 yS0  mdm_send: 'ATV1Q0'
10/04 08:40:42 yS0  Warning: got alarm signal!
10/04 08:40:42 yS0  mdm_read_byte: read returned -1: Interrupted system call
10/04 08:40:42 yS0  mdm_get_line: cannot read byte, return: Interrupted system call -> ERROR
10/04 08:40:42 ##### failed initializing modem, dev=ttyS0, acct=""

So it looks as if the modem is not being properly initialized.

Do you know how I can troubleshoot this?

Thanks!

Okay, appreciate all the information and the fact that the modem appears to be answering when you initially open the port is a good thing.

Connect to the modem using minicom (linux version of hyper terminal) make sure you set all the options correctly.  Once you have connected try typing ATD<phone number you own> and press enter.  This will cause the modem to dial the number, dialing your mobile phone will definately prove you can dial numbers.

If that is the case then we need to look at why sendfax is unable to dial.
Avatar of cspiro

ASKER

Thanks again for the help.

When I first type 'minicom' at the command line it states initializing modem and then gives me the option to press CTRL-A and Z for the commands.  After doing that I go to 'O' (minicom configuration) and change the serial port to ttyS0 and save. Then I go to 'D' (dialing directory) where I have added my mobile number and then select 'Dial'.  At that point it tries to call and the time ticks off from 45->0.  I waited as it retried 5 times and never connected.  The error after each try is 'no connection. timed out'.

The server that the modem is in has no sound card so I don't know if it is getting a dial tone.  However, if I unplug the telephone line from the server internal fax modem into an external fax machine, I do get a dial tone on the fax machine.  The server fax modem has two openings, one with a picture of a phone next to it and the other with the word 'data' next to it.  I've tried putting the phone line into both openings but to no avail.

Do you think the modem is no good?  Just in case I've ordered a linux compatible multitech external modem.  The sendfax manual stated that all multitechs have worked very well with the program.  It will take several days to get here.

Do you have any other recommendations until then.  If I can get it to work with the conexant modem, I'll send the multitech back for a refund.

Thanks, much...
Avatar of Duncan Roe
I suspect ttyS0 is your regular serial port (to which you would connect an external modem) and your modem is elsewhere - possibly ttyS4. From your earlier posts:
ttyS0 at I/O 0x3f8
Communication controller: Conexant HSF 56k Data/Fax Modem ... I/O ports at dcf8 ...
The I/O ports are different between the 2 devices so they are different devices.

With minicom, I would use "minicom -o" to stop it trying to initialise the modem. This also ignores lock files, so don't use it on ttyS0 while mgetty is running. Use "minicom -s" to select other serial ports to try: possibly ttyS4 as I mentioned earlier (tyS0 - ttyS3 are usually reserved for 8250 / 16550 ports. Your PCI is not one of these.
To go looking for a second port, you might find it easier to use setserial. E.g. on my system:

13:15:11# setserial -a -g /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3 /dev/ttyS4
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

/dev/ttyS1, Line 1, UART: 16550A, Port: 0x02f8, IRQ: 3
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

/dev/ttyS2, Line 2, UART: unknown, Port: 0x03e8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

/dev/ttyS3, Line 3, UART: unknown, Port: 0x02e8, IRQ: 3
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal

/dev/ttyS4: No such device or address


I have legacy COM1 & COM2 ports. "UART: unknown" means no UART present in the above. Also I have no PCI serial.
You may want to modprobe PCI serial support "modprobe 8250_pci" and possibly "modprobe 8250_pnp" before running setserial.
If you do identify a serial port and want to test it with minicom, a good string to type is "AT&V<Cr>" which will display modem configuration. (<Cr> means touch Enter key)
Avatar of cspiro

ASKER

duncan roe, thanks for the additional input!

I have tried as best I can to do those things that you recommended.

Before doing set serial, I tried modprobe with these results:
[root@mdwebsolutions ~]# modprobe 8250_pci
FATAL: Module 8250_pci not found.
[root@mdwebsolutions ~]# modprobe 8250_pnp
FATAL: Module 8250_pnp not found.

At this point I went ahead with setserial and got this result:
[root@spiroc ~]# setserial -a -g /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3 /dev/ttyS4
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
        Baud_base: 115200, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal skip_test auto_irq

/dev/ttyS1, Line 1, UART: unknown, Port: 0x02f8, IRQ: 3
        Baud_base: 115200, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal skip_test auto_irq

/dev/ttyS2, Line 2, UART: unknown, Port: 0x03e8, IRQ: 4
        Baud_base: 115200, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal skip_test auto_irq

/dev/ttyS3, Line 3, UART: unknown, Port: 0x02e8, IRQ: 3
        Baud_base: 115200, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal auto_irq

/dev/ttyS4, Line 4, UART: unknown, Port: 0x0000, IRQ: 0
        Baud_base: 0, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal

The /dev directory has ttyS{1-67} and I tried set serial with all of them but everyone except for S0 showed the same 'UART: unknown' result.

Regarding minicom, I have often seen instruction on the web to enter AT, but I have no idea where to enter it.  When I open minicom, it states to press CTRL-A and Z for help, but other than following those instructions I can not get any keyboard response within minicom. In other words if I press the key 'A' nothing happens.  What am I missing?

Thanks!


ASKER CERTIFIED SOLUTION
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cspiro

ASKER

Believe it or not, when I entered 'zcat /proc/config.gz' the result was 'No such file or directory'.  So, I did a find on the file 'config.gz' and came up with nothing for the whole server!
OK, it just means redhat didn't see fit to configure"Enable access to .config through /proc/config.gz" when they built the kernel. That is a pity. RH does, however, ship the actual config files in /usr/src/linux/configs. If you find there is no /usr/src/linux on your system, you should be able to install it from your distribution CDs. Inside the configs directory will be the files corresponding to the various possible flavors of linux you can install, for instance on my system:

08:29:49$ ls configs
kernel-2.6.5-x86_64-smp.config  kernel-2.6.5-x86_64.config

(your revisions should be newer - I only have an old Fedora Core 2 partition that isn't normally mounted).
What *is* the kernel version of your RHEL4 system btw?

Once you locate your config, you can do the grep as above. However, PCI serial support wasn't always called CONFIG_SERIAL_8250_PCI. Also in the latest kernels it's no longer a separate option: it's bundled with CONFIG_SERIAL_8250. It may just be that your kernel doesn't realize the card is a serial controller.

Since you have ordered an external modem, I think your best bet for now is to run with that, when it arrives.
Avatar of cspiro

ASKER

The MultiTech modem worked like a charm.  Case solved
Yes I thought it might
I don't think the asker deserves any points back at all. He walked away from the original problem and followed my later advice to wait for the external modem. If he feels replies by other experts were also helpful, he should split the points.
Force accepted.
Vee_Mod
Experts Exchange Moderator