Difference between revisions of "Component: WIFI (BL0136) (E-blocks 2)"

From Flowcode Help
Jump to navigationJump to search
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix Ltd.
 
| Matrix Ltd.
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 2.1 (Release)
+
| 2.1
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| E-blocks 2
 
| E-blocks 2
 
|}
 
|}
  
  
 +
==WIFI 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.
  
==[[File:Component Icon ea9c0946_5f88_4f9a_ae5f_8ba9b981b389.png|Image]] WIFI (BL0136) component==
+
==Component Source Code==
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.
 
  
This component can be used for connecting a system to a wifi network, by using the ‘ScanForSSID’ component macro. Then different macros can be used to read the encryption mode, the signal strength or the specific SSID of one of the networks picked up in the scan. There is also a ‘ConnectToSSID’ macro which allows you to connect your program to a wifi network (as long as you have a sufficient password) and another macro you can use to disconnect from the network again.
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBlocks2_WLAN_ESP12S_BL0136.fcfx FC_Comp_Source_EBlocks2_WLAN_ESP12S_BL0136.fcfx]
As well as connecting to a wifi network, there is a component macro called ‘CreateAccessPoint’ which creates an access point (with a chosen SSID, password, channel, and encryption) for other people to connect to.
 
  
==Examples==
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBlocks2_WLAN_ESP12S_BL0136.fcfx FC_Comp_Source_EBlocks2_WLAN_ESP12S_BL0136.fcfx]
''<span style="color:red;">No additional examples</span>''
 
  
 +
==Detailed description==
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>DisconnectFromSSID</tt></u></span>===
 
Disconnects from the current SSID.
 
  
Returns 1 if the command was accepted and returned an "OK"
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
 
  
  
===<span style="font-weight: normal;"><u><tt>SendString</tt></u></span>===
 
Sends the given Text.
 
  
Appends a CR to the end of the string it SendCR is greater than 0.
+
''No detailed description exists yet for this component''
  
'''Parameters'''
+
==Examples==
  
:[[Variable Types|<- STRING]] ''Text''
 
::''This parameter may be returned back to the caller''
 
  
:[[Variable Types|BYTE]] ''SendCR''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>ClientConnect</tt></u></span>===
 
Creates a TCP or UDP connection to a remote server.
 
  
Returns the state of the connection.
 
  
0=Connection failed
 
  
1=Connection active
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Type''
 
::0 = TCP, 1 = UDP
 
  
:[[Variable Types|<- STRING]] ''IPAddress''
+
The examples below are all done using a EB091 board as the host
::e.g. "192.168.1.20"
 
::''This parameter may be returned back to the caller''
 
  
:[[Variable Types|UINT]] ''Port''
+
The EB069 ESP8266 Wifi E-block is connected to PORTD 0-7 with the patch setting set to B.
::Remote port number to connect to, HTTP comms = Port 80
 
  
 +
The EB005 LCD E-block is connected to PORTB 0-7 with the patch setting set to Default.
  
'''Return value'''
+
Other host boards are compatible with the examples, simply change the target chip and component connection properties.
  
:[[Variable Types|BYTE]]
 
  
  
===<span style="font-weight: normal;"><u><tt>ControlTCPServer</tt></u></span>===
+
===Firmware Test===
Allows a TCP web page server to be switched on and off on the selected port.
 
  
Returns 1 if the command was completed correctly.
+
This example collects the firmware version from the ESP8266 module and displays it on an LCD. Tested working with firmware version 00150900.
  
'''Parameters'''
+
{{Fcfile|ESP8266_FirmwareTest.fcfx|FirmwareTest}}
  
:[[Variable Types|BYTE]] ''Enable''
 
::0 = Stop Server, 1 = Start Server
 
  
:[[Variable Types|UINT]] ''Port''
+
===Wireless Scanner===
::Server port to listen for incoming TCP/IP data requests
 
  
 +
This example scans for wireless networks in range and prints the network IDs to the LCD along with the signal strength and security type.
  
'''Return value'''
+
{{Fcfile|ESP8266_WifiScan.fcfx|WifiScan}}
  
:[[Variable Types|BYTE]]
 
  
 +
===Creating An Access Point===
  
