The essential information about communication with Cinterion modems
Communication mode
The modem provides two separate AT channels - "application", which is supposed to be used to control the modem, report unsolicited notifications etc., and "modem", which is supposed to be used for things like data transfer. There is also a NMEA channel for GPS. Channels can be assigned to UART (one channel at time), USB CDC-ACM (one channel at time), USB composite (multiple channels possible), or MUX on either UART or USB can be used.
The default communication mode of PHS8 is "application" on UART and "modem" on USB CDC-ACM. This means that with default config, notifications about incoming calls and messages are provided only via UART.
To change it into some better suited to our needs mode, AT^SDPORT is used. The value is stored, applied immediatelly and persistent between reboots.
To put all channels into USB composite device and disable UART, type:
AT^SDPORT=3
"Application" channel will be accessible as third device on USB bus, aka /dev/ttyUSB2
CAUTION: don't type AT^SDPORT=2 ("modem" on UART, USB disabled) without ability to talk to the modem via UART, because otherwise you won't be able to switch it back!
Other values include 4 ("application" on UART, "modem" and NMEA on USB) and 5 (NMEA on UART, "modem" and "application" on USB)
USB composite device needs two Linux modules to be properly supported: usb/serial/option and net/usb/qmi_wwan.
GPS/GLONASS
The NMEA channel during USB composite mode is available at /dev/ttyUSB1
It's adviced to set the RTC correctly (in UTC) before attempting to use GPS, especially when wanting to use A-GPS.
Example:
AT+CCLK="14/05/15,19:03:20"
To control the GPS engine, AT^SGPSC command can be used.
Antenna power supply control:
AT^SGPSC="Power/Antenna","on"
AT^SGPSC="Power/Antenna","off"
GNSS engine mode (2 - assisted; 1 - not assisted; 0 - off)
AT^SGPSC="Engine","<mode>"
GLONASS mode (needs modem restart to take effect):
AT^SGPSC="Nmea/Glonass","on"
AT^SGPSC="Nmea/Glonass","off"
AGPS data upload:
- turn off GNSS engine
AT^SGPSC="Engine","0"
- download the GPS + GLONASS assistance data from one of those urls:
http://xtra1.gpsonextra.net/xtra2.bin
http://xtra2.gpsonextra.net/xtra2.bin
http://xtra3.gpsonextra.net/xtra2.bin
or GPS-only:
http://xtra1.gpsonextra.net/xtra.bin
http://xtra2.gpsonextra.net/xtra.bin
http://xtra3.gpsonextra.net/xtra.bin
- check the size in bytes of downloaded file - let's say it's 38521
- trigger the data upload mode
AT^SBNW="agps",38521
- upload the file to the modem
cat xtra2.bin > /dev/ttyUSB2
- enable GNSS engine in assisted mode
AT^SGPSC="Engine","2"
Assistance data is stored in modem's permanent memory.
Removing AGPS data:
AT^SBNW="agps",-1
Turning off
AT^SMSO
After a second or two modem should turn off and can be safely disconnected from the battery.
LED
When debugging, STATUS LED might be useful. To turn it on:
AT^SLED=2
When modem is not connected, it will blink 500ms/500ms. When it is registered but idle, it will produce short (10ms) blink every 4 secs. When voice or CSD is in progress - short blink every second. When GPRS is enabled, short blink every two seconds.
This setting is not permanent.