fsc bw236 user guide - feasybeacon.com

28
Shenzhen Feasycom Technology Co., Ltd. - 1 - FSC-BW236 User Guide V1.1 Shenzhen Feasycom Technology Co.,Ltd.

Upload: others

Post on 10-Apr-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 1 -

FSC-BW236 User Guide V1.1

Shenzhen Feasycom Technology Co.,Ltd.

Page 2: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 2 -

Revision History:

Version Date Update

1.0 2020.03.16 Initial Release

Shenzhen Feasycom Technology Co.,Ltd.

Page 3: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 3 -

CONTENT

1. Product Brief ......................................................................................................... - 4 -

1.1 Brief ............................................................................................................ - 4 -

1.2 Features ....................................................................................................... - 4 -

1.3 Applications ................................................................................................ - 4 -

2. User Guide ............................................................................................................ - 5 -

2.1 Preparation: .............................................................................................. - 5 -

2.2 Testing: ..................................................................................................... - 5 -

2.3 Network Configuration: ........................................................................... - 6 -

2.4 Communication: ....................................................................................... - 7 -

3. Flow Chart .......................................................................................................... - 12 -

3.1 BW236 Works As TCP Server Application Flow ..................................... - 12 -

3.2 BW226 Works As TCP Client Application Flow ...................................... - 13 -

4. Application Scenario Introduction ...................................................................... - 14 -

4.1 Works As TCP Server: ........................................................................... - 14 -

4.2 Works As TCP Client: ............................................................................ - 14 -

4.3 TCP Server-Multiple TCP Connections: ................................................ - 15 -

5. Network Configuration Guide ............................................................................ - 15 -

5.1 Simple Config Network Configuration ..................................................... - 15 -

5.2 Bluetooth Network Configuration ............................................................ - 19 -

5.3 .WEB Network Configuration .................................................................. - 23 -

6. Firmware OTA Guide ......................................................................................... - 24 -

7. Common AT Command List ............................................................................... - 27 -

Shenzhen Feasycom Technology Co.,Ltd.

Page 4: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 4 -

1. Product Brief

1.1 Brief

FSC-BW236 is a Bluetooth and Wi-Fi combo product, it supports BLE5.0 and 802.11

a/b/g/n.

1.2 Features

Support OTA

Support OPEN, WEP, WPA/WPA2 encryption scheme

Integrated serial port to Wi-Fi function

Support STA / AP / STA + AP coexistence mode

Support Simple Config intelligent networking function (provide APP demo

source code)

Support AT command set configuration

1.3 Applications

Home Automation

Remote device monitoring

Printer

IoT applications

Shenzhen Feasycom Technology Co.,Ltd.

Page 5: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 5 -

2. User Guide

2.1 Preparation:

Lead out the TX, RX, VCC and GND of the module and connect it to the PC

through the USB to serial port tool.

2.2 Testing:

After the preparation is complete, send the corresponding command to verify

whether the serial communication is normal. As image below, Shenzhen Feasycom Technology Co.,Ltd.

Page 6: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 6 -

2.3 Network Configuration:

Send AT+ROLE=1 to put the module in STA mode, send AT+RAP command to

connect to the router, such as AT+RAP=feasycom_test, 12345678. The first parameter

of the command is the name of the router, and the second parameter is the password

of the router.

After returning OK for a period of time, send AT+LIP to query whether the module is

connected to the router. As image below,

Shenzhen Feasycom Technology Co.,Ltd.

Page 7: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 7 -

If a corresponding IP address is returned, the module has been connected to the router.

2.4 Communication:

The module opens a TCP server with port number 9100 by default. Use the TCP /

UDP test tool on the PC side to initiate a connection to the module as a TCP client.

(At this time, the PC should be connected to the same router as the module). As image

below,

Shenzhen Feasycom Technology Co.,Ltd.

Page 8: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 8 -

As shown in the red circle, are the module's IP address and preset port number.

After the connection is completed, communication begins, and the module acts as a

server to send data to the client. The command is AT+WFSEND=0,5, abcde. As image

below,

Shenzhen Feasycom Technology Co.,Ltd.

Page 9: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 9 -

The client sends data directly to the module, as image below

After the module successfully receives the data, the serial port will print

+WFDATA=0,10. (0 is the ID number of the TCP connection and 10 is the length of

the received data), indicating that the module has received 10 bytes of data.

To get the received data, users need to send AT+WFRECV command, as shown in the

