OpenWrt Forum Archive

Topic: ISDN USB problems...

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all.  Has anybody had any success with using a USB ISDN modem with openwrt?
I have a Microlink modem connected to an ASUS WL-500G, which should work with the
hisax_st5481 driver. I have tried numerous things which I suppose may be of interest to
some.

1. The build-root (stable from CVS) version can not compile the hisax_st5481 module
   as there seems to be a problem with some USB-related variables. After a lot of
   searching around I found that the problem is caused by 200-i4l.patch which, when
   applied, reverts the isdn drivers to a version that is not compatible with current
   version of the kernel (2.4.30). The compile fails in st5481.h (look at line 11709 of
   the patch where "struct usb_ctrlrequest" is replaced with "devrequest"...)

2. Without the 200-i4l.patch and 201-hfc_usb_backport.patch patches, I can compile
   the ISDN drivers without problems. Nevertheless, insmod isdn.o complains about
   undefined symbol "strcpy". I managed to overcome this by statically linking
   a custom version of strcpy with the isdn.o module (I have a kernel patch if anyone
   is interested).

3. Next I made an ipkg of ISDN tools, which can be found at:
   http://www.cslab.ece.ntua.gr/~chazapis/ … mipsel.ipk
   This includes isdnctrl, ipppd and imon (which requires ncurses). The build-root
   patch for that is in http://www.cslab.ece.ntua.gr/~chazapis/ … tils.patch
   (again if anyone is interested).

Everything seems fine with the drivers (at least at the version printing level).
This is what I get from logread:

---

Jan  1 02:25:51 (none) kern.notice kernel: ISDN subsystem Rev: 1.1.4.1/1.1.4.1/1
.1.4.1/1.1.4.1/1.1.4.1/1.1.4.1 loaded
Jan  1 02:26:00 (none) kern.info kernel: HiSax: Linux Driver for passive ISDN ca
rds
Jan  1 02:26:00 (none) kern.info kernel: HiSax: Version 3.5 (module)
Jan  1 02:26:00 (none) kern.info kernel: HiSax: Layer1 Revision 1.1.4.1
Jan  1 02:26:00 (none) kern.info kernel: HiSax: Layer2 Revision 1.1.4.1
Jan  1 02:26:00 (none) kern.info kernel: HiSax: TeiMgr Revision 1.1.4.1
Jan  1 02:26:00 (none) kern.info kernel: HiSax: Layer3 Revision 1.1.4.1
Jan  1 02:26:00 (none) kern.info kernel: HiSax: LinkLayer Revision 1.1.4.1
Jan  1 02:26:00 (none) kern.info kernel: HiSax: Approval certification failed be
cause of
Jan  1 02:26:00 (none) kern.info kernel: HiSax: unauthorized source code changes
Jan  1 02:26:05 (none) kern.info kernel: hiax_st5481: ST5481 USB ISDN driver v0.
1.0
Jan  1 02:26:05 (none) kern.info kernel: usb.c: registered new driver st5481_usb
Jan  1 02:26:05 (none) kern.info kernel: st541: found adapter VendorId 0483, Pro
ductId 4810, LEDs 2
Jan  1 02:26:05 (none) kern.info kernel: HiSax: Card 1 Protocol EDSS1 Id=st5481_
usb0 (0)
Jan  1 02:26:05 (none) kern.info kernel: HiSax: DSS1 Rev. 1.1.4.1
Jan  1 02:26:05 (none) kern.info kernel: HiSax: 2 channels added
Jan  1 02:26:05 (none) kern.info kernel: HiSax: MAX_WAITING_CALLS added

---

But the modem does not work... I tried with microcom to dial but I always get
NO CARRIER. I have set the MSN, the buffer and everything. Then I've searched
Google with every possible string and have found no answer.  I suppose this must
be a driver problem or something.

Does anybody know where this 200-i4l.patch comes from?
Maybe there is a newer version that can sort things out.

Has anyone had similar experience with ISDN on openwrt?
Any ideas?

Update:

Nobody has replied to my post for days... Nevertheless, I found that
the isdn patch (200-i4l.patch) originates from the official www.isdn4linux.de distribution.
It is the diff of the isdn drivers CVS version when applyied to the 2.4.x
kernel tree. The USB "devrequest" in the st5481 driver is present in
the CVS version, while updated in the latest 2.4.x kernel... Go figure...

