Quectel BG96

In this guide, we go over the setup required to get the Quectel BG96 modem working on the Hologram network using our global IoT SIM. In this tutorial, we are using a RAK WisLTE board, but are sending commands directly to the modem so you can follow these instructions for any device with the BG96. 

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. 

Once the SIM shows a green dot that indicates that it is in the LIVE status on the Dashboard, we are ready to move on to the device.

Setup: Device

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

Quectel provides developer tools that we will use to communicate with the BG96. Install the necessary programs below:

Since we are using the RAK WisLTE board, we can use the board's microUSB port to connect directly to a PC. 

There are other ways to communicate with the modem. For example, the RAK WisLTE board is an Arduino shield. If connected to an Arduino, you can send AT commands through the Arduino 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.

Open the Device Manager on the PC, and scroll to Ports (COM & LPT). Look for Quectel USB AT Port (COM__). In this example, it is using COM12. Right-click on the AT Port to double-check the baudrate the port is using.

Open QCOM on the PC. Set COM Port to the port identified in the Device Manager. Ensure the baudrate is correct by checking the baudrate of the AT Port. Right-click on the AT Port in the Device Manager and choose Properties. Click Port Settings. Set the baudrate in QCOM to match the Bits per second number on Port Settings.

We can now send AT commands to the device from QCOM. To send an AT command to the device, enter the command into the Input String field and click Send Command. For more information on AT Commands with Quectel devices, refer to these manuals:

Try entering AT and pressing enter. OK is the expected response. This means the device is ready, and we can start connecting to the device.

Sending a Message from the Device to the Hologram Dashboard

Using the Input String field, we can send individual AT Commands. QCOM also allows users to script AT Commands using the Command List on the right side. Adding the following commands to the Command List and running the script will confirm the device is connected to a network, set the APN, establish a TCP connection, and send a message from the device.

Set the APN to "hologram" with no username or password.

AT+QICSGP=1,1,"hologram","","",1


Expected Response:

OK


Activate the PDP context.

AT+QIACT=1


Expected Response:

OK


Establish the TCP connection. 

AT+QIOPEN=1,0,"TCP","cloudsocket.hologram.io",9999,0,1


Expected Response:

OK
+QIOPEN: 0,0


Replace TOTAL_DATA_LENGTH_IN_BYTES with the length of the entire payload. Please note that the entire payload includes: {"k":"[DEVICE_KEY]","d":"[MESSAGE_BODY]","t":"TOPIC_NAME"} 

AT+QISEND=0,[TOTAL_DATA_LENGTH_IN_BYTES]

Wait for response > to enter the payload.

Enter the payload following the format in Hologram's Embedded API documentation. Replace DEVICE_KEY with the Hologram device key found on the Dashboard. Please note that this is different than the device ID and must be manually generated. Replace MESSAGE_BODY with the body of the message.
Replace TOPIC_NAME with the topic of the message.

{"k":"[DEVICE_KEY]","d":"[MESSAGE_BODY]","t":"TOPIC_NAME"}
Expected Response:
SEND OK
+QIURC: "recv",0,2
50
+QIURC:"closed",0

Navigate to the Dashboard and click All Activity at the bottom of the screen to expand the log. The message should appear, and that's it! We can now send messages from the device to the cloud!

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