figure

Till now, it completes a data communication under a TCP connection.

Shenzhen Feasycom Technology Co.,Ltd.

Page 10: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 10 -

Meanwhile, the Bluetooth part can also connect and communicate, as images below

Shenzhen Feasycom Technology Co.,Ltd.

Page 11: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 11 -

Users can also send AT+TPMODE=1 to put the module in throughput transmission

mode and communicate directly with the remote end.

The above is the simple use way of BW236 to realize communication.

Shenzhen Feasycom Technology Co.,Ltd.

Page 12: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 12 -

3. Flow Chart

3.1 BW236 works as TCP server flow chart

Chart 1:

Shenzhen Feasycom Technology Co.,Ltd.

Page 13: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 13 -

3.2 BW226 works as TCP client flow chart

Chart 2:

(Remark: Data transaction process is the same as Chart 1)

Shenzhen Feasycom Technology Co.,Ltd.

Page 14: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 14 -

4. Application Scenario Introduction

4.1 Works as TCP server:

4.2 Works as TCP client:

Shenzhen Feasycom Technology Co.,Ltd.

Page 15: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 15 -

4.3 TCP Server-Multiple TCP Connections:

When the BW236 is set as a TCP server, it supports multiple TCP link connections,

and the default is three-way TCP client access.

5. Network Configuration Guide

5.1 Simple Config Network Configuration

Step 1: If the router is connected directly, users need to send AT+APAC=0 to

close the automatic connection and restart, and then send AT+SCFG=1 to start

Simple Config, the module returns OK indicating that the startup is successful

Step 2: Install Simple Config Wizard

Step 3: Use the Simple Config Wizard to configure the network, and use AT+LIP

or AT+STAT to check whether it is successful.

Shenzhen Feasycom Technology Co.,Ltd.

Page 16: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 16 -

1) Taking Android-Version Simple Config Wizard as an example, open the APP,

click Configure New Device

2)Select the router that the phone is connected to: FEASYCOM67

Shenzhen Feasycom Technology Co.,Ltd.

Page 17: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 17 -

3)Enter the password and click Connect

4)Pop-up PIN code input message box, click Skip

Shenzhen Feasycom Technology Co.,Ltd.

Page 18: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 18 -

5)Wait for the next pop-up dialog box, indicating that the network configuration is

successful, click Confirm

6)HOST MCU sends AT+LIP to the module, find that the router is assigned an IP

address, and confirms that the network configuration is successful

Shenzhen Feasycom Technology Co.,Ltd.

Page 19: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 19 -

5.2 Bluetooth Network Configuration

1) The module is powered on and Bluetooth starts broadcasting. Use the mobile

phone Bluetooth BLE assistant to search and connect.

2)After connecting, enter the

"$OpenFscAtEngine$" string in the input box.

Shenzhen Feasycom Technology Co.,Ltd.

Page 20: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 20 -

3)At this point, the APP will reply with the string "$OK,Opened$" and the

module enters the Bluetooth Network Configuration mode.

4)Enter the configuration

command such as

"AT+RAP=feasycom-guest, feasycom" to configure

the network. (Note: feasycom-guest is the

router name, feasycom is the router password)

Shenzhen Feasycom Technology Co.,Ltd.

Page 21: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 21 -

5)In order to confirm whether there is a line break character after entering the

command, users can turn on Hex Send and check whether "0D 0A" exists at the end

of the command, as shown in the image below.

6)Click Send to start the network configuration. After the network configuration

is completed, the app will receive a reply with the word "OK".

Shenzhen Feasycom Technology Co.,Ltd.

Page 22: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 22 -

7)Enter the "AT+LIP" command to find out that the router is assigned an IP

address, and confirm that the network configuration is successful.

Shenzhen Feasycom Technology Co.,Ltd.

Page 23: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 23 -

5.3.WEB Network Configuration

1. The serial port sends AT+ROLE=2 to put the module in AP mode, and the

default IP address is 192.168.1.1

2. PC or mobile phone is connected to BW226 by Wi-Fi connection

3. Access 192.168.1.1 in the browser, the following interface will appear in

the browser

4. Fill in the name and password of the router to be connected and configure

the network.

Shenzhen Feasycom Technology Co.,Ltd.

Page 24: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 24 -

6. Firmware OTA Guide

(Note: In order to ensure a smooth upgrade, this process needs to close the firewall on

the PC side)

