Difference between revisions of "Component: WLAN (ESP32) (Comms: Networking)"
(5 intermediate revisions by 3 users not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_WLAN_ESP32.fcfx FC_Comp_Source_WLAN_ESP32.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_WLAN_ESP32.fcfx FC_Comp_Source_WLAN_ESP32.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 37: | Line 37: | ||
==Examples== | ==Examples== | ||
+ | ===Weather Predictor=== | ||
+ | Here is an example of a next-day weather predictor that also shows the current-day weather for a ESP32 embedded device | ||
+ | It uses the BBC weather component via Netwoekcomms and WLAN ESP32 components to connect to the BBC server and retrieve the weather forecast for the specified area code. | ||
+ | {{Fcfile|ESP32_TTGO_Weather_Forecast_Predictor.fcfx|ESP32 weather predictor}} | ||
+ | ===User Configurable Network Details=== | ||
+ | When creating a product using an ESP32 device it is important that it can connect to the network of the person buying the product. | ||
+ | This is complicated as the ESP32 requires that the network SSID and password be defined by the user and this requires a means of getting the data into the ESP32 device. | ||
+ | Luckily as the ESP32 features the ability to host it's own network we can use this to create a simple web interface where the user can enter their network details. | ||
− | + | {{Fcfile|ESP32_Config_Wifi.fcfx|ESP32 Config WIFI}} | |
− | |||
− | |||
− | |||
− | |||
+ | More info on this available here [https://www.flowcode.co.uk/forums/viewtopic.php?f=10&t=634 Flowcode Forums - User Configurable Network Details] | ||
==Macro reference== | ==Macro reference== | ||
Line 411: | Line 416: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Line 426: | Line 429: | ||
| width="90%" | Verbose Debug | | width="90%" | Verbose Debug | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Provides verbose debugging output via hardware UART channel 1 which is often connected to a UART to USB bridge. |
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | SSID Scan Size | ||
+ | |- | ||
+ | | colspan="2" | Maximum number of SSIDs that can be detailed from a single SSID network scan. Default 8 | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
Latest revision as of 12:24, 3 November 2023
Author | Matrix Ltd. |
Version | 2.4 |
Category | Comms: Networking |
Contents
- 1 WLAN (ESP32) component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 AcceptClose
- 5.2 AcceptOpen
- 5.3 ConnectToSSID
- 5.4 CreateAccessPoint
- 5.5 Disconnect
- 5.6 Initialise
- 5.7 ReadEncryptionModeFromScan
- 5.8 ReadIP
- 5.9 ReadIPString
- 5.10 ReadSSIDFromScan
- 5.11 ReadSignalStrengthFromScan
- 5.12 ScanForSSID
- 5.13 SocketClose
- 5.14 SocketConnect
- 5.15 SocketListen
- 5.16 SocketOpen
- 5.17 SocketRead
- 5.18 SocketWrite
- 5.19 Uninitialise
- 6 Property reference
WLAN (ESP32) component
Wireless LAN component designed to work with ESP32 modules
Component Source Code
Please click here to download the component source project: FC_Comp_Source_WLAN_ESP32.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_WLAN_ESP32.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Weather Predictor
Here is an example of a next-day weather predictor that also shows the current-day weather for a ESP32 embedded device
It uses the BBC weather component via Netwoekcomms and WLAN ESP32 components to connect to the BBC server and retrieve the weather forecast for the specified area code.
User Configurable Network Details
When creating a product using an ESP32 device it is important that it can connect to the network of the person buying the product.
This is complicated as the ESP32 requires that the network SSID and password be defined by the user and this requires a means of getting the data into the ESP32 device.
Luckily as the ESP32 features the ability to host it's own network we can use this to create a simple web interface where the user can enter their network details.
More info on this available here Flowcode Forums - User Configurable Network Details
Macro reference
AcceptClose
![]() |
AcceptClose |
Close the socket associated with the Accepted incoming connection | |
![]() |
Return |
AcceptOpen
![]() |
AcceptOpen |
Returns 1 if there is an incoming connection on the listening port | |
![]() |
Return |
ConnectToSSID
CreateAccessPoint
Disconnect
![]() |
Disconnect |
Attempts to disconnect from the SSID. | |
![]() |
Return |
Initialise
![]() |
Initialise |
Initialise the WiFi system Returns 1 if successful Returns 0 if not | |
![]() |
Return |
ReadEncryptionModeFromScan
ReadIP
ReadIPString
![]() |
ReadIPString |
Collects the local IP address and returns it as an ASCII string. e.g. "192.168.0.1" | |
![]() |
Return |
ReadSSIDFromScan
![]() |
ReadSSIDFromScan |
Collects one of the SSID name strings from the last SSID Scan. The ScanForSSID macro must be called first. | |
![]() |
Index |
SSID Index | |
![]() |
Return |
ReadSignalStrengthFromScan
ScanForSSID
SocketClose
![]() |
SocketClose |
![]() |
Return |
SocketConnect
![]() |
SocketConnect |
![]() |
Address |
![]() |
Port |
![]() |
Return |
SocketListen
![]() |
SocketListen |
Listen on, or bind, local port to already opened socket. Returns 1 if OK, 0 if fail | |
![]() |
Port |
![]() |
Return |
SocketOpen
![]() |
SocketOpen |
Returns 1 if socket sucessfully opened | |
![]() |
Return |
SocketRead
![]() |
SocketRead |
![]() |
Buffer |
![]() |
Size |
![]() |
Return |
SocketWrite
![]() |
SocketWrite |
![]() |
Buffer |
![]() |
Size |
![]() |
Return |
Uninitialise
![]() |
Uninitialise |
Shuts down the WiFi system for low power operation. Returns 1 if successful Returns 0 if not | |
![]() |
Return |