However, the patch provides a kernel option for USB ISDN adapters using the HFC-USB
chipset. So, I dumped the Microlink ISDN modem and bought a Tornado WJT Pocket II:
http://www.allieddata.com/asp/products_ … ;brandid=2
This is widely available in Greece and must actually be the same as the
Billion Tiny USB TA: http://www.billion.com/product/isdn/biptiny.htm
And the Gazel 128 USB: http://www.bewan.fr/bewan/produits/rnis/gazel128usb.php

Then I compiled a new ISDN kernel module with a custom strcpy which can be found
here: http://www.cslab.ece.ntua.gr/~chazapis/ … mipsel.ipk
This module works with the ASUS fine.

Then I bought a USB hub (the WL-500G has only one USB port), and a USB stick.
I installed asterisk on the stick (from the ipkg) and after a lot of customization of
the asterisk installation and configuration files, I now have an ISDN pbx running at
home with 4 SIP users sharing the two ISDN channels (the 4 SIP users come from
2 Linksys PAP2 ATAs).

If anyone is interested in trying this, I have to note some important asterisk stuff:
* You will need chan_modem.so, chan_modem_i4l.so and a modem.conf.
  You can find those here: http://www.cslab.ece.ntua.gr/~chazapis/ … dem.tar.gz
  Edit modem.conf and set "driver=i4l" and (VERY IMPORTANT) "dtmfmode=i4l".
  If you use asterisk for DTMF detection you will get 99% CPU usage and crapy sound.
* Edit modules.conf and load only the _absolutely_ necessary. These router
  devices are very low on memory. I also created a swapfile in the USB stick
  in case things get really tight.
* Run everything in one codec, ideally slinear or ulaw/alaw. I use ulaw everywhere.
  The "show translation" command states that ulaw<->slin conversion needs 1 msec.
  I converted all asterisk sounds from the 1.2 distribution to ulaw (you can
  find those here: http://www.cslab.ece.ntua.gr/~chazapis/ … aw.tar.gz).
  Put the sounds in .../usr/lib/asterisk/sounds. Also I use voicemail and store messages
  in ulaw format.
* If you want music-on-hold check this out: http://www.voip-info.org/wiki-Asterisk+mpg123+faking+it
  I use Switch (http://www.nch.com.au/switch/index.html) to convert files in raw format.
  Use .raw output and set the codec to "16 bit PCM (LE)" format, "8000" sample and "1 - Mono"
  channels. Then put your files in .../usr/lib/asterisk/mohraw and rename them so they end
  in ".mp3". You can play the files with a custom music-on-hold script like the "rawplayer"
  found in the voip-info wiki.

I would assume the USB ISDN modem should be supported by the ACM driver?

I have posted over at wl500g.info about getting an ISDN modem working with Openwrt. Works great.

http://wl500g.info/showthread.php?t=510

Hi Antony!

I was searching the forum for isdn and your posts popped up... just what I was looking for...
But I have some problems accessing files on urls you posted (receiving access denied)

Can you, please, mail me or tell me how/where could I pick those packages?

Thanks!

mculibrk

Sorry, the files should now be online.

I also have added a package for hdparm, because I moved
everything to an ASUS WL-HDD 2.5, which has an internal IDE drive.
I wanted to be able to spin down the drive after some time of inactivity.

hdparm -S 60 /dev/discs/disc0/disc, will shut down the hard disk after 5 minutes.
The package is here: http://www.cslab.ece.ntua.gr/~chazapis/ … mipsel.ipk

*** After a lot of trial and error I found that asterisk will only
let the disk to shut down if /var/spool/asterisk is in memory.
Else, the disk will spin down and then immediately restart...

It also seems that there is another post on this subject,
where you can find USB ISDN drivers with ppp support
and so on... (http://forum.openwrt.org/viewtopic.php?id=4836)

Antony

(Last edited by antony on 25 Mar 2006, 02:16)

Thanks Antony!

May I ask you to post the sources of the "packages" if you managed to write them? (I mean makefiles and configs for openwrt usage)
Just to not redo things already done... wink

Since, I'm moving to 2.6 I have to recompile anyway...

Regards,
MCulibrk

(Last edited by mculibrk on 27 Mar 2006, 12:58)

antony wrote:

Sorry, the files should now be online.

I also have added a package for hdparm, because I moved
everything to an ASUS WL-HDD 2.5, which has an internal IDE drive.
I wanted to be able to spin down the drive after some time of inactivity.

hdparm -S 60 /dev/discs/disc0/disc, will shut down the hard disk after 5 minutes.
The package is here: http://www.cslab.ece.ntua.gr/~chazapis/ … mipsel.ipk

*** After a lot of trial and error I found that asterisk will only
let the disk to shut down if /var/spool/asterisk is in memory.
Else, the disk will spin down and then immediately restart...

It also seems that there is another post on this subject,
where you can find USB ISDN drivers with ppp support
and so on... (http://forum.openwrt.org/viewtopic.php?id=4836)

Antony

Can you provide svn diff patches against Kamikaze brcm-2.4, so that we can include it to the distribution?

thx
wbx

I've made these modules a long time ago and I don't remember exactly where the files are... I'll try to redo the process and post the diffs one of these days.

You say you are moving to 2.6? What kind of hardware are you using? Can I also run linux 2.6 on my ASUS WL-HDD 2.5?

Antony

Hi!

I'm using (well, really plan to use) the Asus WL500GD (Deluxe, or X) as the main platform.
Why wl500gd? It has 32MB RAM, USB (4x 2.0!), 2x COM and 3x GPIO pins available (it seems like the hardware was made just for "upgrade" and "hacking" - all extensions are on pin haders, nicely marked... a lot of extra space in the housing...)
It has only 4MB of flash but this is enough for what I need and there is always the usb where you can add usb sticks (or a read hdd) and have plenty of space.
I also need ISDN (I have same small usb-isdn modems which fit in the original router case/housing) that's why a usb port is a requirement.

The main reason of using kernel 2.6 is native ipsec support (besides all the other "nice" stuff).

I'm not 100% sure but as the wl-hdd is using BC 47xx core and that is supported by OpenWrt, I suppose it should work.

Ah, I really do not need the wireless (at this time) so I do not care about that - as far as I know, the open-source wireless support for 2.6 is not jet "production ready"...

Regards,
MCulibrk

Antony,

can you please tell me what did you do to acctually compile/link isdn modules right?
I'm going crazy because the "native" isdn.o module on load keeps saying "unresolved symbol strcpy" even if the compile/image creation completes OK.

We tried to "statically" link the strcpy function in isdn_common.c and change all references to strcpy in other sources under isdn to the "new" function but the result is the same - "unresolved symbol strcpy"...

We checked the Makefiles on kernel 2.4.32 and other versions where isdn is compiled ok (2.6.17) but there is no obvious differences....

There must be some sort of typo or something which causes isdn.o to fail on load (missing external symbol strcpy) but we're unable to (quickly) locate  that.
Strange, because strycpy is used in other modules too and it's working...

Any suggestion?

Thanks,
M.Culibrk

Well, as I remember, I created a file named isdn_strcpy.c in the isdn directory and added the corresponding object in the Makefile. I searched my files and found a diff I was using for this. Here goes:

diff -Nur linux-2.4.30/drivers/isdn/Makefile linux-2.4.30.patched/drivers/isdn/Makefile
--- linux-2.4.30/drivers/isdn/Makefile  2002-08-03 03:39:44.000000000 +0300
+++ linux-2.4.30.patched/drivers/isdn/Makefile  2005-11-21 02:45:33.000000000 +0200
@@ -11,7 +11,7 @@
 # Multipart objects.

 list-multi     := isdn.o
-isdn-objs      := isdn_net.o isdn_tty.o isdn_v110.o isdn_common.o
+isdn-objs      := isdn_net.o isdn_tty.o isdn_v110.o isdn_common.o isdn_strcpy.o

 # Optional parts of multipart objects.

diff -Nur linux-2.4.30/drivers/isdn/isdn_strcpy.c linux-2.4.30.patched/drivers/isdn/isdn_strcpy.c
--- linux-2.4.30/drivers/isdn/isdn_strcpy.c     1970-01-01 02:00:00.000000000 +0200
+++ linux-2.4.30.patched/drivers/isdn/isdn_strcpy.c     2005-11-21 02:45:33.000000000 +0200
@@ -0,0 +1,8 @@
+char *strcpy(char *dest, const char *src) {
+       int __i;
+       for (__i = 0; src[__i] != '\0'; __i++)
+               dest[__i] = src[__i];
+       dest[__i] = '\0';
+       return dest;
+}
+

I had this file named "200-i4l_strcpy.patch" and copied into the directory containing all the kernel patches. At OpenWRT compile time this would be aplied automatically.

Hope this helps!

Thanks for details!
It works now!

But I cannot understand why the module load fails after we added another function in isdn_common.c (strcpy_new) and changed all references to strcpy to strycpy in other isdn_*.c sources....
Why this works if the function is simply put in another source and linked in...

Thanks!

m.culibrk

The discussion might have continued from here.