Digi International Inc XB3C1 Manuel D’Utilisation

Page de 146
Getting started with the XBee Smart Modem Development Kit
Perform a (GET) HTTP request
Digi XBee3 Cellular LTE Cat 1 Smart Modem User Guide
28
Perform a (GET) HTTP request
You can use the XBee Smart Modem to perform a GET Hypertext Transfer Protocol (HTTP) request
using XCTU. This example uses
as the target website that responds to the HTTP
request.
To perform a GET request:
1. Ensure that the device is set up correctly with the SIM card installed and the antennas
connected as described in
.
2. Open XCTU and
.
3. Click the Configuration working mode
button.
4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
5. To enter the destination address of the target website, in the DL field, type httpbin.org and
click the Write button
.
6. To enter the HTTP request port number, in the DE field, type 50 and click the Write button.
Hexadecimal 50 is 80 in decimal.
7. To switch to TCP communication, in the IP field, select and click the Write button.
8. To move into Transparent mode, in the AP field, select and click the Write button.
9. Wait for the AI (Association Indication) value to change to (Connected to the Internet).
10. Click the Consoles working mode button
on the toolbar.
11. From the AT console, click the Add new packet button
in the Send packets dialog. The
Add new packet dialog appears.
12. Enter the name of the data packet.
13. Type the following data in the ASCII input tab:
GET /ip HTTP/1.1
Host: httpbin.org
14. Click the HEX input tab and add 0A (zero A) after each 0D (zero D), and add an additional 0D 0A
at the end of the message body. For example, copy and past the following text into the HEX
input tab:
47 45 54 20 2F 69 70 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 68 74 74 70 62 69 6E
2E 6F 72 67 0D 0A 0D 0A
Note
The HTTP protocol requires an empty line (a line with nothing preceding the CRLF) to terminate
the request.
15. Click Add packet.
16. Click the Open button
.