How to install Hylafax server on Debian using RockForce QUATRO+ 4 port analog board
Reciently i have been playing around with installing hylafax server for a client. At first i tried to go the route of buying 4 seperate fax modem cards and trying to get them all working in linux. Bad idea. Much better and easier is to get the correct hardware . I went with the Mainpine 4 port modem. Unfortunatly there is absolutly no support for installing this board, the company that sells it tells me that is compatible with hylafax with no modifications needed it should detect it from the start. We will see
So here we go this is how i did it.
How to install Hylafax server on Debian using RockForce QUATRO+ 4 port analog board
1) Install Mainpine Board, just put it in a pci slot.
2) Install Debian (see how to get started with Debian(HERE).
NOTE: I TRIED TO MAKE THIS WORK WITH 2.6 with out success. As of this writing, use stable 2.4 or these directions may not work.
3) apt-get install setserial minicom (make sure and set the setserial program to MANUAL.
THEN I HAD TO EDIT THE FILE TO SET UP THE MODEM TO WORK UPON BOOT OR REBOOT (TRY STEP B FIRST TO GET THE SETTINGS THEN GO BACK TO STEP A WHICH IS THE ACTUAL SETUP
a) nano /var/lib/setserial/autoserial.conf
#copy and paste these lines into your autoserial.conf
#make sure and change the values to be what your system
#needs. You find this out by following the dir below (d)
# i needed this line to remove the autodetect settings
# or i was getting a conflict with out it.
/dev/ttyS4 port 0xbc60 irq 22 autoconfig ^fourport
# this is the actual configuration, i needed the above
# line in to remove autodetected settings before it worked
/dev/ttyS0 port 0xbc00 irq 22 autoconfig ^fourport
/dev/ttyS1 port 0xbc08 irq 22 autoconfig ^fourport
/dev/ttyS2 port 0xbc10 irq 22 autoconfig ^fourport
/dev/ttyS3 port 0xbc18 irq 22 autoconfig ^fourport
/dev/ttyS4 set_multiport port1 0xbc60 mask1 0x0f match1 0x00
##### END OF CONFIG CODE, REMEMBER port numbers and irqs
##### DIFFERENT on each system, edit them accordingly
If the tty ports are not there then you have to edit your grub (menu.lst) file.. here is how mine looks...
title Debian GNU/Linux, kernel 2.6.21-2-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.21-2-686 root=/dev/sda1 ro 8250.nr_uarts=16
initrd /boot/initrd.img-2.6.21-2-686
savedefault
title Debian GNU/Linux, kernel 2.6.21-2-686 (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.21-2-686 root=/dev/sda1 ro single
initrd /boot/initrd.img-2.6.21-2-686
savedefault
Notice how i have the "8250.nr_uarts=16" after the root=/dev/sda1 ro... this is waaaay easier then recompiling the entire kernel which is what just about everyone else tells you to do. Man I spent hours trying to figure out that little goodie.
Moving on...
b) THIS IS THE SECTION THAT ALLOWS YOU TO FIGURE OUT WHAT TO DO IN STEP A
SETUP THE MAINPINE HARDWARE BOARD FOLLOW THE INSTRUCTIONS http://www.mainpine.com/linuxsupport.html
and more specifically for the 4 port HERE: http://www.mainpine.com/linuxsupport.html#QUATRO
for your ease of use i have copied and pasted the directions here
---------------------------------------------------------
Log in as root, and type:
/sbin/lspci -d 1522:*
This will display all Mainpine boards in your system and will produce output similar to this:
00:0a.0 Modem: MainPine Ltd PCI IOBus Bridge (rev 32)
Then type the following, replacing the green section below with the output from your system that corresponds to the green section above:
/sbin/lspci -nvs 00:0a.0
You will then see something like this:
00:0a.0 Class 0703: 1522:0100 (rev 32)
Subsystem: 1522:0d00/
Flags: medium devsel, IRQ 10
I/O ports at e000 [size=128]
Memory at df100000 (32-bit, non-prefetchable) [size=1M]
If the value above in bold, in this case 0d00, is either 0200, 0300, 0400 or 0500 then you have an older revision board, you would need to go to the mainpine site to get instructions.
00:0a.0 Class 0703: 1522:0100 (rev 32)
Subsystem: 1522:0d00
Flags: medium devsel, IRQ 10
I/O ports at e000 [size=128]
Memory at df100000 (32-bit, non-prefetchable) [size=1M]
This tells us two pieces of information that we need. Firstly, the board interrupt (in this case 10) and the i/o base address (in this case e000). The first port is located at the base address, and each subsequent port is located at an i/o address 8 bytes further on. In the example case, that means the second port is located at address E008. There is also something we have to configure for proper operation called an interrupt latch. It is important that it is properly configured, as system errors may occur otherwise, so only put this in startup files once it is tested. The address of the latch is 60h further on than the base address - for example E060 in this case.
This translates to the following:
Device
i/o addr calculation
Example i/0 addr
Port 1
Base+0x00
0xE000
Port 2
Base+0x08
0xE008
Port 3
Base+0x10
0xE010
Port 4
Base+0x18
0xE018
Multiport Interrupt Status Register
Base+0x60
0xE060
So, putting this together, in order to configure the board, we type:
setserial /dev/ttyS4 port 0xE000 irq 10 autoconfig ^fourport
setserial /dev/ttyS5 port 0xE008 irq 10 autoconfig ^fourport
setserial /dev/ttyS6 port 0xE010 irq 10 autoconfig ^fourport
setserial /dev/ttyS7 port 0xE018 irq 10 autoconfig ^fourport
setserial /dev/ttyS4 set_multiport port1 0xE060 mask1 0x0F match1 0x00
The parts highlighted above in colour are the ones that change based on your system. All the rest must remain the same. There is one caveat to this, we are assuming the system automatically assigns the first port to ttyS4. This is almost always the case, but if the system automatiically assigns another value then you should start with that and increment for each additional port.
The system configuration can then be checked by typing:
setserial /dev/ttyS4
This will produce output similar to:
/dev/ttyS4, UART: 16550A, Port: 0xe000, IRQ: 10
You can also confirm that the interrupt latch is properly configured by typing the following:
setserial /dev/ttyS4 get_multiport
The results will look similar to this:
Multiport config for irq 10:
Port monitor = 0x0
Port1 = 0xe060, mask=0xf, match=0x0
Port2 = 0x0, mask=0x0, match=0x0
Port3 = 0x0, mask=0x0, match=0x0
Port4 = 0x0, mask=0x0, match=0x0
Do not be confused by the listing of 4 ports here - these refer to 4 possible latch configurations, and only Port1 will have non-zero values.
Now the board is properly installed, you can test it by using the minicom program that is a part of most standard Linux distributions. If you run it using the -o option then it will not try and initialise the modems when you connect. Open minicom, press ctrl-A and then "o" to enter the setup menu where you can select /dev/ttyS4 for example. Once connected, if you type AT and press enter, the modem should respond with OK. You can also type ATI and enter, and the modem will respond with information about itself.
c)Run Minicom and make a couple of test calls. Make sure your new 4 port board is working properly.
4) apt-get install hylafax-server
5) run faxsetup (it should run it automatically)
--Just answer all the questions default.
--it has been suggested instead of 600 for the permissions set them to 0644, 0644, 0666 see http://www.aboutdebian.com/fax.htm
6) run faxaddmodem (it should run it automatically)
--Answer all questions default(unless you want to change speaker volume for testing purposes, i set it to high
after scanning the modem you will get an output similar to:
Probing for best speed to talk to modem: 38400 19200 OK.
If you don't see the OK then you might have a problem.
7) run faxadduser -u username -a adminpassword -p nonadmin password
-username is the name of a VALID USER ACCOUNT on the system. (It took me a while to figure that out)
-adminpassword (if you set this then this user will have admin fax rights, dont set it for normal users)
-noadminpassword set this so that you have some control over user behavior
(repeat as necessary for each user on the system, don't forget to create system accounts before adding them as a fax user)
8) Reboot the system and make sure everything comes on line in case of reboot. If not, fix it.
faxstat
=enter password for an admin fax user=
You should get a message that the HylaFAX scheduler: Running
And a second line that will tell you the modem is idle and waiting.
9)Try to send a fax
For Windows I found WinPrint HylaFAX at http://winprinthylafax.sourceforge.net to be the easiest to set up and use It's a send-only client that sets up a printer. You then simply modify to printer port properties to point to the IP address of your fax server.
The above Web page not only provides a download link for the software but has detailed directions with screen shots on how to set up the WinPrint HylaFAX client.
10) We are planning to route incoming faxes baised on caller id, that is to say, we will accept the call on our pbx system with digital PRI and DID fax numbers for each person in the company. We then send the call out through an analog extension board into our mainpine lines. As we send the call in, we have modified the caller id of the call to reflect the DID coming from the digital PRI. In effect, when a fax comes in on DID 555-5551 we know that needs to go to Bob. We send it out through channel 1 on our analog extension board in to port 1 of our mainpine(this could be any open port, the phone system will take care of this for us) We set the Caller ID to be the same as the DID. Next do this:
nano /var/spool/hylafax/etc/FaxDispatch
In FaxDispatch I had something like:
case "$CIDNUMBER" in
1234) SENDTO=me@xxxxxxxxxxxx;FILETYPE=pdf;;
esac
Just add this block of code for each user you would like to route to and then make sure your phone system is correctly set up to send the correct CIDNUMBER baised on the DID number coming in.
This should be the entire setup you would need to send and recieve faxes. We will get to install this server in a production tomorrow to see if this actually works.

Recent comments
2 years 13 weeks ago
2 years 23 weeks ago
2 years 23 weeks ago
2 years 28 weeks ago
2 years 35 weeks ago
2 years 37 weeks ago
2 years 49 weeks ago
2 years 49 weeks ago
2 years 50 weeks ago
3 years 12 weeks ago