SIMCOM SIM7000

In this guide, we go over the setup required to get the SIMCOM SIM7000 modem working on the Hologram network using our global IoT SIM.

We are using the SIMCOM evaluation board but are sending commands directly to the modem. Therefore, you can follow these instructions for any device with the SIM7000.

Before we begin, please make sure that you have a Hologram account.

Setup: SIM

First, we need to make sure to activate our Hologram SIM on the Dashboard. Here is a link that walks you through that process. 

mceclip0.png

 

Setup: Device

Next, we need to insert the SIM into the device. Ensure that the SIM is inserted properly. Attach the provided antenna.

IMG_1186.JPG

We can use the microUSB port to connect directly to a PC or Linux device and communicate with the module using Serial.

Once you connect the board to a power source, ensure that it's powered on properly. There are LED lights to indicate the device is powered on.

 

Setup: PC/Linux Device

Plug the device into your PC or Linux device. In this guide, we will be connecting to a Raspberry Pi. However, you can communicate with your modem on a PC using SIMCOM's USB drivers and PuTTy or Tera Term.

Run the following command to view all devices connected via USB to your Linux device:

ls /dev/tty*

Screen_Shot_2019-10-10_at_2.41.33_PM.png

Set up a Serial Terminal with the device using the following command:

screen /dev/ttyUSB2

A new Terminal window will open. Use the following command to determine if the correct dev path was chosen:

AT
Expected Response: OK

If we don't see the expected response, we can try to the other ttyUSB paths. To close the Screen, use CTRL-A, SHIFT-K.

 

Connecting using the Hologram SIM

Use the following command to ensure your device is set to full functionality mode:

AT+CFUN=1
Expected Response: OK

It may help to run the following commands to ensure the device recognizes LTE networks. This is especially true with the SIM7000G model.

//Set preferred mode to LTE only.
AT+CNMP=38
Expected Response: OK

//Set device preference to Cat-M1 over NB-IoT
AT+CMNB=1
Expected Response: OK

 

Establish TCP connection with Hologram Cloud

Check the device's current connection status.

AT+CIPSTATUS
Expected Response = STATE: IP INITIAL

If the response is not the expected response, deactivate the GPRS PDP Context and check the status again.

AT+CIPSHUT
Expected Response = SHUT OK

AT+CIPSTATUS
Expected Response = STATE: IP INITIAL

Set the APN and connect to the Hologram Cloud

AT+CSTT="hologram"
Expected Response = OK

AT+CIICR
Expected Response = OK

AT+CIFSR
Expected Response = [IP ADDRESS]

AT+CIPSTART="TCP","cloudsocket.hologram.io",9999
Expected Response =
OK

CONNECT OK

 

Send a message to the Hologram Cloud

We can use Hologram's Embedded API to send messages to the Hologram Cloud. 

The message structure includes the device key, the message, and any topics.

{"k":"[DEVICE_KEY]","d":"[MESSAGE_BODY]","t":"TOPIC_NAME"}

To initiate sending the message, use the following command. Make sure you replace [DATA_LENGTH_IN_BYTES] with the payload's total number of bytes. Please note that the entire payload includes: {"k":"[DEVICE_KEY]","d":"[MESSAGE_BODY]","t":"TOPIC_NAME"}, and you should use this when calculating the number of bytes.

AT+CIPSEND=[DATA_LENGTH_IN_BYTES]
Expected Response =
>

Enter the payload following the format in Hologram's Embedded API documentation. Replace DEVICE_KEY with the Hologram device key found on the Dashboard. Replace MESSAGE_BODY with the body of the message. Replace TOPIC_NAME with the topic of the message.

{"k":"T3stK3y!","d":"hello from SIM7000", "t":"SIMCOM_SIM7000_Article"}
Expected Response =
SEND OK
[0,0]
CLOSED

The message will appear in the Activity Log drawer on the Hologram Dashboard!

activity_drawer.png

 

Receive a message from the Hologram Cloud

We can also listen for incoming TCP data from the Hologram Cloud (sent from the Dashboard).

Configure the module as server listening on port 4010.

AT+CIPSERVER=1,4010
Expected Response =
OK

SERVER OK

 If the response to AT+CIPSERVER is an error, we can try:

AT+CSTT="hologram"
Expected Response = OK

AT+CIICR
Expected Response = OK

AT+CIFSR
Expected Response = [IP ADDRESS]

AT+CIPSTART="TCP","cloudsocket.hologram.io",9999
Expected Response =
OK

CONNECT OK

If we send a message to the device from the Dashboard on the designated port, we will see the message in the console:

REMOTE IP:
[Body of Message]

If we want to send a message to the Dashboard in response:

AT+CIPSEND=[DATA_LENGTH_IN_BYTES]
> [TYPE_MESSAGE_HERE_AND_PRESS_RETURN]
SEND OK

If we don't send a message back in response, we will see "Message sent to device. No response back" in the Activity Log drawer on the Dashboard.

activity_sent.png

Was this article helpful?
1 out of 1 found this helpful