Difference between revisions of "Component: WLAN (ESP-12S) (Comms: Networking)"
From Flowcode Help
Jump to navigationJump to search| Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
| − | Please click here to download the component source project: [https://www.flowcode.co.uk/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_WLAN_ESP12S.fcfx FC_Comp_Source_WLAN_ESP12S.fcfx] |
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_WLAN_ESP12S.fcfx FC_Comp_Source_WLAN_ESP12S.fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_WLAN_ESP12S.fcfx FC_Comp_Source_WLAN_ESP12S.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
| Line 46: | Line 48: | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
| Line 70: | Line 74: | ||
==Macro reference== | ==Macro reference== | ||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString''' | ||
| + | |- | ||
| + | | colspan="2" | Sends the given Text with no preappendment. Useful for sending preformatted command strings. Appends a CR to the end of the string if SendCR is greater than 0. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Text | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | SendCR | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisconnectFromSSID''' | ||
| + | |- | ||
| + | | colspan="2" | Disconnects from the current SSID. Returns 1 if the command was accepted and returned an "OK" | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClientConnect''' | ||
| + | |- | ||
| + | | colspan="2" | Creates a TCP or UDP connection to a remote server. Returns the state of the connection. 0=Connection failed 1=Connection active | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Type | ||
| + | |- | ||
| + | | colspan="2" | 0 = TCP, 1 = UDP | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | IPAddress | ||
| + | |- | ||
| + | | colspan="2" | e.g. "192.168.1.20" | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | Port | ||
| + | |- | ||
| + | | colspan="2" | Remote port number to connect to, HTTP comms = Port 80 | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ControlTCPServer''' | ||
| + | |- | ||
| + | | colspan="2" | Allows a TCP web page server to be switched on and off on the selected port. Returns 1 if the command was completed correctly. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Enable | ||
| + | |- | ||
| + | | colspan="2" | 0 = Stop Server, 1 = Start Server | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | Port | ||
| + | |- | ||
| + | | colspan="2" | Server port to listen for incoming TCP/IP data requests | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFirmwareVersion''' | ||
| + | |- | ||
| + | | colspan="2" | Collects the firmware version from the ESP8266 module and returns it as a string. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckForPageRequests''' | ||
| + | |- | ||
| + | | colspan="2" | To be called periodically. Returns non-zero if a request has been processed | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClientSendRequest''' | ||
| + | |- | ||
| + | | colspan="2" | Sends out a string with the required AT+CIPSEND=Length$(Request) initialiser. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Request | ||
| + | |- | ||
| + | | colspan="2" | e.g. "GET / HTTP/1.0\r\n\r\n" | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSSIDFromScan''' | ||
| + | |- | ||
| + | | colspan="2" | Collects one of the SSID name strings from the last SSID Scan. The ScanForSSID macro must be called first. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Index | ||
| + | |- | ||
| + | | colspan="2" | SSID Index | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CreateAccessPoint''' | ||
| + | |- | ||
| + | | colspan="2" | Sets up the wireless LAN module into AP mode to host a wireless network. Other WIFI enabled devices can then connect to the module. Returns 1 for success. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | SSID | ||
| + | |- | ||
| + | | colspan="2" | Name of the wireless network to create | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Password | ||
| + | |- | ||
| + | | colspan="2" | Password used to gain access to the network | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Channel | ||
| + | |- | ||
| + | | colspan="2" | 802.11 Channel Range 1-14 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Encryption | ||
| + | |- | ||
| + | | colspan="2" | 0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetOutValue''' | ||
| + | |- | ||
| + | | colspan="2" | Set the value of an outbound substitution string | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | index | ||
| + | |- | ||
| + | | colspan="2" | Range 0-4 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | value | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EndServerConnection''' | ||
| + | |- | ||
| + | | colspan="2" | Disconnects from the current active TCP/IP pipe. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Send_Embedded_HTML_Page4''' | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSignalStrengthFromScan''' | ||
| + | |- | ||
| + | | colspan="2" | Collects the signal strength from the last SSID Scan. The ScanForSSID macro must be called first. Value returned is in negative dB, smaller value = better signal | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Index | ||
| + | |- | ||
| + | | colspan="2" | SSID Index | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Send_Embedded_HTML_Page3''' | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Send_Embedded_HTML_Page2''' | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Send_Embedded_HTML_Page1''' | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadEncryptionModeFromScan''' | ||
| + | |- | ||
| + | | colspan="2" | Collects one of the encryption modes from the last SSID Scan. The ScanForSSID macro must be called first. 0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Index | ||
| + | |- | ||
| + | | colspan="2" | SSID Index | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetByteWithTimeout''' | ||
| + | |- | ||
| + | | colspan="2" | Attempts to receive a byte from the circular buffer. If nothing is available then waits up to 200 ms for data to become available. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetInValue''' | ||
| + | |- | ||
| + | | colspan="2" | Returns the string value of a Request parameter | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | index | ||
| + | |- | ||
| + | | colspan="2" | Index of the request paramter, starting at zero Range 0-2 | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ConnectToSSID''' | ||
| + | |- | ||
| + | | colspan="2" | Attempts to connect to the given SSID and Key values. Returns 1 if the SSID has been connected. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | SSID | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Key | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Timeout | ||
| + | |- | ||
| + | | colspan="2" | Number of seconds to wait for the connection, default 20 | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClientSendArray''' | ||
| + | |- | ||
| + | | colspan="2" | Sends out an array of data bytes with the required AT+CIPSEND=Length$(Request) initialiser. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Data | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | NumBytes | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxArray''' | ||
| + | |- | ||
| + | | colspan="2" | Attempts to receive a number of bytes from the remote connection If nothing is available then waits up to 200 ms for data to become available. Returns the number of bytes received,. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Data | ||
| + | |- | ||
| + | | colspan="2" | Byte array to store the incoming data | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | MaxBytes | ||
| + | |- | ||
| + | | colspan="2" | Maximum number of bytes to try and receive | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ScanForSSID''' | ||
| + | |- | ||
| + | | colspan="2" | Checks for wireless networks in the local area which are broadcasting their SSID. Must not be connected to a network to allow this to function. Returns the number of wireless networks found, max 8. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
| + | |- | ||
| + | | colspan="2" | Initialise the device with the property data. Returns 1 if "ready" message successfully received Returns 0 if no reply from module | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckTCPServerIP''' | ||
| + | |- | ||
| + | | colspan="2" | Collects the local IP address of the active TCP server. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ==Property reference== | ||
| + | |||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | WIFI Properties | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
| + | | width="90%" | Receive Buffer Size | ||
| + | |- | ||
| + | | colspan="2" | Buffer used to store incoming data ready for processing. Default 128 Bytes. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
| + | | width="90%" | Scan Buffer Size | ||
| + | |- | ||
| + | | colspan="2" | Buffer used to hold SSID names when performing a SSID network scan. Default 100 Bytes. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Reset Mode | ||
| + | |- | ||
| + | | colspan="2" | The initialise automatically resets the WIFI module before establishing communications. Software reset uses an AT command to preform the reset Hardware reset uses an extra I/O pin to toggle the signal to the reset pin on the module. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Command Termination | ||
| + | |- | ||
| + | | colspan="2" | Older versions of the firmware require \r to terminate a AT command string. Newer versions of the firmware have changed to use \r\n termination. | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Channel | ||
| + | |- | ||
| + | | colspan="2" | UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Baud Options | ||
| + | |- | ||
| + | | colspan="2" | Baud rate option selector | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
| + | | width="90%" | Baud Rate | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| + | | width="90%" | TX | ||
| + | |- | ||
| + | | colspan="2" | Pin to be used for Transmit data | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | TX Remap Pin | ||
| + | |- | ||
| + | | colspan="2" | Allows the hardware transmit pin to be configured from a list of available pins based on your target device, | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| + | | width="90%" | RX | ||
| + | |- | ||
| + | | colspan="2" | Pin to be used for Receive data | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | RX Remap Pin | ||
| + | |- | ||
| + | | colspan="2" | Allows the hardware receive pin to be configured from a list of available pins based on your target device, | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| + | | width="90%" | Reset | ||
| + | |- | ||
| + | | colspan="2" | WLAN module reset pin connection | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Use Flow Control | ||
| + | |- | ||
| + | | colspan="2" | Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled. | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | HTML Source | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Max Web Pages | ||
| + | |- | ||
| + | | colspan="2" | Maximum number of individual webpages we can serve up with the component. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
| + | | width="90%" | Web Page Timeout | ||
| + | |- | ||
| + | | colspan="2" | Number of cycles to try and send / receive a webpage before timing out. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
| + | | width="90%" | Line Delay | ||
| + | |- | ||
| + | | colspan="2" | Fixed delay in microseconds sent in between sending a HTML line when running as a web page server. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
| + | | width="90%" | Name Page 1 | ||
| + | |- | ||
| + | | colspan="2" | HTML name of webpage 1 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-11-icon.png]] | ||
| + | | width="90%" | HTML Page 1 | ||
| + | |- | ||
| + | | colspan="2" | HTML content for webpage 1 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
| + | | width="90%" | Name Page 2 | ||
| + | |- | ||
| + | | colspan="2" | HTML name of webpage 2 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-11-icon.png]] | ||
| + | | width="90%" | HTML Page 2 | ||
| + | |- | ||
| + | | colspan="2" | HTML content for webpage 2 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
| + | | width="90%" | Name Page 3 | ||
| + | |- | ||
| + | | colspan="2" | HTML name of webpage 3 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-11-icon.png]] | ||
| + | | width="90%" | HTML Page 3 | ||
| + | |- | ||
| + | | colspan="2" | HTML content for webpage 3 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
| + | | width="90%" | Name Page 4 | ||
| + | |- | ||
| + | | colspan="2" | HTML name of webpage 4 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-11-icon.png]] | ||
| + | | width="90%" | HTML Page 4 | ||
| + | |- | ||
| + | | colspan="2" | HTML content for webpage 4 | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Substitutions | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Outgoing | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Count | ||
| + | |- | ||
| + | | colspan="2" | Maximum number of outbound string substitutions | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
| + | | width="90%" | Length 0 | ||
| + | |- | ||
| + | | colspan="2" | Number of bytes to reserve for data string. | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Incoming | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Count | ||
| + | |- | ||
| + | | colspan="2" | Maximum number of inbound string substitutions | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
| + | | width="90%" | Length 0 | ||
| + | |- | ||
| + | | colspan="2" | Number of bytes to reserve for data string. | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
| + | | width="90%" | Label | ||
| + | |- | ||
| + | | colspan="2" | Text label used to help identify the component on the panel. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Simulation Method | ||
| + | |- | ||
| + | | colspan="2" | Decides how to handle the simulation of the component. TCP Base - Allows simulation of the network communications using the TCP Base component and DLL. COM/Injector - Allows the simulation to connect to real hardware or injectors. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| + | | width="90%" | Console Data | ||
| + | |- | ||
| + | | colspan="2" | Decides if simulation TCP data is available via a console tab | ||
| + | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
Revision as of 10:00, 27 January 2023
| Author | Matrix Ltd. |
| Version | 2.1 |
| Category | Comms: Networking |
Contents
WLAN (ESP-12S) component
Wireless LAN component designed to work with the ESP-12S module. Provides a very simple interface to allow webpages to be hosted from hardware or simulation. Also available in the form of the BL0136 WIFI E-block.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_WLAN_ESP12S.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_WLAN_ESP12S.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
| DisconnectFromSSID | |
| Disconnects from the current SSID. Returns 1 if the command was accepted and returned an "OK" | |
| Return | |
| GetFirmwareVersion | |
| Collects the firmware version from the ESP8266 module and returns it as a string. | |
| Return | |
| CheckForPageRequests | |
| To be called periodically. Returns non-zero if a request has been processed | |
| Return | |
| ClientSendRequest | |
| Sends out a string with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Request | |
| e.g. "GET / HTTP/1.0\r\n\r\n" | |
| Return | |
| ReadSSIDFromScan | |
| Collects one of the SSID name strings from the last SSID Scan. The ScanForSSID macro must be called first. | |
| Index | |
| SSID Index | |
| Return | |
| SetOutValue | |
| Set the value of an outbound substitution string | |
| index | |
| Range 0-4 | |
| value | |
| Return | |
| EndServerConnection | |
| Disconnects from the current active TCP/IP pipe. | |
| Return | |
| Send_Embedded_HTML_Page4 | |
| Return | |
| Send_Embedded_HTML_Page3 | |
| Return | |
| Send_Embedded_HTML_Page2 | |
| Return | |
| Send_Embedded_HTML_Page1 | |
| Return | |
| GetByteWithTimeout | |
| Attempts to receive a byte from the circular buffer. If nothing is available then waits up to 200 ms for data to become available. | |
| Return | |
| GetInValue | |
| Returns the string value of a Request parameter | |
| index | |
| Index of the request paramter, starting at zero Range 0-2 | |
| Return | |
| ClientSendArray | |
| Sends out an array of data bytes with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Data | |
| NumBytes | |
| Return | |
| Initialise | |
| Initialise the device with the property data. Returns 1 if "ready" message successfully received Returns 0 if no reply from module | |
| Return | |
| CheckTCPServerIP | |
| Collects the local IP address of the active TCP server. | |
| Return | |
Property reference
==Macro reference==
| DisconnectFromSSID | |
| Disconnects from the current SSID. Returns 1 if the command was accepted and returned an "OK" | |
| Return | |
| GetFirmwareVersion | |
| Collects the firmware version from the ESP8266 module and returns it as a string. | |
| Return | |
| CheckForPageRequests | |
| To be called periodically. Returns non-zero if a request has been processed | |
| Return | |
| ClientSendRequest | |
| Sends out a string with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Request | |
| e.g. "GET / HTTP/1.0\r\n\r\n" | |
| Return | |
| ReadSSIDFromScan | |
| Collects one of the SSID name strings from the last SSID Scan. The ScanForSSID macro must be called first. | |
| Index | |
| SSID Index | |
| Return | |
| SetOutValue | |
| Set the value of an outbound substitution string | |
| index | |
| Range 0-4 | |
| value | |
| Return | |
| EndServerConnection | |
| Disconnects from the current active TCP/IP pipe. | |
| Return | |
| Send_Embedded_HTML_Page4 | |
| Return | |
| Send_Embedded_HTML_Page3 | |
| Return | |
| Send_Embedded_HTML_Page2 | |
| Return | |
| Send_Embedded_HTML_Page1 | |
| Return | |
| GetByteWithTimeout | |
| Attempts to receive a byte from the circular buffer. If nothing is available then waits up to 200 ms for data to become available. | |
| Return | |
| GetInValue | |
| Returns the string value of a Request parameter | |
| index | |
| Index of the request paramter, starting at zero Range 0-2 | |
| Return | |
| ClientSendArray | |
| Sends out an array of data bytes with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Data | |
| NumBytes | |
| Return | |
| Initialise | |
| Initialise the device with the property data. Returns 1 if "ready" message successfully received Returns 0 if no reply from module | |
| Return | |
| CheckTCPServerIP | |
| Collects the local IP address of the active TCP server. | |
| Return | |
Property reference
==Macro reference==
| DisconnectFromSSID | |
| Disconnects from the current SSID. Returns 1 if the command was accepted and returned an "OK" | |
| Return | |
| GetFirmwareVersion | |
| Collects the firmware version from the ESP8266 module and returns it as a string. | |
| Return | |
| CheckForPageRequests | |
| To be called periodically. Returns non-zero if a request has been processed | |
| Return | |
| ClientSendRequest | |
| Sends out a string with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Request | |
| e.g. "GET / HTTP/1.0\r\n\r\n" | |
| Return | |
| ReadSSIDFromScan | |
| Collects one of the SSID name strings from the last SSID Scan. The ScanForSSID macro must be called first. | |
| Index | |
| SSID Index | |
| Return | |
| SetOutValue | |
| Set the value of an outbound substitution string | |
| index | |
| Range 0-4 | |
| value | |
| Return | |
| EndServerConnection | |
| Disconnects from the current active TCP/IP pipe. | |
| Return | |
| Send_Embedded_HTML_Page4 | |
| Return | |
| Send_Embedded_HTML_Page3 | |
| Return | |
| Send_Embedded_HTML_Page2 | |
| Return | |
| Send_Embedded_HTML_Page1 | |
| Return | |
| GetByteWithTimeout | |
| Attempts to receive a byte from the circular buffer. If nothing is available then waits up to 200 ms for data to become available. | |
| Return | |
| GetInValue | |
| Returns the string value of a Request parameter | |
| index | |
| Index of the request paramter, starting at zero Range 0-2 | |
| Return | |
| ClientSendArray | |
| Sends out an array of data bytes with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Data | |
| NumBytes | |
| Return | |
| Initialise | |
| Initialise the device with the property data. Returns 1 if "ready" message successfully received Returns 0 if no reply from module | |
| Return | |
| CheckTCPServerIP | |
| Collects the local IP address of the active TCP server. | |
| Return | |
Property reference
==Macro reference==
| DisconnectFromSSID | |
| Disconnects from the current SSID. Returns 1 if the command was accepted and returned an "OK" | |
| Return | |
| GetFirmwareVersion | |
| Collects the firmware version from the ESP8266 module and returns it as a string. | |
| Return | |
| CheckForPageRequests | |
| To be called periodically. Returns non-zero if a request has been processed | |
| Return | |
| ClientSendRequest | |
| Sends out a string with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Request | |
| e.g. "GET / HTTP/1.0\r\n\r\n" | |
| Return | |
| ReadSSIDFromScan | |
| Collects one of the SSID name strings from the last SSID Scan. The ScanForSSID macro must be called first. | |
| Index | |
| SSID Index | |
| Return | |
| SetOutValue | |
| Set the value of an outbound substitution string | |
| index | |
| Range 0-4 | |
| value | |
| Return | |
| EndServerConnection | |
| Disconnects from the current active TCP/IP pipe. | |
| Return | |
| Send_Embedded_HTML_Page4 | |
| Return | |
| Send_Embedded_HTML_Page3 | |
| Return | |
| Send_Embedded_HTML_Page2 | |
| Return | |
| Send_Embedded_HTML_Page1 | |
| Return | |
| GetByteWithTimeout | |
| Attempts to receive a byte from the circular buffer. If nothing is available then waits up to 200 ms for data to become available. | |
| Return | |
| GetInValue | |
| Returns the string value of a Request parameter | |
| index | |
| Index of the request paramter, starting at zero Range 0-2 | |
| Return | |
| ClientSendArray | |
| Sends out an array of data bytes with the required AT+CIPSEND=Length$(Request) initialiser. | |
| Data | |
| NumBytes | |
| Return | |
| Initialise | |
| Initialise the device with the property data. Returns 1 if "ready" message successfully received Returns 0 if no reply from module | |
| Return | |
| CheckTCPServerIP | |
| Collects the local IP address of the active TCP server. | |
| Return | |