Search code examples
c#comgsmmodemat-command

Unable to get response from CT63 GSM modem from C# / ASP.NET


I'm currently using Sony Ericsson mobil phones for at SMS service build in C#. The communication with the SE phones is done through USB/Com driver using AT-Commands.

All is working fine with the SE phones, but they are unstable and therefore we have bought CT63 terminals from m2mtec.de as replacements.

The CT63 terminals have the same AT-commands as the SE phones, but we are having problems with the initial connection to the CT63 terminals.

If we run our service with the CT63 the port seems to open fine, but when sending as simple "AT\n" to test the connection we do not get a response from the terminal.

If we go to Windows 7 Control Panel, choose "Phone and Modem", Choose the modem properties and do a "Query Modem" on the "Diagnostics" tab the modem response as it should.

The Query Modem function sends a "ATQ0V1E0" command and the response is "OK".

After doing the "Query modem" we can communicate with the terminal through our C# service and the modem response on the "AT\n" test is "OK". After disconnection the modem an reconnection no response is recieved.

We have verified that the COM port settings is the same in the C# service as in the "Query modem" test.

Furthermore we have tried to send a "ATQ0V1E0" from our C# service. The problem is the same. Without "Query modem" test we do not get a response and after we get a "OK" as expected.

Somehow is seems as missing some kind of initialization of the modem, but there isn't any in the documentation.

Here is a log of the "Query modem" test:

09-16-2011 15:16:16.451 - File: C:\Windows\system32\tapisrv.dll, Version 6.1.7601   
09-16-2011 15:16:16.451 - File: C:\Windows\system32\unimdm.tsp, Version 6.1.7601   
09-16-2011 15:16:16.451 - File: C:\Windows\system32\unimdmat.dll, Version 6.1.7601   
09-16-2011 15:16:16.451 - File: C:\Windows\system32\uniplat.dll, Version 6.1.7600   
09-16-2011 15:16:16.452 - File: C:\Windows\system32\drivers\modem.sys, Version 6.1.7600   
09-16-2011 15:16:16.452 - File: C:\Windows\system32\modemui.dll, Version 6.1.7600   
09-16-2011 15:16:16.452 - File: C:\Windows\system32\mdminst.dll, Version 6.1.7600   
09-16-2011 15:16:16.452 - Modem type: Cinterion USB Modem
09-16-2011 15:16:16.452 - Modem inf path: oem28.inf
09-16-2011 15:16:16.452 - Modem inf section: Modem1.NTamd64.6.0
09-16-2011 15:16:16.452 - Matching hardware ID: usb\vid_1e2d&pid_004f
09-16-2011 15:16:16.452 - Opening the modem device failed with error 00000020
ATQ0V1E0 - OK
AT+GMM - EGS3
AT+FCLASS=? - (0,1)
AT#CLS=? - COMMAND NOT SUPPORTED
AT+GCI? - COMMAND NOT SUPPORTED
AT+GCI=? - COMMAND NOT SUPPORTED
ATI1 - Cinterion
       EGS3
       REVISION 01.000
       A-REVISION 01.001.01
ATI2 - OK
ATI3 - OK
ATI4 - OK
ATI5 - OK
ATI6 - OK
ATI7 - OK

Any ideas of what can be the problem?

Thanks!

/Thomas


Solution

  • After several hours of testing and different setups I have changed the SMS library we are using. The library used kernal32.dll, but now we have changed to use .NET's build in SerialPort class.

    When using the SerialPort Class we have succeded in communicating with the modem on our development environment (Windows 7 64-bit).

    Unfortunately we can't connect to the modem on the production environment running Windows Server 2008 64-bit, but thats another issue. Please see new question with title "SerialPort connect problem on Windows 2008 when connecting to GSM modem (DT-63)"