Send a connect packet

Now that you know what a connect packet looks like, you can send a connect packet to a broker and view the response. Open XCTU and click the Configuration working mode button.

  1. Ensure that the device is set up correctly with the SIM card installed and the antennas connected as described in Connect the hardware.
  2. Open XCTU and click the Configuration working mode button.
  3. Add the XBee Cellular Modem to XCTU. See Add a device to XCTU.
  4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for that device.
  1. In the AP field, set Transparent Mode to [0] if it is not already and click the Write button.
  2. In the DL field, type the IP address or the fully qualified domain name of the broker you wish to use. This example uses test.mosquitto.org.
  3. In the DE field, type 75B and set the port that the broker uses. This example uses 75B, because the default MQTT port is 1883 (0x75B).
  4. Once you have entered the required values, click the Write button to write the changes to the XBee Cellular Modem.
  5. Click the Consoles working mode button on the toolbar to open a serial console to the device. For instructions on using the Console, see the AT console topic in the XCTU User Guide.
  6. Click the Open button to open a serial connection to the device.
  7. From the AT console, click the Add new packet button in the Send packets dialog. The Add new packet dialog appears.

  8. Enter the name of the data packet. Name the packet connect_frame or something similar.

  9. Click the HEX input tab and type the following (these values are the same values from the table in Example: MQTT connect):

    10 10 00 04 4D 51 54 54 04 02 00 3C 00 04 44 49 47 49

  10. Click Add packet. The new packet appears in the Send packets list.
  11. Click the packet in the Send packets list.
  12. Click Send selected packet.
  13. A CONNACK packet response from the broker appears in the Console log. This is a connection acknowledgment; a successful response should look like this:

You can verify the response from the broker as a CONNACK by comparing it to the structure of a CONNACK packet in the MQTT documentation, which is available at http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718081).