I use STM32F103F103VET6 development to control AS3992 UHF RFID reader, then send the datas from reader to wifi module through UART interface.
The effect what I want is:
1. Input the SSID, key, server_ip, server_port to STM32 flash through UART1 interface of STM32 board. Automatically connect to AP and the server when the STM32 board is power on.
2. The LED will light up when the wifi module is connected to server successfully. Then the rfid reader starts to scan tags, send datas returned by tags to wifi module. Wifi module will send these datas to server.
1) The connected pins between STM32F103 development and gainspan wifi module see below.
STM32F103 board ------ wifi module
3.3V ------ 3.3V
USART2-RX ------ J5-TX
USART2-TX ------ J4-RX
The connected pins between STM32F103 development and AS3992 UHF RFID reader kit see below.
STM32F103 board ------ reader module
USART3-TX(PB10) ------ RX
USART3-RX(PB11) ------ TX
GND ------ GND
What below is the part of STM32 code that initialize the wifi module.
- Code: Select all
USART2_wifi_cmd("AT+DGPIO=30,0"); //Output low level from GPIO30
USART2_wifi_cmd("AT+DGPIO=31,0"); //Output low level from GPIO31
wifi_answer_ATWS(); //Scan the AP around
//USART2_wifi_cmd(ATWM0); //Set the wireless mode, If n is 0, the mode is set to infrastructure; if n is 1, the mode is set to ad hoc. If n is 2, the mode is set to //limited AP so that the adapter can act as a limited wireless Access Point. S2w Adapter uses infrastructure(0) as the default mode.
USART2_wifi_cmd(ATNDHCP1); //DHCP is enabled.
if(security_modle==1) //With the WPA-PSK and WPA2-PSK passphrase
USART2_wifi_cmd("AT+DGPIO=30,1"); //Output high level from GPIO30
wifi_atnctcp(); //Connect to TCP server
You can check the process how wifi module works by serial testing tool, like below datas from TX pin of wifi:
Open the TCP/UDP data transceiver testing tool, choose the correct protocol, local host ip and local host port, click Listening. You will see the datas from wifi module.
These datas is returned by tag when the STM32 sends inventory command with RSSI(0x43 0x03 0x01) to reader.
The EPC numbers of the tag scanned are 00 00 10 21 41 18 01 16 22 10 2E DF.
If you are interested in this design, you can email to email@example.com.