--- a/src/eric7/Documentation/Source/eric7.MicroPython.Devices.EspDevices.html Fri Feb 24 18:36:43 2023 +0100 +++ b/src/eric7/Documentation/Source/eric7.MicroPython.Devices.EspDevices.html Sat Feb 25 19:18:07 2023 +0100 @@ -140,14 +140,34 @@ <td>Public method to determine, if a REPL can be started.</td> </tr> <tr> +<td><a href="#EspDevice.checkInternet">checkInternet</a></td> +<td>Public method to check, if the internet can be reached.</td> +</tr> +<tr> +<td><a href="#EspDevice.connectWifi">connectWifi</a></td> +<td>Public method to connect a device to a WiFi network.</td> +</tr> +<tr> +<td><a href="#EspDevice.deactivateInterface">deactivateInterface</a></td> +<td>Public method to deactivate a given WiFi interface of the connected device.</td> +</tr> +<tr> <td><a href="#EspDevice.deviceName">deviceName</a></td> <td>Public method to get the name of the device.</td> </tr> <tr> +<td><a href="#EspDevice.disconnectWifi">disconnectWifi</a></td> +<td>Public method to disconnect a device from the WiFi network.</td> +</tr> +<tr> <td><a href="#EspDevice.forceInterrupt">forceInterrupt</a></td> <td>Public method to determine the need for an interrupt when opening the serial connection.</td> </tr> <tr> +<td><a href="#EspDevice.getConnectedClients">getConnectedClients</a></td> +<td>Public method to get a list of connected clients.</td> +</tr> +<tr> <td><a href="#EspDevice.getDocumentationUrl">getDocumentationUrl</a></td> <td>Public method to get the device documentation URL.</td> </tr> @@ -156,17 +176,45 @@ <td>Public method to get the device firmware download URL.</td> </tr> <tr> +<td><a href="#EspDevice.getWifiData">getWifiData</a></td> +<td>Public method to get data related to the current WiFi status.</td> +</tr> +<tr> <td><a href="#EspDevice.hasFlashMenuEntry">hasFlashMenuEntry</a></td> <td>Public method to check, if the device has its own flash menu entry.</td> </tr> <tr> +<td><a href="#EspDevice.hasWifi">hasWifi</a></td> +<td>Public method to check the availability of WiFi.</td> +</tr> +<tr> +<td><a href="#EspDevice.removeCredentials">removeCredentials</a></td> +<td>Public method to remove the saved credentials from the connected device.</td> +</tr> +<tr> <td><a href="#EspDevice.runScript">runScript</a></td> <td>Public method to run the given Python script.</td> </tr> <tr> +<td><a href="#EspDevice.scanNetworks">scanNetworks</a></td> +<td>Public method to scan for available WiFi networks.</td> +</tr> +<tr> <td><a href="#EspDevice.setButtons">setButtons</a></td> <td>Public method to enable the supported action buttons.</td> </tr> +<tr> +<td><a href="#EspDevice.startAccessPoint">startAccessPoint</a></td> +<td>Public method to start the access point interface.</td> +</tr> +<tr> +<td><a href="#EspDevice.stopAccessPoint">stopAccessPoint</a></td> +<td>Public method to stop the access point interface.</td> +</tr> +<tr> +<td><a href="#EspDevice.writeCredentials">writeCredentials</a></td> +<td>Public method to write the given credentials to the connected device and modify the start script to connect automatically.</td> +</tr> </table> <h3>Static Methods</h3> @@ -412,6 +460,89 @@ tuple of (bool, str) </dd> </dl> +<a NAME="EspDevice.checkInternet" ID="EspDevice.checkInternet"></a> +<h4>EspDevice.checkInternet</h4> +<b>checkInternet</b>(<i></i>) + +<p> + Public method to check, if the internet can be reached. +</p> +<dl> +<dt>Return:</dt> +<dd> +tuple containing a flag indicating reachability and an error string +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> +<a NAME="EspDevice.connectWifi" ID="EspDevice.connectWifi"></a> +<h4>EspDevice.connectWifi</h4> +<b>connectWifi</b>(<i>ssid, password</i>) + +<p> + Public method to connect a device to a WiFi network. +</p> +<dl> + +<dt><i>ssid</i> (str)</dt> +<dd> +name (SSID) of the WiFi network +</dd> +<dt><i>password</i> (str)</dt> +<dd> +password needed to connect +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +tuple containing the connection status and an error string +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> +<a NAME="EspDevice.deactivateInterface" ID="EspDevice.deactivateInterface"></a> +<h4>EspDevice.deactivateInterface</h4> +<b>deactivateInterface</b>(<i>interface</i>) + +<p> + Public method to deactivate a given WiFi interface of the connected device. +</p> +<dl> + +<dt><i>interface</i> (str)</dt> +<dd> +designation of the interface to be deactivated (one of 'AP' + or 'STA') +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +tuple containg a flag indicating success and an error message +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> +<dl> + +<dt>Raises <b>ValueError</b>:</dt> +<dd> +raised to indicate a wrong value for the interface type +</dd> +</dl> <a NAME="EspDevice.deviceName" ID="EspDevice.deviceName"></a> <h4>EspDevice.deviceName</h4> <b>deviceName</b>(<i></i>) @@ -431,6 +562,25 @@ str </dd> </dl> +<a NAME="EspDevice.disconnectWifi" ID="EspDevice.disconnectWifi"></a> +<h4>EspDevice.disconnectWifi</h4> +<b>disconnectWifi</b>(<i></i>) + +<p> + Public method to disconnect a device from the WiFi network. +</p> +<dl> +<dt>Return:</dt> +<dd> +tuple containing a flag indicating success and an error string +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> <a NAME="EspDevice.forceInterrupt" ID="EspDevice.forceInterrupt"></a> <h4>EspDevice.forceInterrupt</h4> <b>forceInterrupt</b>(<i></i>) @@ -451,6 +601,26 @@ bool </dd> </dl> +<a NAME="EspDevice.getConnectedClients" ID="EspDevice.getConnectedClients"></a> +<h4>EspDevice.getConnectedClients</h4> +<b>getConnectedClients</b>(<i></i>) + +<p> + Public method to get a list of connected clients. +</p> +<dl> +<dt>Return:</dt> +<dd> +a tuple containing a list of tuples containing the client MAC-Address + and the RSSI (if supported and available) and an error message +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of ([(bytes, int)], str) +</dd> +</dl> <a NAME="EspDevice.getDocumentationUrl" ID="EspDevice.getDocumentationUrl"></a> <h4>EspDevice.getDocumentationUrl</h4> <b>getDocumentationUrl</b>(<i></i>) @@ -489,6 +659,33 @@ str </dd> </dl> +<a NAME="EspDevice.getWifiData" ID="EspDevice.getWifiData"></a> +<h4>EspDevice.getWifiData</h4> +<b>getWifiData</b>(<i></i>) + +<p> + Public method to get data related to the current WiFi status. +</p> +<dl> +<dt>Return:</dt> +<dd> +tuple of three dictionaries containing the WiFi status data + for the WiFi client, access point and overall data +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (dict, dict, dict) +</dd> +</dl> +<dl> + +<dt>Raises <b>OSError</b>:</dt> +<dd> +raised to indicate an issue with the device +</dd> +</dl> <a NAME="EspDevice.hasFlashMenuEntry" ID="EspDevice.hasFlashMenuEntry"></a> <h4>EspDevice.hasFlashMenuEntry</h4> <b>hasFlashMenuEntry</b>(<i></i>) @@ -508,6 +705,45 @@ bool </dd> </dl> +<a NAME="EspDevice.hasWifi" ID="EspDevice.hasWifi"></a> +<h4>EspDevice.hasWifi</h4> +<b>hasWifi</b>(<i></i>) + +<p> + Public method to check the availability of WiFi. +</p> +<dl> +<dt>Return:</dt> +<dd> +tuple containing a flag indicating the availability of WiFi + and the WiFi type (esp32) +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> +<a NAME="EspDevice.removeCredentials" ID="EspDevice.removeCredentials"></a> +<h4>EspDevice.removeCredentials</h4> +<b>removeCredentials</b>(<i></i>) + +<p> + Public method to remove the saved credentials from the connected device. +</p> +<dl> +<dt>Return:</dt> +<dd> +tuple containing a flag indicating success and an error message +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> <a NAME="EspDevice.runScript" ID="EspDevice.runScript"></a> <h4>EspDevice.runScript</h4> <b>runScript</b>(<i>script</i>) @@ -522,6 +758,26 @@ script to be executed </dd> </dl> +<a NAME="EspDevice.scanNetworks" ID="EspDevice.scanNetworks"></a> +<h4>EspDevice.scanNetworks</h4> +<b>scanNetworks</b>(<i></i>) + +<p> + Public method to scan for available WiFi networks. +</p> +<dl> +<dt>Return:</dt> +<dd> +tuple containing the list of available networks as a tuple of 'Name', + 'MAC-Address', 'channel', 'RSSI' and 'security' and an error string +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (list of tuple of (str, str, int, int, str), str) +</dd> +</dl> <a NAME="EspDevice.setButtons" ID="EspDevice.setButtons"></a> <h4>EspDevice.setButtons</h4> <b>setButtons</b>(<i></i>) @@ -529,6 +785,95 @@ <p> Public method to enable the supported action buttons. </p> +<a NAME="EspDevice.startAccessPoint" ID="EspDevice.startAccessPoint"></a> +<h4>EspDevice.startAccessPoint</h4> +<b>startAccessPoint</b>(<i>ssid, security=None, password=None, ifconfig=None</i>) + +<p> + Public method to start the access point interface. +</p> +<dl> + +<dt><i>ssid</i> (str)</dt> +<dd> +SSID of the access point +</dd> +<dt><i>security</i> (int (optional))</dt> +<dd> +security method (defaults to None) +</dd> +<dt><i>password</i> (str (optional))</dt> +<dd> +password (defaults to None) +</dd> +<dt><i>ifconfig</i> (tuple of (str, str, str, str))</dt> +<dd> +IPv4 configuration for the access point if not default + (IPv4 address, netmask, gateway address, DNS server address) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +tuple containing a flag indicating success and an error message +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> +<a NAME="EspDevice.stopAccessPoint" ID="EspDevice.stopAccessPoint"></a> +<h4>EspDevice.stopAccessPoint</h4> +<b>stopAccessPoint</b>(<i></i>) + +<p> + Public method to stop the access point interface. +</p> +<dl> +<dt>Return:</dt> +<dd> +tuple containg a flag indicating success and an error message +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> +<a NAME="EspDevice.writeCredentials" ID="EspDevice.writeCredentials"></a> +<h4>EspDevice.writeCredentials</h4> +<b>writeCredentials</b>(<i>ssid, password</i>) + +<p> + Public method to write the given credentials to the connected device and modify + the start script to connect automatically. +</p> +<dl> + +<dt><i>ssid</i> (str)</dt> +<dd> +SSID of the network to connect to +</dd> +<dt><i>password</i> (str)</dt> +<dd> +password needed to authenticate +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +tuple containing a flag indicating success and an error message +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr />