Development Examples
Bluetooth Networking
FeasyBlue Bluetooth Networking
APP Download
Networking Guide
Open the FeasyBlue app and click on Settings - WiFi Parameter Settings in sequence.
Check BLE in the upper right corner of the application interface, scan and select the Bluetooth device BW256B you want to upgrade.
Select and click on Bluetooth Distribution Network - In the pop-up SSID 和 Password window, enter the SSID 和 password of the Wi-Fi AP to be connected, and click Start Distribution Network. After the distribution network is completed, It will display the successful network distribution and the obtained IP address .
Data Throughput Mode Application
What Is Throughput Mode?
FSC-BW256x series Bluetooth & Wi-Fi module features two data transmission modes: Throughput Mode and Command Mode .
The default command mode of the general data transmission application firmware. If you need to switch, you can refer to [FSC-BW256B General Data AT Command Set] , and using the AT+TPMODE command.
The working mechanisms and differences of the two data transmission modes are as follows:
Throughput Mode:
Without Bluetooth or Wi-Fi connection ,the data received through the serial port is parsed in the format of AT instructions;
Bluetooth or Wi-Fi connection has been established ,All the data received through the serial port is sent to the remote end as is.
Command Mode:
Without Bluetooth or Wi-Fi connection ,The data received through the serial port is parsed in the format of AT instructions;
Bluetooth or Wi-Fi connection has been established ,The data received through the serial port is still parsed in the AT instruction format and needs to be sent to the remote end via AT instructions. For example, when connecting with BLE, use the AT+LESEND command to send data. When establishing a TCP connection, use the AT+WFSEND command to send data.
Switch To Throughput Mode
Enter the Throughput Mode: Before establishing a Bluetooth or Wi-Fi connection, the FSC-BW256B module can use the command AT+TPMODE=1 to activate the transparent transmission mode. The operation example is as follows:
Send:>> AT+TPMODE=1 //Set it to transparent transmission mode
Response:<< OK
When Bluetooth or Wi-Fi connection has been established, exit throughput mode:
Send:>> +++ //Send "+++". Note: When operating on the host computer's serial port tool, please uncheck "New Line" at this time.
Response:<< a //Received response "a"
Send:>> a //Send "a". Note: When operating on the host computer's serial port tool, please uncheck "New Line" at this time.
Response:<< +ok //Successfully exited
Note
Throughput Mode only takes effect when connections (such as Bluetooth, TCP/UDP) have been established. Therefore, the methods to exit transparent transmission also only work under such circumstances. When no connections have been established, you can directly use the AT command (AT+TPMODE) to switch (modes).
The data format for sending and receiving mentioned above differs from that of AT commands. Standard AT commands end with <CR><LF> , while the above-mentioned control commands are strings that do not come with <CR><LF>.
Throughput Mode Application
Module to Phone Communication
TCP Server Application
Tools
Feasycom Serial Port Tool :A serial communication analysis tool based on Windows PC.
(Option) TCP&UDP Test Tool :Optional third-party PC-based network debugging tools are available.
TCP Server Application Block Diagram
TCP Server Application Flowchart
TCP Server Application Example
Set the module to Wi-Fi mode. If it is already in the current mode, you can skip this step. The operation example of the AT command is as follows:
Send:<<AT+ROLE=1
Response:>> OK
The module is connected to the AP hotspot. An example of AT command operation is as follows:
Send:<< AT+RAP=ssid,password
Response: > OK
Query the IP address of the module to confirm that it has been connected to the network. The operation example of the AT command is as follows:
Send:<< AT+LIP
Response:>> +LIP=192.168.0.97 //For local examples, please refer to the actual IP address obtained by connecting to the AP
Response:>> OK
Set the module to TCP server with port 9100. The operation example of the AT command is as follows:
Send:<< AT+SOCK=TCPS,9100
Response:>> OK
To create a TCP server for the module, an example of the AT command operation is as follows:
Send:<< AT+WLANC=3
Response:>> OK
The PC and the module (FSC-BW256B) are connected to the same AP hotspot. On the PC, a third-party network debugging tool is used to create an IP address for the TCP connection to the TCP Server (module) as a TCP client. And after establishing a TCP connection, send TCP data to the TCP Server (module), such as 1234567890
The module receives TCP data sent by the TCP Client. In instruction mode, an example of the received data format serial port response is as follows:
Response:>> +WFDATA=0,10,1234567890 //Supports simultaneously receiving data sent from multiple TCP clients to the TCP Server, with the first parameter being the connection ID
Response:>> +WFDATA=1,10,1234567890
Response:>> +WFDATA=2,10,1234567890
The module supports the simultaneous reception of data sent from multiple TCP clients to the TCP Server. The first parameter is the connection ID. In command mode, an example of the AT command operation is as follows:
Send:<< AT+WFSEND=0,3,abc
Response:>> OK
TCP Client Application
Tools
Feasycom Serial Port Tool :A serial communication analysis tool based on Windows PC.
(Option) TCP&UDP Test Tool :Optional third-party PC-based network debugging tools are available.
TCP Client application block diagram
TCP Client Application Flowchart
TCP Server Application Example
Set the module to Wi-Fi mode. If it is already in the current mode, you can skip this step. The operation example of the AT command is as follows:
Send:<< AT+ROLE=1
Response:>> OK
Connect the module to the AP hotspot. The AT command operation example is as follows:
Send:<< AT+RAP=ssid,password
Response:>> OK
To query the IP address of the module, an example of the AT command operation is as follows:
Send:<< AT+LIP
Response:>> +LIP=192.168.0.97 //For local examples, please refer to the actual IP address obtained by connecting to the AP
Response:>> OK
Connect the PC and the module to the same AP hotspot. Use a third-party network debugging tool on the PC to create a TCP Server. For example, the IP address of the TCP Server is 192.168.0.79 and the port number is 8080.
Set the module as TCP client and configure the IP and port number of the remote TCP Server. The operation example of the AT command is as follows:
Send:<< AT+SOCK=TCPC,9100,192.168.0.79,8080
Response:>> OK
The module acts as a TCP client to initiate the establishment of a TCP connection with the remote TCP Server. An example of the AT command operation is as follows:
Send:<< AT+WLANC=3
Response:>> OK
After the TCP connection is successfully established, the PC-end network debugging tool will display the successful connection, as well as the data sending area and receiving area. TCP data sending and receiving can be carried out, such as sending data 1234567890 to the remote TCP Client module
The module receives TCP data sent from the TCP Server. In instruction mode, an example of the received data format response is as follows:
Response:>> +WFDATA=3,10,1234567890
UDP Application
UDP Application Flowchart
UDP Application Example
Set the Wi-Fi mode. If you are already in the current mode, you can skip this step
Send:<< AT+ROLE=1
Response:>> OK
Connect to AP
Send:<< AT+RAP=ssid,password
Response:>> OK
Query the IP address of the module
Send:<< AT+LIP
Response:>> +LIP=192.168.0.97 //For local examples, please refer to the actual IP address obtained by connecting to the AP
Response:>> OK
Set module as UDP
Send:<< AT+SOCK=UDP,4000
Response:>> OK
Start UDP Server
Send:<< AT+WLANC=3
Response:>> OK
The PC and the module are connected to the same hotspot. On the PC, a network debugging tool is used to start a UDP Client with the target IP 192.168.0.97 and the target port number 4000.
Receive data
Response:>> +WFDATA=4,10,1234567890
Send data
Send:<< AT+WFSEND=4,3,abc
Response:>> OK
Note
To use transparent data transmission, simply send “AT+TPMODE=1” before setting the Wi-Fi mode.
SSL Client Application
SSL Client Application Flowchart
SSL Client Application Example
Set the Wi-Fi mode. If you are already in the current mode, you can skip this step
Send:<< AT+ROLE=1
Response:>> OK
Connect to AP
Send:<< AT+RAP=ssid,password
Response:>> OK
Query the IP address of the module
Send:<< AT+LIP
Response:>> +LIP=192.168.0.97 //For local examples, please refer to the actual IP address obtained by connecting to the AP
Response:>> OK
Set the module as SSL client and configure the remote server and port number
Send:<< AT+SOCK=SSL,9100,httpbin.org,443
Response:>> OK
The module initiates a connection to the remote end as an SSL client
Send:<< AT+WLANC=3
Response:>> OK
Send relevant requests, such as GET requests
Send:<< AT+SSLSEND=40,GET /get HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n
Response:>> OK
Receive data
Response:>> +SSLDATA=Specific data
Note
Note: If you want to use transparent data transmission, just send AT+TPMODE=1 before setting the Wi-Fi mode.
MQTT Application
MQTT Application Flowchart
MQTT Application Example
Set the Wi-Fi mode
Send:<< AT+ROLE=1
Response:>> OK
Connect to AP
Send:<< AT+RAP=ssid,password
Response:>> OK
Query the IP address of the module
Send:<< AT+LIP
Response:>> +LIP=192.168.0.97 //For local examples, please refer to the actual IP address obtained by connecting to the AP
Response:>> OK
Set the BROKER address
Send:<< AT+BROKER=gpssensor.ddns.net
Response:>> OK
Set User Name
Send:<< AT+USERNAME=admin
Response:>> OK
Set Password
Send:<< AT+MQTTPWD=12345678
Response:>> OK
Subscribe to topics
Send:<< AT+SUBTPC=user/get,0
Response:>> OK
Connect to MQTT
Send:<< AT+WLANC=4
Response:>> OK
Receive the data sent by the cloud platform
1234567890
Send data to the cloud platform
Send:<< AT+MQTTPUB=user/post,0,3,abc
Response:>> OK