# Something really ancient - a modem / pyserial

## depontius

Really all I really want is a "demon dialer", at the moment.  In a week I'm going to be trying to make a call to a very busy number, and I'd like my computer to do most of the work for me, letting me know when it gets through.

I dug into the boxes, and have two modems.  One is a good old US Robotic 33.6 hardware modem - but my current computer doesn't have a serial port.  The other is my late mother's "Best Data V.92 56k USB" modem.  The latter is plugged in and dmesg says:

```
[26806.792511] usb 2-1: USB disconnect, device number 2

[30262.663841] usb 9-5: new full-speed USB device number 8 using ohci-pci

[30262.840697] usb 9-5: New USB device found, idVendor=0572, idProduct=1301

[30262.840702] usb 9-5: New USB device strings: Mfr=1, Product=2, SerialNumber=6

[30262.840705] usb 9-5: Product: HSF USB V.90 Data/Fax Modem

[30262.840707] usb 9-5: Manufacturer: Conexant Systems, Inc.

[30262.840709] usb 9-5: SerialNumber: 00000001
```

If I do "ls -l /dev", tty12 has a new time-date stamp, but is currently root-only, no group access.  I've installed pyserial and minicom, but am unsure where to go from here.  Perhaps the odd and confusing thing is the fact that tty12 has no access for the "tty" group, as the other ttys do.  It also seems to get updated every so often, so I'm not sure how well chmod or chgrp would stick.

The web page says that this is a hardware modem, not a winmodem.  I have "CONFIG_USB_ACM=m", but it's not currently loaded.  Manually loading cdc-acm issues a message, but unplugging and replugging the modem does nothing different.

There is certainly more stumbling to do here, but if anyone has pointers, I'm interested.

----------

## roarinelk

What happens if you do the following:

```
insmod cdc_acm

echo 0x0572 0x1301 > /sys/bus/usb/drivers/cdc_acm/new_id
```

?

----------

## NeddySeagoon

depontius,

There are two bad signs it dmesg there. HSF and Conexant.

I'm fairly sure HSF means its a software modem.

I don't see it picking up a driver either. (3rd bad sign?)  

Its one of the linuxant modems.

I'm surprised that page is still around.  I hope the driver works with modern kernels.

When you get the fake serial port to talk to, point minicom at it and type AT (not case sensitive).

When all is well, the modem will respond Ok.

-- edit --

The driver page says it works with the 2.6.9 kernel.

-- edit 2 --

Ahh ... I remember that.

 *www.linuxant.com/drivers/ wrote:*   

> Because the scope of this project has grown beyond the capacity of a single volunteer and legal issues prevent us from using a classic open-source development model, the HCF and HSF drivers are now available in two editions:
> 
> a free version (limited to 14.4Kbps data), available at no cost. Please use it to test if your hardware is compatible.

 

----------

## Ant P.

 *NeddySeagoon wrote:*   

> depontius,
> 
> There are two bad signs it dmesg there. HSF and Conexant.
> 
> I'm fairly sure HSF means its a software modem.

 

I recognise those three letters too. Maybe you'll get lucky and the USB interface will protect you from the horrors within. If all you're doing is dialling numbers it might work, since you can't do much else with those.

Finding a USB-serial adapter for the real modem would probably be a better idea.

----------

## depontius

 *roarinelk wrote:*   

> What happens if you do the following:
> 
> ```
> insmod cdc_acm
> 
> ...

 

```
[44246.952086] cdc_acm 9-5:1.0: Zero length descriptor references

[44246.952096] cdc_acm: probe of 9-5:1.0 failed with error -22

[44246.952168] cdc_acm 9-5:1.1: ttyACM0: USB ACM device
```

Rather weird, the web page I found suggests that it's a real hardware modem, but the HSF it reports says otherwise.

I'll have to take a look at the Linuxant drivers.  Though I've been signing my kernels for a while, and am not sure what is involved in signing an out-of-kernel module.  No big problem, just an annoyance.  We'll also have to see how it does with a new kernel.

Might need to look for a USB/serial adapter.  Problem is that I need to be demon dialing Saturday morning, so that might mean Staples or Best Buy.  I guess Amazon Prime would get it here in time, too.  Probably not standard Newegg.

----------

## NeddySeagoon

depontius,

You only care about the Hayes command set and auto dialer.  You won't be sending any data .. you hope.

If /dev/ttyACM0 actually exists and belongs to the modem, point minicom at it and try 

```
ATZ

wait for the Ok response

ATDT<phone_number>
```

Thats reset and tone dial <phone_number>.

----------

## depontius

No /dev/ttyACM0.  Despite what the web page said, the HSF on dmesg makes it quite clear that this is a winmodem, in spite of only being USB1.  I did download the conexant drivers, and those are toast.  They were done against kernels 2.4 or 2.6, and at the moment it looks like they won't go against 4.x.  I dislike stuff like "run cnstinstall.run" as root.  I know I need to be root to actually install, but I'd rather minimize the time as root, and not do the whole thing that way - including authenticating as root in a firefox session.

Anyway, I used --keep and --target, and got the stuff somewhere where I could look for it.  I had to download the actual drivers - which also wanted me to do the whole process as root.  I then found the source code to the module and simply tried "make" against it.  It failed to find "asm/system.h".  ISTR in the past few years that the kernel guys tried to really push back on asm code, and get more of it into c.  Looking in /usr/src/linux/include I find asm-generic, but in there, there is no system.h to be found.

I've ordered a usb-to-serial converter from Amazon - one that mentioned Linux right in the description.  I dug out my old USR 33.6k modem, plugged it in to make sure lights still lit up, and put it on a shelf to wait until the usb-to-serial adapter gets here (Amazon Prime) in a few days.

I also installed "iwar" from the sunrise overlay, in case that can be persuaded to do what I need.  Otherwise it will be a bit of a rush to have this all in place by 9:00EST, 7:00MST on Saturday.

----------

## cboldt

I have a

/usr/src/linux-4.9.6-gentoo-r1/tools/perf/util/include/asm/system.h

Not much help in getting tools compiled for your modem.

As for splitting your time between root and an non-privileged user, I do all browsing non-privileged, including downloading.  The tools acquired can be used by root, without root going online.

----------

## depontius

OK, I've given up on my mother's modem.  I believe I've also given up on my external modem, too.

I ordered a USB-serial adapter and am using it with a friend's external modem.  I can dial with both minicom and iwar.  I haven't even tried a data connection, but then again, for my immediate application I don't care.  I just want it to dial.

However I can't get iwar to war-dial.  It doesn't seem to be detecting the busy signal.  I can add the "X4" init code, and things hang up after the busy signal, but iwar doesn't seem to register it.  It has a status page, and on that the Busy count stays at 0.  Plus since it doesn't detect busy, it doesn't redial.

I can sort of wardial with minicom, by hitting the spacebar every time, but I'd really prefer something automated.  I'm anticipating a 3-hour sit, trying to get through to this one phone number.  (That's the way it went on March 1, using the redial button on the phone.)

I've attempted to use pyserial, but so far it looks like a loopback - everything I send, I receive back, instead of "OK".  It doesn't get a dial tone, and I hear no dialing.  I've given it the same init string being used by iwar.

Help!?!?

----------

## NeddySeagoon

depontius,

Use chat.  You write a script for cat to follow.

The man page example should be all you need.

----------

