Component: WLAN (EB069, ESP8266) (Wireless)

From Flowcode Help
Revision as of 17:59, 18 March 2016 by BenR (talk | contribs) (XML import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Author Matrix Ltd.
Version 1.6 (Release)
Category Wireless


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

Examples

No additional examples


Downloadable macro reference

DisconnectFromSSID

Disconnects from the current SSID.

Returns 1 if the command was accepted and returned an "OK"

Parameters

This macro has no parameters


Return value

BYTE


SendString

Sends the given Text.

Appends a CR to the end of the string it SendCR is greater than 0.

Parameters

<- STRING Text
This parameter may be returned back to the caller
BYTE SendCR


Return value

This call does not return a value


ClientConnect

Creates a TCP or UDP connection to a remote server.

Parameters

BYTE Type
0 = TCP, 1 = UDP
<- STRING IPAddress
e.g. "192.168.1.20"
This parameter may be returned back to the caller
UINT Port
Remote port number to connect to, HTTP comms = Port 80


Return value

This call does not return a value


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.

Parameters

BYTE Enable
0 = Stop Server, 1 = Start Server
UINT Port
Server port to listen for incoming TCP/IP data requests


Return value

BYTE


GetFirmwareVersion

Collects the firmware version from the ESP8266 module and returns it as a string.

Parameters

This macro has no parameters


Return value

STRING


CheckForPageRequests

To be called periodically. Returns non-zero if a request has been processed

Parameters

This macro has no parameters


Return value

BYTE


ClientSendRequest

Sends out a request for data

Parameters

<- STRING Request
e.g. "GET / HTTP/1.0\r\n\r\n"
This parameter may be returned back to the caller


Return value

This call does not return a value


ReadSSIDFromScan

Collects one of the SSID name strings from the last SSID Scan.

The ScanForSSID macro must be called first.

Parameters

BYTE Index
SSID Index


Return value

STRING


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.

Parameters

<- STRING SSID
Name of the wireless network to create
This parameter may be returned back to the caller
<- STRING Password
Password used to gain access to the network
This parameter may be returned back to the caller
BYTE Channel
802.11 Channel Range 1-14
BYTE Encryption
0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK


Return value

BYTE


SetOutValue

Set the value of an outbound substitution string

Parameters

BYTE index
Range 0-4
<- STRING value
This parameter may be returned back to the caller


Return value

This call does not return a value


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

Parameters

BYTE Index
SSID Index


Return value

BYTE


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

Parameters

BYTE Index
SSID Index


Return value

BYTE


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.

Parameters

This macro has no parameters


Return value

BYTE


GetInValue

Returns the string value of a Request parameter

Parameters

BYTE index
Index of the request paramter, starting at zero Range 0-2


Return value

STRING


ConnectToSSID

Attempts to connect to the given SSID and Key values.

Returns 1 if the SSID has been connected.

Parameters

<- STRING SSID
This parameter may be returned back to the caller
<- STRING Key
This parameter may be returned back to the caller
BYTE Timeout
Number of seconds to wait for the connection, default 2


Return value

BYTE


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.

Parameters

This macro has no parameters


Return value

BYTE


Initialise

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

BYTE


CheckTCPServerIP

Collects the local IP address of the active TCP server.

Parameters

This macro has no parameters


Return value

STRING


Simulation macro reference

This component does not contain any simulation macros


Property reference

Receive Buffer Size

This property is of type Unsigned integer and can be referenced with the variable name RxBufferSize.

Buffer used to store incoming data ready for processing.

Default 128 Bytes.

Scan Buffer Size

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.

Default 100 Bytes.

Reset Mode

This property is of type Fixed list of ints and can be referenced with the variable name ResetMode.

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.

Command Termination

This property is of type Fixed list of ints and can be referenced with the variable name 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.

UART

This property is of type Fixed list of ints and can be referenced with the variable name UART_CHANNEL.

WLAN module UART channel selection

BAUD

This property is of type Fixed list of ints and can be referenced with the variable name BAUD.

No additional information


Tx

This property is of type Single digital pin and can be referenced with the variable name TX.

WLAN module UART data transmit pin. Connects to receive pin on WLAN module.

Rx

This property is of type Single digital pin and can be referenced with the variable name RX.

WLAN module UART data receive pin. Connects to transmit pin on WLAN module.

Max Web Pages

This property is of type Fixed list of ints and can be referenced with the variable name PAGES.

Maximum number of individual webpages we can serve up with the component.

Web Page Timeout

This property is of type Unsigned integer and can be referenced with the variable name TIMEOUT.

Number of cycles to try and send / receive a webpage before timing out.

Line Delay

This property is of type Unsigned integer and can be referenced with the variable name LineDelay.

Fixed delay in milliseconds sent in between sending a HTML line when running as a web page server.

Name Page 1

This property is of type Line of text and can be referenced with the variable name name1.

HTML name of webpage 1

HTML Page 1

This property is of type Multiple lines of text and can be referenced with the variable name html1.

HTML content for webpage 1

Name Page 2

This property is of type Line of text and can be referenced with the variable name name2.

HTML name of webpage 2

HTML Page 2

This property is of type Multiple lines of text and can be referenced with the variable name html2.

HTML content for webpage 2

Name Page 3

This property is of type Line of text and can be referenced with the variable name name3.

HTML name of webpage 3

HTML Page 3

This property is of type Multiple lines of text and can be referenced with the variable name html3.

HTML content for webpage 3

Name Page 4

This property is of type Line of text and can be referenced with the variable name name4.

HTML name of webpage 4

HTML Page 4

This property is of type Multiple lines of text and can be referenced with the variable name html4.

HTML content for webpage 4

Injector

This property is of type Fixed list of ints and can be referenced with the variable name Injector.

No additional information


Label

This property is of type Line of text and can be referenced with the variable name label.

Text label used to help identify the component on the panel.

Length In 0

This property is of type Unsigned integer and can be referenced with the variable name LenIn0.

Sets the max buffer length

Length In 1

This property is of type Unsigned integer and can be referenced with the variable name LenIn1.

Sets the max buffer length

Length In 2

This property is of type Unsigned integer and can be referenced with the variable name LenIn2.

Sets the max buffer length

Length In 3

This property is of type Unsigned integer and can be referenced with the variable name LenIn3.

Sets the max buffer length

Length In 4

This property is of type Unsigned integer and can be referenced with the variable name LenIn4.

Sets the max buffer length

Length In 5

This property is of type Unsigned integer and can be referenced with the variable name LenIn5.

Sets the max buffer length

Length Out 0

This property is of type Unsigned integer and can be referenced with the variable name LenOut0.

Sets the max buffer length

Length Out 1

This property is of type Unsigned integer and can be referenced with the variable name LenOut1.

Sets the max buffer length

Length Out 2

This property is of type Unsigned integer and can be referenced with the variable name LenOut2.

Sets the max buffer length

Length Out 3

This property is of type Unsigned integer and can be referenced with the variable name LenOut3.

Sets the max buffer length

Length Out 4

This property is of type Unsigned integer and can be referenced with the variable name LenOut4.

Sets the max buffer length