![Reyax RYWB116 Скачать руководство пользователя страница 6](http://html1.mh-extra.com/html/reyax/rywb116/rywb116_user-manual_1449702006.webp)
6
RYWB116 MQTT Client Application User Guide
Copyright © 2019
, REYAX TECHNOLOGY CO., LTD.
CONFIGURING THE APPLICATION
Edit the
rsi_mqtt.c
file in the following path
.
sapis/examples/wlan/mqtt_client
From given configuration,
1.
Configure the module to join to the specific Access point by configuring following
parameters
SSID
refers to the name of the Access point to connect.
PSK
refers to the secret key if the Access point was configured in WPA/WPA2
security modes.
#define SSID
“
<ap_name>
”
#define CHANNEL_NO
0
#define SECURITY_TYPE
<security-type>
#define PSK
“
<psk>
”
2.
To configure the IP of the RYWB116 module in DHCP mode
To configure IP through dhcp set DHCP_MODE to 1, else configure to 0
3.
To configure static IP address
IP address to be configured to the device should be in long format and in
little endian byte order. The following parameters are valid only if
DHCP_MODE
is 1.
Example: To configure “192.168.10.1” as IP address, update the macro
DEVICE_IP
as
0x010AA8C0
.
IP address of the gateway should also be in long format and in little
endian byte order
Example: To configure “192.168.10.1” as Gateway, update the macro
GATEWAY
as
0x010AA8C0
IP address of the network mask should also be in long format and in little
endian byte order
Example: To configure “255.255.255.0” as network mask, update the
macro
NETMASK
as
0x00FFFFFF
4.
Connect to the MQTT broker/server by configuring the following
parameters
MQTT server IP address should be in long format and in little endian
byte order
#define DHCP_MODE
<dhcp mode>
#define DEVICE_IP
0X010AA8C0
#define GATEWAY
0x010AA8C0
#define
NETMASK
0x00FFFFFF
#define
SERVER_IP_ADDRESS 0x640AA8C0