Send the datas from rfid reader to server by wifi module

Discussion about UHF RFID, mainly aimed at AS399x ect.

Moderators: vaico, sunzhanshan

Send the datas from rfid reader to server by wifi module

Postby CindyKuai » 2013-07-29 22:51

I tried to send the datas from rfid reader to server by wifi a few days ago.
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.

Physical connection:
Image
1) The connected pins between STM32F103 development and gainspan wifi module see below.

STM32F103 board ------ wifi module
3.3V ------ 3.3V
GND GND
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
void connectauto_to_tcpserver(void)
{   
modle=0x00;          //
USART2_wifi_cmd(AT);                //
Delay_Nms(100);
USART2_wifi_cmd(AT);                //
Delay_Nms(100);
USART2_wifi_cmd("AT+DGPIO=30,0");    //Output low level from GPIO30
waitFor("OK");
USART2_wifi_cmd("AT+DGPIO=31,0");    //Output low level from GPIO31
waitFor("OK");
wifi_answer_ATWS();         //Scan the AP around
Delay_Nms(200); 
   
USART2_wifi_cmd(ATWD);             //Disassociation
waitFor("OK");
//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.
//waitFor("OK");       
USART2_wifi_cmd(ATNDHCP1);         //DHCP is enabled.
waitFor("OK");
if(security_modle==1)             //With the WPA-PSK and WPA2-PSK passphrase
  {           
    wifi_atwwpa();                   
    waitFor("OK");
  }   
wifi_atwa();                         //SSID
waitFor("OK");
atwa_flag=0;
USART2_wifi_cmd("AT+DGPIO=30,1");  //Output high level from GPIO30
waitFor("OK");
wifi_atnctcp();        //Connect to TCP server   
waitFor("OK"); 
Delay_Nms(100);
get_cid();
USART2_wifi_cmd("AT+DGPIO=31,1");   
waitFor("OK");
                 
modle=0x11;        //       
}


You can check the process how wifi module works by serial testing tool, like below datas from TX pin of wifi:
Image

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.
Image

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 support@soliddepot.com.
CindyKuai
 
Posts: 17
Joined: 2011-10-06 4:38

Return to UHF RFID

Who is online

Users browsing this forum: No registered users and 2 guests

cron