Step 1: Enter the directory where the upgrade package is located, as shown in the

figure

There are three files, DownloadServer, ota.bin, start.bat, where DownloadServer is the

TCP server during the upgrade process, and ota.bin is the upgrade file.

Step 2: To query the IP address of the PC, enter cmd.exe and enter ipconfig, as shown

in the figure

Shenzhen Feasycom Technology Co.,Ltd.

Page 25: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 25 -

Step 3: Double-click start.bat to start DownloadServer and wait for the upgrade. As

shown

Step 4: Send the AT+RAP command to connect the router so that the module and PC

are in the same LAN.

Step 5: Send AT + OTA = 0, <IP address of PC>, 8082 to start the upgrade. As shown

Shenzhen Feasycom Technology Co.,Ltd.

Page 26: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 26 -

Step 6: Upgrade and upgrade completed, as shown in the figure

After the upgrade is complete, the module will automatically disconnect from the

DownloadServer, which also indicates that the upgrade was successful.

Shenzhen Feasycom Technology Co.,Ltd.

Page 27: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 27 -

7. Common AT Command List

1. AT+RAP:

Connect the router. The first parameter is the router name, and the second

parameter is the router password.

For instance: AT+RAP=Feasycom,12345678

If the encryption method of the router is OPEN, sending the first parameter

‘router name’ would be enough.

For instance: AT+RAP=Feasycom

2. AT+LAP:

Set up the module's name and password and IP address in AP mode.

For instance: AT+LAP=BW236-ap,12345678,192.168.1.1

3. AT+LIP:

Query the IP address of the module.

For instance: In STA mode, BW236 starts to connect to the router and can

query its IP address with AT+LIP. If the connection is unsuccessful, it returns

"+LIP=0.0.0.0". From this, users can determine the network status of

BW236.

4. AT+APAC:

Set up whether the BW236 will automatically connect to the router when it is

powered on in STA mode.

For instance: AT+APAC=1, it means that after successfully connecting to the

router, it will automatically connect to this router at next power-on.

AT+APAC=0, it means that you need to manually connect the router every

time you power on.

5. AT+DHCP

Make BW236 work in static IP. When the BW236 is configured with a network,

it no longer uses dynamically assigned IP addresses, but uses pre-set static IP

addresses.

For instance: AT+DHCP=1, AT+SIP=192.168.1.111. If static IP is not used,

send AT+DHCP=0

6. AT+SCFG:

Intelligent Network Configuration.

If you start smart network configuration, send AT+ SCFG=1. Stop intelligent

network configuration and send AT+SCFG=0.

This is an action command, which does not have the setting and query

functions. Before use, AT+APAC=0 must be sent to turn off the automatic

connection function.

7. AT+TPMODE:

Shenzhen Feasycom Technology Co.,Ltd.

Page 28: FSC BW236 User Guide - feasybeacon.com

Shenzhen Feasycom Technology Co., Ltd.

- 28 -

Set the module to throughput mode or command mode.

For instance: AT+TPMODE=1, Set the module to throughput mode

AT+TPMODE=0, Set the module to command mode.

8. AT+RSSI:

In STA mode, query the signal strength between the BW236 and the router.

If the router is not connected, the query result is + RSSI = 0.

9. AT+ROLE:

There are three modes for BW236, namely STA, AP, and STA+AP. Use this

command to switch between these three modes.

For instance: AT+ROLE=1, Enter STA Mode

AT+ROLE=2, Enter AP Mode

AT+ROLE=3, Enter STA+AP Mode

BW236 will restart after setting the mode.

10. AT+CLOSE:

Disconnect the TCP connection and GATT connection with the BW236.

11. AT+BTEN

Turn on and off Bluetooth function

For instance: AT+BTEN=1, turn on Bluetooth; AT+BTEN=0 turn off Bluetooth

12. AT+ADDR

Query Bluetooth MAC

13. AT+MAC

Query Wi-Fi MAC

14. AT+SCAN

Scan AP information nearby

For instance: AT+SCAN=5, Display information about nearby APs

15. AT+SOCK

Set up TCP connection

For instance: AT+SOCK=TCPS,9100

AT+WLANC=3 The module starts a TCP server with port number 9100.

For instance: AT+SOCK=TCPC,9100,remote IP, remote PORT

AT+WLANC=3 module connect to remote TCP server

Shenzhen Feasycom Technology Co.,Ltd.