Solenoid
Posts: 16
Joined: Fri Nov 30, 2012 2:41 pm

Calling with a 3G modem

Sat May 11, 2013 9:18 am

I'm trying to call a phone/telephone network connected device in order to send/receive data, so far I was able to connect to the internet thanks to sakis3g, the setup was very easy as all I had to do was to enter sudo ./sakis3g start SIM_PIN=0000 APN="mobileoffice3g" and it reported 3G HSDPA MODEM connected to Orange CH (22803).

Now I'd like to issue an ATDT command to call something and exchange data, I've got my 3G modem that reports itself as

Code: Select all

$ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 006: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
It mounts as 3 different USB devices:

Code: Select all

$ ls -l /dev/ttyU*
crw-rw---T 1 root dialout 188, 0 May 11 10:14 /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 1 May 11 09:17 /dev/ttyUSB1
crw-rw---T 1 root dialout 188, 2 May 11 10:23 /dev/ttyUSB2
I can successfully connect to USB2 with "screen /dev/ttyUSB2 115200", but USB0 and USB1 do not give me any feedback to the AT commands.

Now I can issue commands to my modem and it happily responds:

Code: Select all

AT+CPIN?
+CPIN: READY
AT+COPS?
+COPS: 0,0,"Orange Communications S.A",2
ATDT*99#
NO CARRIER
That last bit drives me nuts, I cannot find the problem, how come it doesn't have a carrier since it's connected, it responds without delay, it's like it's not even trying.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Calling with a 3G modem

Sat May 11, 2013 12:00 pm

You can't simply dial a device to exchange data.
You need to create a 3G internet connection (Which is what Sakis3g does)
After that, you need to create a network connection with the other device.
The device can have a tcp server running and listening to a specific port. If that's the case, you need to connect to the device (wan) ip and the specific port. This is just a tcp connection, the same you would do if you have both devices network connected to each other.
The ATDT*99# is a special dialup command used to create a gprs or umts link. It needs to be preceded by other settings before it will succeed. For instance, you need to give it the provider APN before it can make the call. It might help if you would explain what you are trying to do to create a more accurate answer.

Solenoid
Posts: 16
Joined: Fri Nov 30, 2012 2:41 pm

Re: Calling with a 3G modem

Sat May 11, 2013 12:19 pm

Success: I continued to search and turns out ATDT needs a ";" after the number, so when I issue the command "ATDT01234567;" it calls 01234567, now to get the data stream to work.

I'm trying to call a weather station that reposts its sensors data via GPRS modem.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Calling with a 3G modem

Sat May 11, 2013 1:00 pm

Before gprs existed, you had gprs data that looked more like a normal modem to modem connection.
Maybe your weather station is still using that?
Adding a ; after a dial command means that the modem isn't waiting for a carrier signal before it starts to dial. If your modem has a gprs or umts connection, it will never see a carrier.
The analogy with an old telephone line is still viewable.
atdt xxxxxxx basically lifts the horn from the hook and waits for the dialtone.
If it hears that dialtone, it will dial the number using dtmf tones. If there is no dialtone, it will say no carrier.
The ; you add doesn't make it wait for the dialtone. It dials the dtmf numbers right away.
You say your weather station is using a gprs modem. Does that mean it connects to the internet over gprs as well? Is this a functionallity you are adding to it or is it something that exists?
You say it reposts it's sensor data with a gprs modem. What do you mean with repost? Is it sending a mail on regular intervals?

Solenoid
Posts: 16
Joined: Fri Nov 30, 2012 2:41 pm

Re: Calling with a 3G modem

Sat May 11, 2013 1:49 pm

According to this thread on another forum It seems the ";" makes a voice call, not a data call.

The weather station doesn't use its modem for internet, it's quite old. Once it receives a call it replies with a data stream, in a JSON format or whatever. Currently a second GPRS modem is connected behind a server that calls the weather station every hour and logs the data, I want to make my own calling server.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Calling with a 3G modem

Sat May 11, 2013 3:08 pm

My mistake. The example I was giving should generate NO DIALTONE and not NO CARRIER which is basically just an universal way to tell that the connection couldn't be made.
According to my Siemens TC35i AT command set, the ; makes the modem return to command mode directly after the dial command. This is obviously only usefull for voice calls.
Your weather station seem to use gsm data which is a point to point data connection between 2 gsm modems. It's totally different from gprs. Once the connection is made, it can be seen as a direct serial link between the weather station and the computer that dialled in to it.
Can you voice dial a normal cellphone with the atdtxxxxx; command?
A "data only" sim card won't work for a gsm data connection. But in such a case, a voice dial to another cellphone won't work either.
Are you sure the modem you are using still supports gsm data?

Solenoid
Posts: 16
Joined: Fri Nov 30, 2012 2:41 pm

Re: Calling with a 3G modem

Sat May 11, 2013 3:50 pm

I use my regular cellphone SIM card with which I can call or use the internet (so data I presume). I was able to call from and to my modem from another cellphone, but only with the ";". Once I got the call from the cellphone I answered with ATA command and the line was open, it wasn't very interesting as I couldn't do anything with it. What you're describing is exactly what I want, that is a point to point serial connection.

I've never really understood the GSM/GPRS difference, they way I thought it would work was: A calls B, magic happens, data can be transmitted both ways.

Here's what my modem responds to ATI:

Code: Select all

ATI
Manufacturer: QUALCOMM INCORPORATED
Model: 3G HSDPA MODEM
Revision: HV1.3.0B20120507 HV1.3.0B20120507 1  [Sep 4 2008 12:00:00]
IMEI: 
+GCAP: +CGSM,+DS,+ES
At this point I'm not sure of anything anymore.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Calling with a 3G modem

Sat May 11, 2013 4:19 pm

Just did some reading. It seems that some providers have separate sim cards for gsm data and fax. Those usually give you 2 different phone numbers. One is used for voice calls and the other for data calls. So it might be perfectly possible that your sim card works for voice calls and gprs, but that it still can't be used to initiate a gsm data call to the weather station. I suppose it's not possible to test with the server modem it's sim card to see if that indeed makes the difference?
Do you have an AT command set description of the modem you are using?
Qualcomm is a chip baker. The manufacturer can still decide himself what functionallity he puts in his gsm modem.

Solenoid
Posts: 16
Joined: Fri Nov 30, 2012 2:41 pm

Re: Calling with a 3G modem

Sat May 11, 2013 4:30 pm

It not possible to use the current modem SIM, I don't know where it is and I probably shouldn't mess with it anyway.

For the AT commands I just look at that page and try something until it works, it's a cheap modem from DX so documentation is basically nonexistent.

I realize I haven't given enough information from the beginning, but this goes much further that I thought it would.

Return to “Troubleshooting”