Component: WLAN Dummy (EB069, ESP8266) (ESP8266) (Wireless)

From Flowcode Help
Jump to navigationJump to search
Author Matrix Ltd.
Version 2.0
Category Wireless


WLAN Dummy (EB069, ESP8266) component

Wireless LAN component designed to work with the ESP8266 module. Provides a very simple interface to allow webpages to be hosted from hardware or simulation. Also available in the form of the EB069 E-block.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_WLAN_ESP8266_Dummy.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_WLAN_ESP8266_Dummy.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
 
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 request for data 
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 2 
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
 
Fc9-string-icon.png - STRING Password
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Encryption
 
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
 
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
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-u16-icon.png - UINT MaxBytes
 
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-s16-icon.png - INT 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. Appends a CR to the end of the string it 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