===<span style="font-weight: normal;"><u><tt>GetFirmwareVersion</tt></u></span>===
+
This example creates an access point you can connect your phone or laptop to named Flowcode_ESP8266. The password to connect to the access point is flowcode6.
Collects the firmware version from the ESP8266 module and returns it as a string.
 
  
'''Parameters'''
+
Note this example simply creates an access point, no data is transferred.
  
:''This macro has no parameters''
+
{{Fcfile|ESP8266_CreateAP.fcfx|CreateAP}}
  
  
'''Return value'''
+
===Joining An Access Point===
  
:[[Variable Types|STRING]]
+
This example joins an existing access point. The network ID and Password must be altered to match your local WIFI network settings.
  
 +
Note this example simply joins an access point, no data is transferred.
  
===<span style="font-weight: normal;"><u><tt>CheckForPageRequests</tt></u></span>===
+
{{Fcfile|ESP8266_JoinAP.fcfx|JoinAP}}
To be called periodically. Returns non-zero if a request has been processed
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
===TCP Client===
  
 +
This example joins an existing access point. The network ID and Password must be altered to match your local WIFI network settings.
  
'''Return value'''
+
Once joined to the network the example connects to the MatrixTSL website and requests a file which is printed out on the LCD.
  
:[[Variable Types|BYTE]]
+
{{Fcfile|ESP8266_TCPClient.fcfx|TCPClient}}
  
  
===<span style="font-weight: normal;"><u><tt>ClientSendRequest</tt></u></span>===
+
===TCP Server===
Sends out a request for data
 
  
'''Parameters'''
+
This example creates an access point you can connect your phone or laptop to named Flowcode_ESP8266. The password to connect to the access point is flowcode6.
  
:[[Variable Types|<- STRING]] ''Request''
+
Once the access point is created the example shows the server IP address on the LCD.  
::e.g. "GET / HTTP/1.0\r\n\r\n"
+
Connecting to the wireless network on your phone or laptop and visiting the IP address shown on the LCD using a web browser allows you to switch LED outputs on and off.
::''This parameter may be returned back to the caller''
 
  
 +
{{Fcfile|ESP8266_TCPServer.fcfx|TCPServer}}
  
'''Return value'''
 
  
:''This call does not return a value''
+
===Network Comms===
  
 +
Here are some examples using the Network Communication component linked to the ESP8266 component.
  
===<span style="font-weight: normal;"><u><tt>ReadSSIDFromScan</tt></u></span>===
+
{{Fcfile|NetworkComms-ESP8266-Client.fcfx|NetworkComms ESP8266 Client}}
Collects one of the SSID name strings from the last SSID Scan.
 
  
The ScanForSSID macro must be called first.
+
{{Fcfile|NetworkComms-ESP8266-Server.fcfx|NetworkComms ESP8266 Webserver}}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Index''
 
::SSID Index
 
  
  
'''Return value'''
 
  
:[[Variable Types|STRING]]
 
  
  
===<span style="font-weight: normal;"><u><tt>CreateAccessPoint</tt></u></span>===
 
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.
 
  
'''Parameters'''
 
  
:[[Variable Types|<- STRING]] ''SSID''
 
::Name of the wireless network to create
 
::''This parameter may be returned back to the caller''
 
  
:[[Variable Types|<- STRING]] ''Password''
 
::Password used to gain access to the network
 
::''This parameter may be returned back to the caller''
 
  
:[[Variable Types|BYTE]] ''Channel''
+
==Macro reference==
::802.11 Channel Range 1-14
 
  
:[[Variable Types|BYTE]] ''Encryption''
+
===CheckForPageRequests===
::0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK
+
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
===CheckTCPServerIP===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
===ClientConnect===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Type
 +
|-
 +
| colspan="2" | 0 = TCP, 1 = UDP&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | IPAddress
 +
|-
 +
| colspan="2" | e.g. "192.168.1.20"&nbsp;
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SetOutValue</tt></u></span>===
 
Set the value of an outbound substitution string
 
  
'''Parameters'''
+
===ClientSendArray===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | NumBytes
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''index''
 
