Sat, 26 Apr 2025 12:34:32 +0200
MicroPython
- Added a configuration option to disable the support for the no longer produced Pimoroni Pico Wireless Pack.
<!DOCTYPE html> <html><head> <title>eric7.MicroPython.WifiDialogs.WifiController</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>eric7.MicroPython.WifiDialogs.WifiController</h1> <p> Module implementing the WiFi related functionality. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#WifiController">WifiController</a></td> <td>Class implementing the WiFi related functionality.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="WifiController" ID="WifiController"></a> <h2>WifiController</h2> <p> Class implementing the WiFi related functionality. </p> <h3>Derived from</h3> QObject <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#WifiController.__init__">WifiController</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#WifiController.__checkInternet">__checkInternet</a></td> <td>Private slot to check the availability of an internet connection.</td> </tr> <tr> <td><a href="#WifiController.__connectWifi">__connectWifi</a></td> <td>Private slot to connect the current device to a WiFi network.</td> </tr> <tr> <td><a href="#WifiController.__deactivateInterface">__deactivateInterface</a></td> <td>Private method to deactivate a given WiFi interface of the connected device.</td> </tr> <tr> <td><a href="#WifiController.__disableWebrepl">__disableWebrepl</a></td> <td>Private slot to disable the WebREPL server of the device.</td> </tr> <tr> <td><a href="#WifiController.__disconnectWifi">__disconnectWifi</a></td> <td>Private slot to disconnect the current device from the WiFi network.</td> </tr> <tr> <td><a href="#WifiController.__enableWebrepl">__enableWebrepl</a></td> <td>Private slot to enable the WebREPL server of the device.</td> </tr> <tr> <td><a href="#WifiController.__removeCredentials">__removeCredentials</a></td> <td>Private slot to remove the saved WiFi credentials from the connected device.</td> </tr> <tr> <td><a href="#WifiController.__scanNetwork">__scanNetwork</a></td> <td>Private slot to scan for visible WiFi networks.</td> </tr> <tr> <td><a href="#WifiController.__setNetworkTime">__setNetworkTime</a></td> <td>Private slot to synchronize the device clock to network time.</td> </tr> <tr> <td><a href="#WifiController.__showConnectedClients">__showConnectedClients</a></td> <td>Private slot to show a list of WiFi clients connected to the Access Point interface.</td> </tr> <tr> <td><a href="#WifiController.__showWifiStatus">__showWifiStatus</a></td> <td>Private slot to show a dialog with the WiFi status of the current device.</td> </tr> <tr> <td><a href="#WifiController.__startAccessPoint">__startAccessPoint</a></td> <td>Private slot to start the Access Point interface of the connected device.</td> </tr> <tr> <td><a href="#WifiController.__startAccessPointIP">__startAccessPointIP</a></td> <td>Private slot to start the Access Point interface of the connected device with given IP parameters.</td> </tr> <tr> <td><a href="#WifiController.__stopAccessPoint">__stopAccessPoint</a></td> <td>Private slot to stop the Access Point interface of the connected device.</td> </tr> <tr> <td><a href="#WifiController.__writeCredentials">__writeCredentials</a></td> <td>Private slot to save the WiFi login credentials to the connected device.</td> </tr> <tr> <td><a href="#WifiController.createMenu">createMenu</a></td> <td>Public method to create the WiFi submenu.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="WifiController.__init__" ID="WifiController.__init__"></a> <h4>WifiController (Constructor)</h4> <b>WifiController</b>(<i>microPython, parent=None</i>) <p> Constructor </p> <dl> <dt><i>microPython</i> (MicroPythonWidget)</dt> <dd> reference to the MicroPython widget </dd> <dt><i>parent</i> (QObject (optional))</dt> <dd> reference to the parent object (defaults to None) </dd> </dl> <a NAME="WifiController.__checkInternet" ID="WifiController.__checkInternet"></a> <h4>WifiController.__checkInternet</h4> <b>__checkInternet</b>(<i></i>) <p> Private slot to check the availability of an internet connection. </p> <a NAME="WifiController.__connectWifi" ID="WifiController.__connectWifi"></a> <h4>WifiController.__connectWifi</h4> <b>__connectWifi</b>(<i></i>) <p> Private slot to connect the current device to a WiFi network. </p> <a NAME="WifiController.__deactivateInterface" ID="WifiController.__deactivateInterface"></a> <h4>WifiController.__deactivateInterface</h4> <b>__deactivateInterface</b>(<i>interface</i>) <p> Private 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> <a NAME="WifiController.__disableWebrepl" ID="WifiController.__disableWebrepl"></a> <h4>WifiController.__disableWebrepl</h4> <b>__disableWebrepl</b>(<i></i>) <p> Private slot to disable the WebREPL server of the device. </p> <p> This will not remove the 'webrepl_cfg.py' file. It will just modify the boot script. </p> <a NAME="WifiController.__disconnectWifi" ID="WifiController.__disconnectWifi"></a> <h4>WifiController.__disconnectWifi</h4> <b>__disconnectWifi</b>(<i></i>) <p> Private slot to disconnect the current device from the WiFi network. </p> <a NAME="WifiController.__enableWebrepl" ID="WifiController.__enableWebrepl"></a> <h4>WifiController.__enableWebrepl</h4> <b>__enableWebrepl</b>(<i></i>) <p> Private slot to enable the WebREPL server of the device. </p> <p> This will also modify the boot script. </p> <a NAME="WifiController.__removeCredentials" ID="WifiController.__removeCredentials"></a> <h4>WifiController.__removeCredentials</h4> <b>__removeCredentials</b>(<i></i>) <p> Private slot to remove the saved WiFi credentials from the connected device. </p> <p> This will not remove the auto-connect part of the boot script. This needs to be done manually if desired. </p> <a NAME="WifiController.__scanNetwork" ID="WifiController.__scanNetwork"></a> <h4>WifiController.__scanNetwork</h4> <b>__scanNetwork</b>(<i></i>) <p> Private slot to scan for visible WiFi networks. </p> <a NAME="WifiController.__setNetworkTime" ID="WifiController.__setNetworkTime"></a> <h4>WifiController.__setNetworkTime</h4> <b>__setNetworkTime</b>(<i></i>) <p> Private slot to synchronize the device clock to network time. </p> <a NAME="WifiController.__showConnectedClients" ID="WifiController.__showConnectedClients"></a> <h4>WifiController.__showConnectedClients</h4> <b>__showConnectedClients</b>(<i></i>) <p> Private slot to show a list of WiFi clients connected to the Access Point interface. </p> <a NAME="WifiController.__showWifiStatus" ID="WifiController.__showWifiStatus"></a> <h4>WifiController.__showWifiStatus</h4> <b>__showWifiStatus</b>(<i></i>) <p> Private slot to show a dialog with the WiFi status of the current device. </p> <a NAME="WifiController.__startAccessPoint" ID="WifiController.__startAccessPoint"></a> <h4>WifiController.__startAccessPoint</h4> <b>__startAccessPoint</b>(<i>withIP=False</i>) <p> Private slot to start the Access Point interface of the connected device. </p> <dl> <dt><i>withIP</i> (bool)</dt> <dd> flag indicating to start the access point with an IP configuration </dd> </dl> <a NAME="WifiController.__startAccessPointIP" ID="WifiController.__startAccessPointIP"></a> <h4>WifiController.__startAccessPointIP</h4> <b>__startAccessPointIP</b>(<i></i>) <p> Private slot to start the Access Point interface of the connected device with given IP parameters. </p> <a NAME="WifiController.__stopAccessPoint" ID="WifiController.__stopAccessPoint"></a> <h4>WifiController.__stopAccessPoint</h4> <b>__stopAccessPoint</b>(<i></i>) <p> Private slot to stop the Access Point interface of the connected device. </p> <a NAME="WifiController.__writeCredentials" ID="WifiController.__writeCredentials"></a> <h4>WifiController.__writeCredentials</h4> <b>__writeCredentials</b>(<i></i>) <p> Private slot to save the WiFi login credentials to the connected device. </p> <p> This will also modify the boot script to perform an automatic WiFi connection. </p> <a NAME="WifiController.createMenu" ID="WifiController.createMenu"></a> <h4>WifiController.createMenu</h4> <b>createMenu</b>(<i>menu</i>) <p> Public method to create the WiFi submenu. </p> <dl> <dt><i>menu</i> (QMenu)</dt> <dd> reference to the parent menu </dd> </dl> <dl> <dt>Return:</dt> <dd> reference to the created menu </dd> </dl> <dl> <dt>Return Type:</dt> <dd> QMenu </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>