I am writing client-server application.
The client sends some messages to the server by using different transports: SMS and Internet (VPN, TCP server).
On the client's PC I have 1 3G modem which I use for both: sending SMS and establishing Internet connection.
I connect to Internet via ubuntu's Network Manager.
For sending SMS I use smstools3. Actually it doesn't matter what tools I used.
I found that it had been impossible to send SMS if there had been active Internet connection established via the same modem.

I tried to connect to Internet without the Network Manager. I manually setup pppd (with no lock param) using the manual from here. The connection worked fine, but it did not solve the problem.
Then I tried to use different modem's ttys for sending SMS and connecting to Internet (my modem has 2 ttys). It also did not help. Looks like only 1 tty of my modem can be used to do the job.

Now I have only 2 ideas:

  1. Don't do the things simultaneously. Separate them in time: start smstool daemon, send SMS, stop the daemon, establish Internet connection, send msg, stop the connection.
  2. Try to use GSM multiplexing like described here gsm mux I am not sure about the result because the mentioned project (gsm mux) looks dead.

Do you have any other ideas how to solve the problem?

有帮助吗?

解决方案

Finally, I found the solution.

Huawei E800 couldn't be used. Instead, I used E369. That modem has 3 ports (3 ttyUSB in /dev/). If I use the 1st tty for the Internet and the second for sending/receiving SMS, then the problem disappears. Note that E800 also has 2 ttys, but it doesn't solve the problem.

I think I known how to figure out whether a modem can be used for simultaneous SMS and Internet. Need to send "AT+CMUX=0" to the modem. If it answers that the operation is not supported, then you have to try different modem.

Also I met 1 more problem on Ubuntu 13.04. If I used the ubuntu's NetworkManager to set up Internet connection, then it blocked my modem. So, the modem couldn't be used to send/recv SMS. I found the solution - didn't use NetworkManager. Instead, I set up Internet connection with wvdial. It solved the problem.

其他提示

Actually you still may get SMS using AT command output even if you get AT+MUX=0 "not implemented" Connect to modem port:

socat - /dev/ttyUSB2, crnl

Then follow output unless you get +CMT command. Output may be either clear text or PDU. Clear text is obviously readable. PDU may look like:

+CMT: 0,32
07915892000000F001000B915892214365F7000021493A283D0795C3F33C88FE06CDCB6E32885EC6D341EDF27C1E3E97E72E

If you get PDU - you need to decode it. For example here: PDU decoder

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top