# hylafax & USB modem



## qsecofr (Apr 29, 2011)

Hi,

I recently bought a USB hardware fax modem for use with hylafax.  That's the big idea anyway..  The hardware is: Rosewill RNX-USB K/V.92 hardware-based data/fax modem.  It is seen on my system as: 
	
	



```
ugen0: <Conexant USB Modem, class 2/0, rev 1.10/1.00, addr 2> on uhub0
```
.

My system is FreeBSD7.2 release.
Hylafax is version hylafax-6.0.5 installed from ports.  After which it prompted my to edit /etc/ttys and add:

```
cuad1   "/usr/local/sbin/faxgetty"     dialup  on      secure
```

I didn't know any better.  I expected without an "enable=YES" in /etc/rc.conf that nothing would start up.  Immediately, almost, messages were logged about wedging:

```
Apr 27 02:42:23 motive FaxGetty[22494]: OPEN /dev/cuad1  HylaFAX (tm) Version 6.0.5
Apr 27 02:43:32 motive FaxGetty[22494]: /dev/cuad1: Can not initialize modem.
Apr 27 02:46:49 motive FaxGetty[22494]: Unable to setup modem on /dev/cuad1; giving up after 2 attempts
Apr 27 02:46:49 motive FaxGetty[22494]: MODEM /dev/cuad1 appears to be wedged
Apr 27 02:46:49 motive FaxGetty[22494]: MODEM /dev/cuad1 appears to be wedged
Apr 27 02:46:49 motive FaxGetty[22494]: CLOSE /dev/cuad1
```

So I commented out that line and rebooted, which stopped the messages.  
But before that I had tried 
	
	



```
cu -l cuad1
```
 to see if I could communicate with the modem, as per the hylafax website.  Nothing.  Not before, or after.  I tried simply adding the entry without the getty as 
	
	



```
cuad1   none                    dialup  off insecure
```
 and no difference.  The response is "Connected" and then a hung terminal.  I have to kill the job by PID from another session.

And the phone company hasn't yet connected the line.  Would that matter?  The USB device has 2 LEDs, both of which are unlit.

Long story.  I'm hoping to figure out if this modem in particular will work with my system and hylafax.  If not, there's always the possibility of a PIC internal modem.  

Any advice much appreciated!


----------



## SirDice (Apr 29, 2011)

cuad0 and cuad1 are usually the 2 serial ports most PCs have. 
The modem might work if you kldload umodem(4).


----------



## wblock@ (Apr 29, 2011)

Shouldn't it be /dev/cuaU0?  Look in /dev and see what device is created.


----------



## qsecofr (May 1, 2011)

I think you're both right.  I took the modem upstairs to try in my workstation since the phone cord won't reach all the way across the room downstairs.  The workstation dual boots Win7 and FreeBSD8.1.  Modem software drivers failed to install on Windows, which surprised me.  So I booted FreeBSD.  (this is after placing a few phone calls to/from the new phone line to verify it's operational)

After plugging in USB modem, FreeBSD would not recognize it (in /var/log/messages) correctly until 
	
	



```
kldload umodem.ko
```
 was loaded.

Next step was install comms/hylafax.  The postinstallation message, in part, instructed: 
	
	



```
When you are asked to specify the name of tty device, use "cuad1"
        instead of "ttyd1".  Otherwise it does not work well.
```
And I did, this being the second time.  Utility faxsetup replied 
	
	



```
/dev/cuad1 is not a terminal device.
```
  So I looked, and seeing /dev/cuaU0, typed it in and proceeded.  Both faxsetup and faxaddmodem seemed to complete normally.


```
ps -aux
```
 showed faxq was running.  I started hafxd. and 
	
	



```
/usr/local/bin/faxstat
```
 produced 





> Warning, setsockopt(TOS): Invalid argument (ignored)
> Warning, setsockopt(IP_TOS): Invalid argument
> HylaFAX scheduler on my_host.my_domain.net: Running


Even 
	
	



```
cu -l cuaU0
```
 produced 
	
	



```
RING

RING

RING

RING
at+fclass=1
OK
at+ftm=?
3,24,48,72,73,74,96,97,98,121,122,145,146

OK
```

So next step seemed to be to try and dial out and send a test, consisting only of the default cover sheet.  Not knowing who else to annoy, I decided to ring my own cell phone just to hear the attempt being made.

```
sendfax -d xxxyyyzzzz
```
 just hung the terminal.  Of course I used my real number, and 10-digit local dialing is the rule here.  /var/log/debug.log showed 
	
	



```
Apr 30 18:33:05 power HylaFAX[19832]: checkHostIdentity("localhost")
Apr 30 18:33:05 power HylaFAX[19832]: Parsing hostPort(): "EPRT"
Apr 30 18:33:05 power HylaFAX[19832]: Parsing "|2|::1|36018|"
Apr 30 18:33:05 power HylaFAX[19832]:  `-> s.length() = 13
Apr 30 18:33:05 power HylaFAX[19832]:  `-> s[0] = '|'
Apr 30 18:33:05 power HylaFAX[19832]:  `-> s[2] = '|'
Apr 30 18:33:05 power HylaFAX[19832]:  `-> s[12] = '|'
Apr 30 18:33:05 power HylaFAX[19832]: Looks like extended syntax: "|2|::1|36018|" [7C: |]
Apr 30 18:33:05 power HylaFAX[19832]: `-> Got a: ::1[7]
Apr 30 18:33:05 power HylaFAX[19832]: `-> Got a: 36018[13]
Apr 30 18:33:05 power HylaFAX[19832]: Parsed: Family 2 Address ::1 Port 36018
```
 which I didn't interpret as either success or error.

Would the format of the dial string depend on the setup utilities?  Should I use something like "+1-xxx-yyy-zzzz" etc?  The sendfax requires more options and/or a real postscript file to send?


----------



## qsecofr (May 1, 2011)

I re-read the sendfax man page and re-formatted the command. 

```
/usr/local/bin/sendfax -v -f "user@example.com" -R -x "home_test" -r "first_fax" -c "testing" -d "user@xxxyyyzzzz" ~/some.pdf
```


```
/usr/local/bin/faxstat -f
Warning, setsockopt(TOS): Invalid argument (ignored)
Warning, setsockopt(IP_TOS): Invalid argument
HylaFAX scheduler on host.example.com: Running
Warning, setsockopt(IP_TOS): Invalid argument

-rw----   1     root    11300 May  1 06:09 cover1.cover
-rw----   1     root    87525 May  1 06:09 doc1.pdf.1
```


```
/usr/local/bin/faxstat -s
Warning, setsockopt(TOS): Invalid argument (ignored)
Warning, setsockopt(IP_TOS): Invalid argument
HylaFAX scheduler on host.example.com: Running
Warning, setsockopt(IP_TOS): Invalid argument

JID  Pri S  Owner Number       Pages Dials     TTS Status
1    127 W   root 9716456005    0:0   0:12
```

But no indication I can tell of an actual ring out.  Certainly no ring on my other line.

I'm guessing I've successfully submitted a fax job onto the queue.  daemon faxq and hfaxd are running.  Possibly I misconfigured something?


----------