::Range 0-4
 
  
:[[Variable Types|<- STRING]] ''value''
+
===ClientSendRequest===
::''This parameter may be returned back to the caller''
+
{| 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.&nbsp;
 +
|-
 +
|-
 +
| 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"&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
===ConnectToSSID===
 +
{| 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. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | SSID
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Key
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:''This call does not return a value''
 
  
 +
===ControlTCPServer===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Enable
 +
|-
 +
| colspan="2" | 0 = Stop Server, 1 = Start Server&nbsp;
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>ReadSignalStrengthFromScan</tt></u></span>===
 
Collects the signal strength from the last SSID Scan.
 
  
The ScanForSSID macro must be called first.
+
===CreateAccessPoint===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | SSID
 +
|-
 +
| colspan="2" | Name of the wireless network to create&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Password
 +
|-
 +
| colspan="2" | Password used to gain access to the network&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | 802.11 Channel Range 1-14&nbsp;
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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''
 +
|}
  
Value returned is in negative dB, smaller value = better signal
 
  
'''Parameters'''
+
===DisconnectFromSSID===
 +
{| 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"&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''Index''
 
::SSID Index
 
  
 +
===EndServerConnection===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
===GetByteWithTimeout===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>ReadEncryptionModeFromScan</tt></u></span>===
+
===GetFirmwareVersion===
Collects one of the encryption modes from the last SSID Scan.
+
{| 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.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
The ScanForSSID macro must be called first.
 
  
0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK
+
===GetInValue===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Index''
+
===GetRxArray===
::SSID Index
+
{| 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,.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Byte array to store the incoming data&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | MaxBytes
 +
|-
 +
| colspan="2" | Maximum number of bytes to try and receive&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
===Initialise===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
===ReadEncryptionModeFromScan===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | SSID Index&nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>GetByteWithTimeout</tt></u></span>===
 
Attempts to receive a byte from the circular buffer.
 
  
If nothing is available then waits up to 20 ms for data to become available.
+
===ReadSSIDFromScan===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | SSID Index&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
===ReadSignalStrengthFromScan===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | SSID Index&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
===ScanForSSID===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
===SendString===
 +
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Text
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SendCR
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>GetInValue</tt></u></span>===
 
Returns the string value of a Request parameter
 
  
'''Parameters'''
+
===Send_Embedded_HTML_Page1===
 +
{| 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" | &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''index''
 
::Index of the request paramter, starting at zero Range 0-2
 
  
 +
===Send_Embedded_HTML_Page2===
 +
{| 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" | &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|STRING]]
+
===Send_Embedded_HTML_Page3===
 +
{| 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" | &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>ConnectToSSID</tt></u></span>===
+
===Send_Embedded_HTML_Page4===
Attempts to connect to the given SSID and Key values.  
+
{| 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" | &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
Returns 1 if the SSID has been connected.
 
  
'''Parameters'''
+
===SetOutValue===
 
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
:[[Variable Types|<- STRING]] ''SSID''
+
|-
::''This parameter may be returned back to the caller''
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetOutValue'''
:[[Variable Types|<- STRING]] ''Key''
+
|-
::''This parameter may be returned back to the caller''
+
| colspan="2" | Set the value of an outbound substitution string&nbsp;
 
+
|-
:[[Variable Types|BYTE]] ''Timeout''
+
|-
::Number of seconds to wait for the connection, default 2
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
+
| width="90%" | index
 
+
|-
'''Return value'''
+
| colspan="2" | Range 0-4&nbsp;
 
+
|-
:[[Variable Types|BYTE]]
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
+
| width="90%" | value
 
+
|-
===<span style="font-weight: normal;"><u><tt>ScanForSSID</tt></u></span>===
+
| colspan="2" | &nbsp;
Checks for wireless networks in the local area which are broadcasting their SSID.
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Must not be connected to a network to allow this to function.
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
+
|}
Returns the number of wireless networks found, max 8.
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Initialise the device with the property data.
 
 
 
Returns 1 if "ready" message successfully received
 
 
 
Returns 0 if no reply from module
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>CheckTCPServerIP</tt></u></span>===
 
Collects the local IP address of the active TCP server.
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|STRING]]
 
 
 
 
 
 
 
==Simulation macro reference==
 
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Receive Buffer Size</u></span>
 
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''RxBufferSize''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Buffer used to store incoming data ready for processing.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
Default 128 Bytes.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Scan Buffer Size</u></span>
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | WIFI Properties
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''ScanBufferSize''.
+
|-
 
+
|-
Buffer used to hold SSID names when performing a SSID network scan.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Receive Buffer Size
Default 100 Bytes.
+
|-
 
+
| colspan="2" | Buffer used to store incoming data ready for processing. Default 128 Bytes.&nbsp;
<span style="font-weight: normal;"><u>Reset Mode</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ResetMode''.
+
| width="90%" | Scan Buffer Size
 
+
|-
The initialise automatically resets the WIFI module before establishing communications.
+
| colspan="2" | Buffer used to hold SSID names when performing a SSID network scan. Default 100 Bytes.&nbsp;
 
+
|-
Software reset uses an AT command to preform the reset
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Reset Mode
Hardware reset uses an extra I/O pin to toggle the signal to the reset pin on the module.
+
|-
 
+
| 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.&nbsp;
<span style="font-weight: normal;"><u>Command Termination</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Termination''.
+
| width="90%" | Command Termination
 
+
|-
Older versions of the firmware require \r to terminate a AT command string.
+
| 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.&nbsp;
 
+
|-
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
<span style="font-weight: normal;"><u>Channel</u></span>
+
|-
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''group1::cal_uart1::CHANNEL''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Channel
UART Channel selector
+
|-
 
+
| 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.&nbsp;
Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Hardware channels use the selected peripheral on-board the target microcontroller.
+
| width="90%" | Baud Options
 
+
|-
<span style="font-weight: normal;"><u>Baud Options</u></span>
+
| colspan="2" | Baud rate option selector&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''group1::cal_uart1::BAUD_LIST''.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Baud Rate
Baud rate option selector
+
|-
 
+
| colspan="2" | &nbsp;
<span style="font-weight: normal;"><u>Baud Rate</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Signed integer'' and can be referenced with the variable name ''group1::cal_uart1::BAUD''.
+
| width="90%" | TX
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| colspan="2" | Pin to be used for Transmit data&nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | TX Remap Pin
<span style="font-weight: normal;"><u>TX</u></span>
+
|-
 
+
| colspan="2" | Allows the hardware transmit pin to be configured from a list of available pins based on your target device,&nbsp;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''group1::cal_uart1::TX''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Pin to be used for Transmit data
+
| width="90%" | RX
 
+
|-
<span style="font-weight: normal;"><u>TX Remap Pin</u></span>
+
| colspan="2" | Pin to be used for Receive data&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''group1::cal_uart1::OutputPins''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | RX Remap Pin
Allows the hardware transmit pin to be configured from a list of available pins based on your target device,
+
|-
 
+
| colspan="2" | Allows the hardware receive pin to be configured from a list of available pins based on your target device,&nbsp;
<span style="font-weight: normal;"><u>RX</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''group1::cal_uart1::RX''.
+
| width="90%" | Reset
 
+
|-
Pin to be used for Receive data
+
| colspan="2" | WLAN module reset pin connection&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>RX Remap Pin</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Use Flow Control
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''group1::cal_uart1::InputPins''.
+
|-
 
+
| 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.&nbsp;
Allows the hardware receive pin to be configured from a list of available pins based on your target device,
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Reset</u></span>
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | HTML Source
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''RESET''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
WLAN module reset pin connection
+
| width="90%" | Max Web Pages
 
+
|-
<span style="font-weight: normal;"><u>Use Flow Control</u></span>
+
| colspan="2" | Maximum number of individual webpages we can serve up with the component.&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''group1::cal_uart1::FLOWEN''.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Web Page Timeout
Flow Control (Handshake) enable or disable.
+
|-
 
+
| colspan="2" | Number of cycles to try and send / receive a webpage before timing out.&nbsp;
    On: Two I/O pins are used to control the flow of data in and out of the device.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
    Off: Flow control is disabled.
+
| width="90%" | Line Delay
 
+
|-
<span style="font-weight: normal;"><u>Max Web Pages</u></span>
+
| colspan="2" | Fixed delay in microseconds sent in between sending a HTML line when running as a web page server.&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''PAGES''.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Name Page 1
Maximum number of individual webpages we can serve up with the component.
+
|-
 
+
| colspan="2" | HTML name of webpage 1&nbsp;
<span style="font-weight: normal;"><u>Web Page Timeout</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-11-icon.png]]
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''TIMEOUT''.
+
| width="90%" | HTML Page 1
 
+
|-
Number of cycles to try and send / receive a webpage before timing out.
+
| colspan="2" | HTML content for webpage 1&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Line Delay</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Name Page 2
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''LineDelay''.
+
|-
 
+
| colspan="2" | HTML name of webpage 2&nbsp;
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-11-icon.png]]
<span style="font-weight: normal;"><u>Name Page 1</u></span>
+
| width="90%" | HTML Page 2
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''name1''.
+
| colspan="2" | HTML content for webpage 2&nbsp;
 
+
|-
HTML name of webpage 1
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Name Page 3
<span style="font-weight: normal;"><u>HTML Page 1</u></span>
+
|-
 
+
| colspan="2" | HTML name of webpage 3&nbsp;
This property is of type ''Multiple lines of text'' and can be referenced with the variable name ''html1''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-11-icon.png]]
HTML content for webpage 1
+
| width="90%" | HTML Page 3
 
+
|-
<span style="font-weight: normal;"><u>Name Page 2</u></span>
+
| colspan="2" | HTML content for webpage 3 &nbsp;
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''name2''.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Name Page 4
HTML name of webpage 2
+
|-
 
+
| colspan="2" | HTML name of webpage 4&nbsp;
<span style="font-weight: normal;"><u>HTML Page 2</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-11-icon.png]]
This property is of type ''Multiple lines of text'' and can be referenced with the variable name ''html2''.
+
| width="90%" | HTML Page 4
 
+
|-
HTML content for webpage 2
+
| colspan="2" | HTML content for webpage 4&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Name Page 3</u></span>
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Substitutions
This property is of type ''Line of text'' and can be referenced with the variable name ''name3''.
+
|-
 
+
|-
HTML name of webpage 3
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Outgoing
<span style="font-weight: normal;"><u>HTML Page 3</u></span>
+
|-
 
+
|-
This property is of type ''Multiple lines of text'' and can be referenced with the variable name ''html3''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Count
HTML content for webpage 3
+
|-
 
+
| colspan="2" | Maximum number of outbound string substitutions&nbsp;
<span style="font-weight: normal;"><u>Name Page 4</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''name4''.
+
| width="90%" | Length 0
 
+
|-
HTML name of webpage 4
+
| colspan="2" | Number of bytes to reserve for data string.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>HTML Page 4</u></span>
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Incoming
This property is of type ''Multiple lines of text'' and can be referenced with the variable name ''html4''.
+
|-
 
+
|-
HTML content for webpage 4
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Count
<span style="font-weight: normal;"><u>Count</u></span>
+
|-
 
+
| colspan="2" | Maximum number of inbound string substitutions&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Outgoing_Count''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
Maximum number of outbound string substitutions
+
| width="90%" | Length 0
 
+
|-
<span style="font-weight: normal;"><u>Length 0</u></span>
+
| colspan="2" | Number of bytes to reserve for data string.&nbsp;
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''Out_Len_0''.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
Number of bytes to reserve for data string.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Count</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Label
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Incoming_Count''.
+
|-
 
+
| colspan="2" | Text label used to help identify the component on the panel.&nbsp;
Maximum number of inbound string substitutions
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
<span style="font-weight: normal;"><u>Length 0</u></span>
+
| width="90%" | Show Comms Flasher
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''In_Len_0''.
+
| colspan="2" | &nbsp;
 
+
|-
Number of bytes to reserve for data string.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Simulation Method
<span style="font-weight: normal;"><u>Label</u></span>
+
|-
 
+
| 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.&nbsp;
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Text label used to help identify the component on the panel.
+
| width="90%" | Scope Traces
 
+
|-
<span style="font-weight: normal;"><u>Simulation Method</u></span>
+
| colspan="2" | Selects if the scope traces are automatically added to the data recorder window or not.     Simulation - draws an approximation of the UART data onto the scope trace.    ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''SimMethod''.
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Console Data
Decides how to handle the simulation of the component.
+
|-
 
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
TCP Base - Allows simulation of the network communications using the TCP Base component and DLL.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
COM/Injector - Allows the simulation to connect to real hardware or injectors.
+
| width="90%" | Console Columns
 
+
|-
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
| colspan="2" | Number of characters that can be displayed on a single line of the console.&nbsp;
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''group1::cal_uart1::ScopeTraces''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Data Source
Selects if the scope traces are automatically added to the data recorder window or not.
+
|-
 
+
| colspan="2" | Simulation data source used to allow the component to connect to various remote devices    Nothing - Simulation data is ignored    COM port - Routes the communication data to and from a physical or virtual COM port      Injector - Routes the communication data via a data injector component on the Panel.&nbsp;
    Simulation - draws an approximation of the UART data onto the scope trace.
+
|}
 
 
    ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
 
 
 
<span style="font-weight: normal;"><u>Console Data</u></span>
 
 
 
This property is of type ''True or false'' and can be referenced with the variable name ''group1::cal_uart1::ConsoleData''.
 
 
 
Selects if the console data is automatically generated or not
 
 
 
<span style="font-weight: normal;"><u>Console Columns</u></span>
 
 
 
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''group1::cal_uart1::ConsoleColumns''.
 
 
 
Number of characters that can be displayed on a single line of the console.
 
 
 
<span style="font-weight: normal;"><u>Data Source</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''group1::cal_uart1::DataSource''.
 
 
 
Simulation data source used to allow the component to connect to various remote devices
 
 
 
     Nothing - Simulation data is ignored
 
 
 
     COM port - Routes the communication data to and from a physical or virtual COM port
 
 
 
    Injector - Routes the communication data via a data injector component on the Panel.
 

Latest revision as of 10:26, 20 October 2023

Author Matrix Ltd.
Version 2.1
Category E-blocks 2


WIFI 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_EBlocks2_WLAN_ESP12S_BL0136.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_EBlocks2_WLAN_ESP12S_BL0136.fcfx

Detailed description

No detailed description exists yet for this component

Examples

The examples below are all done using a EB091 board as the host

The EB069 ESP8266 Wifi E-block is connected to PORTD 0-7 with the patch setting set to B.

The EB005 LCD E-block is connected to PORTB 0-7 with the patch setting set to Default.

Other host boards are compatible with the examples, simply change the target chip and component connection properties.


Firmware Test

This example collects the firmware version from the ESP8266 module and displays it on an LCD. Tested working with firmware version 00150900.

FC6 Icon.png FirmwareTest


Wireless Scanner

This example scans for wireless networks in range and prints the network IDs to the LCD along with the signal strength and security type.

FC6 Icon.png WifiScan


Creating An Access Point

This example creates an access point you can connect your phone or laptop to named Flowcode_ESP8266. The password to connect to the access point is flowcode6.

Note this example simply creates an access point, no data is transferred.

FC6 Icon.png CreateAP


Joining An Access Point

This example joins an existing access point. The network ID and Password must be altered to match your local WIFI network settings.

Note this example simply joins an access point, no data is transferred.

FC6 Icon.png JoinAP


TCP Client

This example joins an existing access point. The network ID and Password must be altered to match your local WIFI network settings.

Once joined to the network the example connects to the MatrixTSL website and requests a file which is printed out on the LCD.

FC6 Icon.png TCPClient


TCP Server

This example creates an access point you can connect your phone or laptop to named Flowcode_ESP8266. The password to connect to the access point is flowcode6.

Once the access point is created the example shows the server IP address on the LCD. Connecting to the wireless network on your phone or laptop and visiting the IP address shown on the LCD using a web browser allows you to switch LED outputs on and off.

FC6 Icon.png TCPServer


Network Comms

Here are some examples using the Network Communication component linked to the ESP8266 component.

FC6 Icon.png NetworkComms ESP8266 Client

FC6 Icon.png NetworkComms ESP8266 Webserver







Macro reference

CheckForPageRequests

Fc9-comp-macro.png CheckForPageRequests
To be called periodically. Returns non-zero if a request has been processed 
Fc9-u8-icon.png - BYTE Return


CheckTCPServerIP

Fc9-comp-macro.png CheckTCPServerIP
Collects the local IP address of the active TCP server. 
Fc9-string-icon.png - STRING Return


ClientConnect

Fc9-comp-macro.png ClientConnect
Creates a TCP or UDP connection to a remote server. Returns the state of the connection. 0=Connection failed 1=Connection active 
Fc9-u8-icon.png - BYTE Type
0 = TCP, 1 = UDP 
Fc9-string-icon.png - STRING IPAddress
e.g. "192.168.1.20" 
Fc9-u16-icon.png - UINT Port
Remote port number to connect to, HTTP comms = Port 80 
Fc9-u8-icon.png - BYTE Return


ClientSendArray

Fc9-comp-macro.png ClientSendArray
Sends out an array of data bytes with the required AT+CIPSEND=Length$(Request) initialiser. 
Fc9-u8-icon.png - BYTE Data
 
Fc9-u16-icon.png - UINT NumBytes
 
Fc9-void-icon.png - VOID Return


ClientSendRequest

Fc9-comp-macro.png ClientSendRequest
Sends out a string with the required AT+CIPSEND=Length$(Request) initialiser. 
Fc9-string-icon.png - STRING Request
e.g. "GET / HTTP/1.0\r\n\r\n" 
Fc9-void-icon.png - VOID Return


ConnectToSSID

Fc9-comp-macro.png ConnectToSSID
Attempts to connect to the given SSID and Key values. Returns 1 if the SSID has been connected.  
Fc9-string-icon.png - STRING SSID
 
Fc9-string-icon.png - STRING Key
 
Fc9-u8-icon.png - BYTE Timeout
Number of seconds to wait for the connection, default 20 
Fc9-u8-icon.png - BYTE Return


ControlTCPServer

Fc9-comp-macro.png ControlTCPServer
Allows a TCP web page server to be switched on and off on the selected port. Returns 1 if the command was completed correctly. 
Fc9-u8-icon.png - BYTE Enable
0 = Stop Server, 1 = Start Server 
Fc9-u16-icon.png - UINT Port
Server port to listen for incoming TCP/IP data requests 
Fc9-u8-icon.png - BYTE Return


CreateAccessPoint

Fc9-comp-macro.png CreateAccessPoint
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. 
Fc9-string-icon.png - STRING SSID
Name of the wireless network to create 
Fc9-string-icon.png - STRING Password
Password used to gain access to the network 
Fc9-u8-icon.png - BYTE Channel
802.11 Channel Range 1-14 
Fc9-u8-icon.png - BYTE Encryption
0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK 
Fc9-u8-icon.png - BYTE Return


DisconnectFromSSID

Fc9-comp-macro.png DisconnectFromSSID
Disconnects from the current SSID. Returns 1 if the command was accepted and returned an "OK" 
Fc9-u8-icon.png - BYTE Return


EndServerConnection

Fc9-comp-macro.png EndServerConnection
Disconnects from the current active TCP/IP pipe. 
Fc9-u8-icon.png - BYTE Return


GetByteWithTimeout

Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Return


GetFirmwareVersion

Fc9-comp-macro.png GetFirmwareVersion
Collects the firmware version from the ESP8266 module and returns it as a string. 
Fc9-string-icon.png - STRING Return


GetInValue

Fc9-comp-macro.png GetInValue
Returns the string value of a Request parameter 
Fc9-u8-icon.png - BYTE index
Index of the request paramter, starting at zero Range 0-2 
Fc9-string-icon.png - STRING Return


GetRxArray

Fc9-comp-macro.png GetRxArray
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,. 
Fc9-u8-icon.png - BYTE Data
Byte array to store the incoming data 
Fc9-u16-icon.png - UINT MaxBytes
Maximum number of bytes to try and receive 
Fc9-u16-icon.png - UINT Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the device with the property data. Returns 1 if "ready" message successfully received Returns 0 if no reply from module 
Fc9-u8-icon.png - BYTE Return


ReadEncryptionModeFromScan

Fc9-comp-macro.png ReadEncryptionModeFromScan
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 
Fc9-u8-icon.png - BYTE Index
SSID Index 
Fc9-u8-icon.png - BYTE Return


ReadSSIDFromScan

Fc9-comp-macro.png ReadSSIDFromScan
Collects one of the SSID name strings from the last SSID Scan. The ScanForSSID macro must be called first. 
Fc9-u8-icon.png - BYTE Index
SSID Index 
Fc9-string-icon.png - STRING Return


ReadSignalStrengthFromScan

Fc9-comp-macro.png ReadSignalStrengthFromScan
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 
Fc9-u8-icon.png - BYTE Index
SSID Index 
Fc9-u8-icon.png - BYTE Return


ScanForSSID

Fc9-comp-macro.png ScanForSSID
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. 
Fc9-u8-icon.png - BYTE Return


SendString

Fc9-comp-macro.png SendString
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. 
Fc9-string-icon.png - STRING Text
 
Fc9-u8-icon.png - BYTE SendCR
 
Fc9-void-icon.png - VOID Return


Send_Embedded_HTML_Page1

Fc9-comp-macro.png Send_Embedded_HTML_Page1
 
Fc9-void-icon.png - VOID Return


Send_Embedded_HTML_Page2

Fc9-comp-macro.png Send_Embedded_HTML_Page2
 
Fc9-void-icon.png - VOID Return


Send_Embedded_HTML_Page3

Fc9-comp-macro.png Send_Embedded_HTML_Page3
 
Fc9-void-icon.png - VOID Return


Send_Embedded_HTML_Page4

Fc9-comp-macro.png Send_Embedded_HTML_Page4
 
Fc9-void-icon.png - VOID Return


SetOutValue

Fc9-comp-macro.png SetOutValue
Set the value of an outbound substitution string 
Fc9-u8-icon.png - BYTE index
Range 0-4 
Fc9-string-icon.png - STRING value
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png WIFI Properties
Fc9-type-21-icon.png Receive Buffer Size
Buffer used to store incoming data ready for processing. Default 128 Bytes. 
Fc9-type-21-icon.png Scan Buffer Size
Buffer used to hold SSID names when performing a SSID network scan. Default 100 Bytes. 
Fc9-type-16-icon.png Reset Mode
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. 
Fc9-type-16-icon.png Command Termination
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. 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
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. 
Fc9-type-16-icon.png Baud Options
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
 
Fc9-type-5-icon.png TX
Pin to be used for Transmit data 
Fc9-type-16-icon.png TX Remap Pin
Allows the hardware transmit pin to be configured from a list of available pins based on your target device, 
Fc9-type-5-icon.png RX
Pin to be used for Receive data 
Fc9-type-16-icon.png RX Remap Pin
Allows the hardware receive pin to be configured from a list of available pins based on your target device, 
Fc9-type-5-icon.png Reset
WLAN module reset pin connection 
Fc9-type-16-icon.png Use Flow Control
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. 
Fc9-conn-icon.png HTML Source
Fc9-type-16-icon.png Max Web Pages
Maximum number of individual webpages we can serve up with the component. 
Fc9-type-21-icon.png Web Page Timeout
Number of cycles to try and send / receive a webpage before timing out. 
Fc9-type-21-icon.png Line Delay
Fixed delay in microseconds sent in between sending a HTML line when running as a web page server. 
Fc9-type-10-icon.png Name Page 1
HTML name of webpage 1 
Fc9-type-11-icon.png HTML Page 1
HTML content for webpage 1 
Fc9-type-10-icon.png Name Page 2
HTML name of webpage 2 
Fc9-type-11-icon.png HTML Page 2
HTML content for webpage 2 
Fc9-type-10-icon.png Name Page 3
HTML name of webpage 3 
Fc9-type-11-icon.png HTML Page 3
HTML content for webpage 3  
Fc9-type-10-icon.png Name Page 4
HTML name of webpage 4 
Fc9-type-11-icon.png HTML Page 4
HTML content for webpage 4 
Fc9-conn-icon.png Substitutions
Fc9-conn-icon.png Outgoing
Fc9-type-16-icon.png Count
Maximum number of outbound string substitutions 
Fc9-type-21-icon.png Length 0
Number of bytes to reserve for data string. 
Fc9-conn-icon.png Incoming
Fc9-type-16-icon.png Count
Maximum number of inbound string substitutions 
Fc9-type-21-icon.png Length 0
Number of bytes to reserve for data string. 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Text label used to help identify the component on the panel. 
Fc9-type-7-icon.png Show Comms Flasher
 
Fc9-type-16-icon.png Simulation Method
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. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-21-icon.png Console Columns
Number of characters that can be displayed on a single line of the console. 
Fc9-type-16-icon.png Data Source
Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port Injector - Routes the communication data via a data injector component on the Panel.