Tutorial: Cell module activation

bpwong-um edited this page May 23, 2018 · 3 revisions

The first step in activating cell modules is to contact you cellular service provider and request activation. You will need the MEID (mobile equipment identifier) for each cell module you want to activate.

You will now need to complete the activation manually. Create a blank PSoC Creator Project. You do not need any components in the TopDesign. The main.c file should contain only the following code:

#include <device.h>

void main()
{
    CyDelay(2000u);
    CyPmSaveClocks();
    CyPmHibernate();

    for(;;){
    }
}

Build the project and flash it to a board.

We'll be using a USB-TTL converter to send commands to the cell module using a computer. Connect the USB-TTL pins to the board as shown below:

Modem serial connections

Now open up a terminal on your computer and start an interactive Python(3) session. Copy and paste the following code into the interactive section. This code will initialize a client to read and write from the modem:

import serial
from time import sleep

# Computer-specific USB serial port
port = "/dev/tty.usbserial-FTHKS3FQ"

modem_port = serial.Serial()
modem_port.baudrate = 115200
modem_port.port = port
modem_port.timeout = 2 #increase timeout in case of bad reception
modem_port.open()

def modem_write(command):
    modem_port.write(command.encode() + "\r".encode())

def send_at_command(command,timeout=2):
    modem_port.timeout = timeout
    modem_write(command)
    sleep(1)
    response = modem_port.read(3000).decode('ascii').strip()
    print(response)
    return response

After plugging in the cell module and supplying power to the device, push the button labeled "ON/OFF" to the right of the cell module. When the button is pushed, the yellow LED to the left of the cell module should flash.

When cell modules are first powered on, they will likely need to perform hands-free activation and update firmware. When reading output over serial, wait for the following sequence to appear (assuming that Sprint is being used as the carrier):

#900        # DM Client ready

#904        # Hands-free activation (HFA) started

#914        # HFA Done - HFA success

#905        # Preferred Roaming List (PRL) Download - Session started

#909        # PRL Done - PRL success

#907        # FUMO - Firmware DM session started or started again until no more updates are available

#916        # FUMO - Firmware done, no firmware update

#900        # DM Client ready

For additional notification codes, see page 20 of the SocketModem Guide by Multitech

Using a Python interactive session, the output should look as follows:

In [2]: send_at_command('')

Out[2]: ''

In [3]: send_at_command('')
#900

#904

#914

#905
Out[3]: '#900\r\n\r\n#904\r\n\r\n#914\r\n\r\n#905'

In [4]: send_at_command('')
#909

#907

#916

#900
Out[4]: '#909\r\n\r\n#907\r\n\r\n#916\r\n\x00\r\n#900'

Next, run the rest of the Python script:

username = "REDACTED"
password = "REDACTED"
database = "REDACTED"

# Check registration
creg = send_at_command('AT+CREG?')

sleep(1)

# Error reporting
cmee = send_at_command("AT+CMEE=2")

sleep(1)

# Activate IP
sgstate = send_at_command("AT#SGACT?")

if (not "SGACT: 1,1" in sgstate):
    sgact = send_at_command("AT#SGACT=1,1",5)

sleep(1)

# Open socket
sd = send_at_command('AT#SD=1,0,8086,"data.open-storm.org",0,0,1', 10)

sleep(1)

send_at_command('')

sleep(1)

# Send data
send_at_command("AT#SSEND=1")

sleep(1)

# Write query
w = send_at_command("GET "
                    "/query?db={0}&u={1}&p={2}"
                    "&pretty=true&q=SELECT%20last%28value%29%20from%20sleeptimer"
                    "%20where%20node_id='GGB006' "
                    "HTTP/1.1\r\nHost: data.open-storm.org:8086\r\nConnection: "
                    "Close\r\n\r\n\032".format(database, username, password))

sleep(5)

send_at_command('')

# Read result
r = send_at_command("AT#SRECV=1,1000")

sleep(2)

# Close socket
sh = send_at_command('AT#SH=1')

The output should appear as follows:

AT+CREG?
+CREG: 0,1

OK
AT+CMEE=2
OK
AT#SGACT?
#SGACT: 1,0

OK
AT#SGACT=1,1
#SGACT: "174.158.202.251"

OK
AT#SD=1,0,8086,"data.open-storm.org",0,0,1
OK

AT#SSEND=1
>
GET /query?db=DB_REDACTED&u=USER_REDACTED&p=PASSWORD_REDACTED&pretty=true&q=SELECT%20last%28value%29%20from%20sleeptimer%20where%20node_id='GGB006' HTTP/1.1
Host: data.open-storm.org:8086
Connection: Close


OK

SRING: 1

AT#SRECV=1,1000
#SRECV: 1,707
HTTP/1.1 200 OK
Connection: close
Content-Type: application/json
Request-Id: 0b6b6039-838a-11e7-bbfa-000000000000
X-Influxdb-Version: 1.0.0
Date: Thu, 17 Aug 2017 20:24:17 GMT
Transfer-Encoding: chunked

1e3
{
    "results": [
        {
            "series": [
                {
                    "name": "sleeptimer",
                    "columns": [
                        "time",
                        "last"
                    ],
                    "values": [
                        [
                            "2017-06-02T12:58:48.299957219Z",
                            1150
                        ]
                    ]
                }
            ]
        }
    ]
}

0



OK
AT#SH=1
OK

To enable the LED output for Telit DE910-DUAL modules, run the following command:

send_at_command("AT#GPIO=1,1,2")
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.