diff -r fc60e382b67a -r d41ee69fa69b src/eric7/Documentation/Source/eric7.MicroPython.Devices.CircuitPythonDevices.html --- a/src/eric7/Documentation/Source/eric7.MicroPython.Devices.CircuitPythonDevices.html Fri Mar 03 11:31:53 2023 +0100 +++ b/src/eric7/Documentation/Source/eric7.MicroPython.Devices.CircuitPythonDevices.html Fri Mar 03 11:34:59 2023 +0100 @@ -68,17 +68,33 @@ </tr> <tr> <td><a href="#CircuitPythonDevice.__cpyVersionResponse">__cpyVersionResponse</a></td> -<td>Private method handling the response of the latest version request.</td> +<td>Private slot handling the response of the latest version request.</td> </tr> <tr> <td><a href="#CircuitPythonDevice.__createCPyMenu">__createCPyMenu</a></td> <td>Private method to create the CircuitPython submenu.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.__createFlashMenus">__createFlashMenus</a></td> +<td>Private method to create the various menus to flash a CircuitPython firmware.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.__deviceVolumeMounted">__deviceVolumeMounted</a></td> <td>Private method to check, if the device volume is mounted.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.__esp32EraseFlash">__esp32EraseFlash</a></td> +<td>Private slot to erase the flash of an ESP32 device.</td> +</tr> +<tr> +<td><a href="#CircuitPythonDevice.__esp32FlashAddons">__esp32FlashAddons</a></td> +<td>Private slot to flash additional firmware to an ESP32 device.</td> +</tr> +<tr> +<td><a href="#CircuitPythonDevice.__esp32FlashPython">__esp32FlashPython</a></td> +<td>Private slot to flash a MicroPython or CircuitPython firmware to an ESP32 device.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.__findDeviceDirectories">__findDeviceDirectories</a></td> <td>Private method to find the device directories associated with the current board name.</td> </tr> @@ -95,16 +111,20 @@ <td>Private slot to install Python files into the onboard library.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.__resetDevice">__resetDevice</a></td> +<td>Private slot to reset the connected device.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.__showCircuitPythonVersions">__showCircuitPythonVersions</a></td> <td>Private slot to show the CircuitPython version of a connected device and the latest available one (from Github).</td> </tr> <tr> <td><a href="#CircuitPythonDevice.__showTeensyFlashInstructions">__showTeensyFlashInstructions</a></td> -<td>Private method to show a message box because Teensy does not support the UF2 bootloader yet.</td> +<td>Private slot to show a message box because Teensy does not support the UF2 bootloader yet.</td> </tr> <tr> <td><a href="#CircuitPythonDevice.__startTeensyLoader">__startTeensyLoader</a></td> -<td>Private method to start the 'Teensy Loader' application.</td> +<td>Private slot to start the 'Teensy Loader' application.</td> </tr> <tr> <td><a href="#CircuitPythonDevice.addDeviceMenuEntries">addDeviceMenuEntries</a></td> @@ -127,14 +147,34 @@ <td>Public method to determine, if a REPL can be started.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.checkInternet">checkInternet</a></td> +<td>Public method to check, if the internet can be reached.</td> +</tr> +<tr> +<td><a href="#CircuitPythonDevice.connectWifi">connectWifi</a></td> +<td>Public method to connect a device to a WiFi network.</td> +</tr> +<tr> +<td><a href="#CircuitPythonDevice.deactivateInterface">deactivateInterface</a></td> +<td>Public method to deactivate a given WiFi interface of the connected device.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.deviceName">deviceName</a></td> <td>Public method to get the name of the device.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.disconnectWifi">disconnectWifi</a></td> +<td>Public method to disconnect a device from the WiFi network.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.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="#CircuitPythonDevice.getConnectedClients">getConnectedClients</a></td> +<td>Public method to get a list of connected clients.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.getDocumentationUrl">getDocumentationUrl</a></td> <td>Public method to get the device documentation URL.</td> </tr> @@ -143,6 +183,10 @@ <td>Public method to retrieve the entries for the downloads menu.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.getWifiData">getWifiData</a></td> +<td>Public method to get data related to the current WiFi status.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.getWorkspace">getWorkspace</a></td> <td>Public method to get the workspace directory.</td> </tr> @@ -151,10 +195,22 @@ <td>Public method to check, if the device has its own flash menu entry.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.hasWifi">hasWifi</a></td> +<td>Public method to check the availability of WiFi.</td> +</tr> +<tr> +<td><a href="#CircuitPythonDevice.removeCredentials">removeCredentials</a></td> +<td>Public method to remove the saved credentials from the connected device.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.runScript">runScript</a></td> <td>Public method to run the given Python script.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.scanNetworks">scanNetworks</a></td> +<td>Public method to scan for available WiFi networks.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.setButtons">setButtons</a></td> <td>Public method to enable the supported action buttons.</td> </tr> @@ -163,9 +219,21 @@ <td>Public method to set the connection state.</td> </tr> <tr> +<td><a href="#CircuitPythonDevice.startAccessPoint">startAccessPoint</a></td> +<td>Public method to start the access point interface.</td> +</tr> +<tr> +<td><a href="#CircuitPythonDevice.stopAccessPoint">stopAccessPoint</a></td> +<td>Public method to stop the access point interface.</td> +</tr> +<tr> <td><a href="#CircuitPythonDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td> <td>Public method to indicate file access via a local directory.</td> </tr> +<tr> +<td><a href="#CircuitPythonDevice.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> @@ -211,7 +279,7 @@ <b>__cpyVersionResponse</b>(<i>reply</i>) <p> - Private method handling the response of the latest version request. + Private slot handling the response of the latest version request. </p> <dl> @@ -227,6 +295,25 @@ <p> Private method to create the CircuitPython submenu. </p> +<a NAME="CircuitPythonDevice.__createFlashMenus" ID="CircuitPythonDevice.__createFlashMenus"></a> +<h4>CircuitPythonDevice.__createFlashMenus</h4> +<b>__createFlashMenus</b>(<i></i>) + +<p> + Private method to create the various menus to flash a CircuitPython firmware. +</p> +<dl> +<dt>Return:</dt> +<dd> +reference to the created top level flash menu +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +QMenu +</dd> +</dl> <a NAME="CircuitPythonDevice.__deviceVolumeMounted" ID="CircuitPythonDevice.__deviceVolumeMounted"></a> <h4>CircuitPythonDevice.__deviceVolumeMounted</h4> <b>__deviceVolumeMounted</b>(<i></i>) @@ -246,6 +333,28 @@ bool </dd> </dl> +<a NAME="CircuitPythonDevice.__esp32EraseFlash" ID="CircuitPythonDevice.__esp32EraseFlash"></a> +<h4>CircuitPythonDevice.__esp32EraseFlash</h4> +<b>__esp32EraseFlash</b>(<i></i>) + +<p> + Private slot to erase the flash of an ESP32 device. +</p> +<a NAME="CircuitPythonDevice.__esp32FlashAddons" ID="CircuitPythonDevice.__esp32FlashAddons"></a> +<h4>CircuitPythonDevice.__esp32FlashAddons</h4> +<b>__esp32FlashAddons</b>(<i></i>) + +<p> + Private slot to flash additional firmware to an ESP32 device. +</p> +<a NAME="CircuitPythonDevice.__esp32FlashPython" ID="CircuitPythonDevice.__esp32FlashPython"></a> +<h4>CircuitPythonDevice.__esp32FlashPython</h4> +<b>__esp32FlashPython</b>(<i></i>) + +<p> + Private slot to flash a MicroPython or CircuitPython firmware to an ESP32 + device. +</p> <a NAME="CircuitPythonDevice.__findDeviceDirectories" ID="CircuitPythonDevice.__findDeviceDirectories"></a> <h4>CircuitPythonDevice.__findDeviceDirectories</h4> <b>__findDeviceDirectories</b>(<i>directories</i>) @@ -282,9 +391,9 @@ </p> <dl> -<dt><i>silent</i> (bool)</dt> +<dt><i>silent</i> (bool (optional))</dt> <dd> -flag indicating silent operations +flag indicating silent operations (defaults to False) </dd> </dl> <dl> @@ -321,6 +430,13 @@ (defaults to False) </dd> </dl> +<a NAME="CircuitPythonDevice.__resetDevice" ID="CircuitPythonDevice.__resetDevice"></a> +<h4>CircuitPythonDevice.__resetDevice</h4> +<b>__resetDevice</b>(<i></i>) + +<p> + Private slot to reset the connected device. +</p> <a NAME="CircuitPythonDevice.__showCircuitPythonVersions" ID="CircuitPythonDevice.__showCircuitPythonVersions"></a> <h4>CircuitPythonDevice.__showCircuitPythonVersions</h4> <b>__showCircuitPythonVersions</b>(<i></i>) @@ -334,7 +450,7 @@ <b>__showTeensyFlashInstructions</b>(<i></i>) <p> - Private method to show a message box because Teensy does not support + Private slot to show a message box because Teensy does not support the UF2 bootloader yet. </p> <a NAME="CircuitPythonDevice.__startTeensyLoader" ID="CircuitPythonDevice.__startTeensyLoader"></a> @@ -342,7 +458,7 @@ <b>__startTeensyLoader</b>(<i></i>) <p> - Private method to start the 'Teensy Loader' application. + Private slot to start the 'Teensy Loader' application. </p> <p> Note: The application must be accessible via the application search path. @@ -441,6 +557,93 @@ tuple of (bool, str) </dd> </dl> +<a NAME="CircuitPythonDevice.checkInternet" ID="CircuitPythonDevice.checkInternet"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.connectWifi" ID="CircuitPythonDevice.connectWifi"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.deactivateInterface" ID="CircuitPythonDevice.deactivateInterface"></a> +<h4>CircuitPythonDevice.deactivateInterface</h4> +<b>deactivateInterface</b>(<i>interface</i>) + +<p> + Public method to deactivate a given WiFi interface of the connected device. +</p> +<p> + Note: With CircuitPython it is not possible to deactivate the station and + access point interfaces separately. +</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="CircuitPythonDevice.deviceName" ID="CircuitPythonDevice.deviceName"></a> <h4>CircuitPythonDevice.deviceName</h4> <b>deviceName</b>(<i></i>) @@ -460,6 +663,25 @@ str </dd> </dl> +<a NAME="CircuitPythonDevice.disconnectWifi" ID="CircuitPythonDevice.disconnectWifi"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.forceInterrupt" ID="CircuitPythonDevice.forceInterrupt"></a> <h4>CircuitPythonDevice.forceInterrupt</h4> <b>forceInterrupt</b>(<i></i>) @@ -480,6 +702,26 @@ bool </dd> </dl> +<a NAME="CircuitPythonDevice.getConnectedClients" ID="CircuitPythonDevice.getConnectedClients"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.getDocumentationUrl" ID="CircuitPythonDevice.getDocumentationUrl"></a> <h4>CircuitPythonDevice.getDocumentationUrl</h4> <b>getDocumentationUrl</b>(<i></i>) @@ -519,6 +761,33 @@ list of tuple of (str, str) </dd> </dl> +<a NAME="CircuitPythonDevice.getWifiData" ID="CircuitPythonDevice.getWifiData"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.getWorkspace" ID="CircuitPythonDevice.getWorkspace"></a> <h4>CircuitPythonDevice.getWorkspace</h4> <b>getWorkspace</b>(<i>silent=False</i>) @@ -564,6 +833,52 @@ bool </dd> </dl> +<a NAME="CircuitPythonDevice.hasWifi" ID="CircuitPythonDevice.hasWifi"></a> +<h4>CircuitPythonDevice.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 (picow or pimoroni) +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> +</dl> +<dl> + +<dt>Raises <b>OSError</b>:</dt> +<dd> +raised to indicate an issue with the device +</dd> +</dl> +<a NAME="CircuitPythonDevice.removeCredentials" ID="CircuitPythonDevice.removeCredentials"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.runScript" ID="CircuitPythonDevice.runScript"></a> <h4>CircuitPythonDevice.runScript</h4> <b>runScript</b>(<i>script</i>) @@ -578,6 +893,26 @@ script to be executed </dd> </dl> +<a NAME="CircuitPythonDevice.scanNetworks" ID="CircuitPythonDevice.scanNetworks"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.setButtons" ID="CircuitPythonDevice.setButtons"></a> <h4>CircuitPythonDevice.setButtons</h4> <b>setButtons</b>(<i></i>) @@ -599,6 +934,64 @@ connection state </dd> </dl> +<a NAME="CircuitPythonDevice.startAccessPoint" ID="CircuitPythonDevice.startAccessPoint"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.stopAccessPoint" ID="CircuitPythonDevice.stopAccessPoint"></a> +<h4>CircuitPythonDevice.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="CircuitPythonDevice.supportsLocalFileAccess" ID="CircuitPythonDevice.supportsLocalFileAccess"></a> <h4>CircuitPythonDevice.supportsLocalFileAccess</h4> <b>supportsLocalFileAccess</b>(<i></i>) @@ -618,6 +1011,37 @@ bool </dd> </dl> +<a NAME="CircuitPythonDevice.writeCredentials" ID="CircuitPythonDevice.writeCredentials"></a> +<h4>CircuitPythonDevice.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 />