LONGSYS ELECTRONICS WK1221 Wifi Module User Manual wk1220 kit demo

LONGSYS ELECTRONICS (HK) CO.,LIMITED Wifi Module wk1220 kit demo

User Manual

wk1221 kitOEMInstallationManualV1.0May 2015
versionwriterdatadesciptoinv0.1Zhifu.lin2015.5Initial releaseV0.2Jeans2015.6Add external antenna descriptionThe module is limited to OEM installation ONLY.The OEM integrator is responsible for ensuring that the end-user has no manualinstruction to remove or install module.The module is limited to installation in mobile application;A separate approval is required for all other operating configurations, includingportable configurations with respect to Part 2.1093 and difference antennaconfigurations.There is requirement that the grantee provide guidance to the hostmanufacturer for compliance with Part 15B requirements.
Please notice that if the FCC identification number is not visiblewhen the module is installed inside another device, then theoutside of the device into which the module is installed must alsodisplay a label referring to the enclosed module. This exterior labelcan use wording such as the following: “Contains FCC ID:2ADPDWK1221” any similar wording that expresses the samemeaning may be used.FCC RF Exposure requirementThis equipment complies with FCC radiation exposure limits set forth for an uncontrolled environment. This equipment should be installed and operated with a minimum distance of 20cm between the radiator & your body. This transmitter must not be co-located or operating in conjunction with any other antenna or transmitter.
1. Introduction................................................................................................... 52. Hardware.................................................................................................................................. 52.1 WK1221 DVB...................................................................................................................52.2 WK1221............................................................................................................................ 72.4 STM8 MINI FR..............................................................................................................82.5 WK1221 KIT...................................................................................................................93.Data channel............................................................................................................ 94. The use of APP mobile phone.................................................. 104.1 Software interface.............................................................................................104.2 Intelligent connection................................................................................... 114.3 SOFTAP control.......................................................................................................114.4 Station control.................................................................................................... 124.4.1 Softap go into station control...................................................144.5 Mode select option.............................................................................................155. Work flow profile..................................................................................... 165. Mobile app and wk1221 work flow profile............................................ 165.1.1 SOFTAP mode................................................................................................. 165.1.2 SNIFFER mode.............................................................................................. 165.2 Stm8 and wk1221work profile....................................................................... 17
1. IntroductionDemonstration wk1221 module transmitting function and mobile appthrough wifi to send data to wk1221, wk1221 transparent datatransmission forwarding to the serial port, stm8 from the serial portto receive data, control development board two adjustable PWM output,and the development of plate temperature sensor value of real-timedisplay in the interface of mobile phone app.The hardware is composed of WiFi wk1221 module and the externalstm8 MCU chip. Wk1221 is responsible for processing the data of WiFi,stm8 is responsible for driving peripherals, LED or sensor, etc..Wk1221 and stm8 through UART communications, mobile phone socket andwk1221 through APP communications.2.Hardware2.1 WK1221 DVBfigure 2.1 WK1221 DVB Top
figure 2.1:1.Temperature sensor:It is used to gather ambient temperature. Stm8will read the current temperature and upload to the phone.2. Switch1: Be used for setting wk1221 Working mode. Stm8 will judgelevel on the power, if to a high voltage (button is not pressed), stm8will set wk1221 to sniffer mode by AT+ instruction. If the low level(press button is pressed), wk1221 will be set to SOFTAP mode by AT+instruction. When the switch is not pressed, it is on the pull state.When pressed it is ground.(Switch2 is no used)figure 1..2 WK1221 DVB Bottomfigure 2..2:PWM1: Radius valuePWM2: Angle valuePWM3、PWM4: no use
2.2 WK1221figure 2.3a&b wk1221Insert the module into the development board according to thedevelopment board wk1221 silk screen. (Development board is compatiblewith wk1230 and wk1221.You should pay attention to distinguish between
wk1221 of the screen printing)2.4 STM8 MINI FRfigure 2.4 STM8 MINI FRWhen use the STM8 MINI FR copying code it only need 4 lines: RST,GND, swim and 3.3V (Figure 1, 3, 5, 7 feet) to connected with the DVB.Please attention the bottom the alignment of the silk screen, don'tin the wrong, otherwise the IC will burn out.
2.5 WK1221 KITfigure 2.5 WK1221 KIT3.Data channelfigure 3 flow chartI2CBUSAPPwk1221TCP/UDPUARTSTM8SENSORPWM
4. The use of APP mobile phone4.1 Software interfaceClick the software to enter the following 4.1 interfaceFigure 4.1 app controlIntelligent connection: when the device is in the sniffer mode,the device is used to configure the connection to the route.Refresh equipment: it send find packets and query whether thereis equipment online in the current LAN.Mode selection: set the mode of the equipment work.Send: use to send AT commands to wk1221.Enter AT hint: use to enter the AT command.Blue and Red slider: control 2PWM brightness on kit wk1221 board.
4.2 Intelligent connectionFirst, the wk1221 kit power off then power on and default snifferin wk1221 mode. Phone connect a route (which is the user wants toconfigure the device to connect to the route)Click smart connection, mobile phone send sniffer STATION modeconfiguration:figure 4.2 SNIFFER InterfaceAppear on the left side of the interface, the user can enter theWiFi password, then click "next", began to equipment connected to therouting, the connection is successful will show "a device configurationsuccessfully". Then users can click exit ".At this point, the device is configured to enter the station mode,and the phone is in the same LAN, can achieve control.4.3 SOFTAP controlFirst, the wk1221 kit power off and press switch, then the kit poweron. Press the switch about 500ms. At this point, wk1221 enters SoftAPmode. Mobile phone connected to the wk1221 module issued AP.Note: the module is in the SoftAP mode, the phone must be connected
to the module issued SSID can control.Then click the refresh device, it will appear below. The deviceonline and the current mode is SOFTAP_MODE. It shows the device iscontrollable.figure 4.3 SOFTAP connection4.4 Station controlIn this mode, the interface will show: the device online and thecurrent mode is: STATION_MODE ".Note: mobile connection and device connection must be controlledunder the same LAN.
figure 4.4 STATION modeThere are two ways to enter the pattern:1. From the smart connection configuration successfully, themodule will automatically enter the station mode, and thenrealize the controllable (this way has been described in detailin Section 4.1).2. From the premise of the SOFTAP mode controllable, set up to thestation mode (the following start to describe the operationsteps).
4.4.1 Softap go into station controlfigure 4.5 setting station modeThe interface displays the "on-line" and "the current mode is:SOFTAP_MODE mode" said equipment in the SoftAP under the mode of andcontrollable, such as 4.5 on the left.Click the mode select button, Select STATION, then click OK. ".As figure 4.5. Enter the route SSID and after you want the device toenter the station mode to connect to the PASSWORD.Click and send to finish. Equipment goes into station mode.Note: this time to achieve the mobile app control devices, the phonemust be connected to the same route.
4.5 Mode select optionClick "mode selection", the following interface appears:figure 4.6 app mode selectstation ,softap ,sniffer ,Select the corresponding mode forconfiguration, default check the current mode, such as the currentSOFTAP mode.Station: Click STATION list to enter the SSID and PASSWORDconfiguration interface, enter the WiFi name and password afterclicking send."Sniffer": Click SNIFFER to get the module back to "SNIFFER_MODE",while the word "device offline" is displayed, then you need to configurethe smart connection (see Section 4.2)..
5. Work flow profile5. Mobile app and wk1221 work flow profile5.1.1 SOFTAP mode1.Module power in the SoftAP mode, the phone is configured by the userconnect the module of the SoftAP.2 users click on the refresh device, the mobile phone app will broadcasta find packet through the UDP broadcast.If the device is online, stm8 will do a response packet for find.3 after the phone app determines the device online, the display ofthe device online and the current mode is SOFTAP_MODE ". Then the usercan slide the blue and red slider. The device sends TCP information,and the content is set up to 2 PWM duty cycle (PWM between 0-255).Stm8 returns the OK response after the execution of the response.4 then the mobile phone through the AT+ directive, the WiFi moduleconfigured to become station mode, the module will be connected tothe route and fill in the password, and then restart. Waiting formodules to connect successfully to route.5 mobile app connection and WiFi module same route, send find packet,found the device. To determine whether communication with the device.6 the duty cycle of the same control 2 PWM is also controlled by there execution step 3.7 mobile phones can also be configured to become sniffer mode throughAT+, the mode, the WiFi module can capture the surrounding WiFi data.8 mobile app can send a SSID and PASSWORD for any route. When the moduleis caught in the data, it automatically enters the station mode, andthe connection is set to the SSID. Next to the control module in stationmode.5.1.2 SNIFFER mode。1 module power in SNIFFER mode, the phone first connected to any oneAP, open the APP software, click smart connection button, enter thesniffer configuration.2 enter the WiFi AP password, click start configuration. Wk1221 willget around the WiFi information, access to the SSID after the AP andPASSWORD, will automatically restart the station mode, began to connectthe AP.
3 the next reference (5.1.1 SOFTAP mode starting from the 5 step),the phone APP and wk1221 connected to the same AP, you can control.5.2 Stm8 and wk1221work profile1 when the power, the button 1 is not pressed, stm8 will set the WiFimodule for sniffer mode. When the power is pressed, when the key press1S bell, stm8 will set the WiFi module to SoftAP mode. (the code switchcan only be detected once on the stm8, after the power is invalid).2 WiFi module every 500ms to send a pattern query instruction. Getthe latest mode state for wk1221.The 3 module is in SoftAP mode, indicating to 1S time flashing exhibitof lanterns. In station mode, indicating to 200ms time flashing exhibitof lanterns. In other modes, the indicator light is often bright. (thedevelopment board has not left the indicator light, but the code isimplemented).4 when the find packet is received from the mobile phone stm8, theapp returns the module's mode and IP to the phone. To facilitate thephone app judgment equipment online.5 when received from the mobile phone app to send the control PWM packet,stm8 will perform control PWM operation, and then return to the OKapp response to the phone.6 when a query sensor is sent to the mobile phone app, the stm8 executesthe value of each sensor, then returns the data of each sensor to themobile phone app. Mobile app should receive the data displayed on thescreen, for the user to see (mobile app is not realized, SDK hasachieved).

Navigation menu