1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.Devices.RP2040Devices</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.MicroPython.Devices.RP2040Devices</h1> |
|
10 <p> |
|
11 Module implementing the device interface class for RP2040 based boards |
|
12 (e.g. Raspberry Pi Pico). |
|
13 </p> |
|
14 |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 |
|
20 <h3>Classes</h3> |
|
21 <table> |
|
22 <tr> |
|
23 <td><a href="#RP2040Device">RP2040Device</a></td> |
|
24 <td>Class implementing the device for RP2040 based boards.</td> |
|
25 </tr> |
|
26 </table> |
|
27 |
|
28 <h3>Functions</h3> |
|
29 <table> |
|
30 <tr> |
|
31 <td><a href="#createDevice">createDevice</a></td> |
|
32 <td>Function to instantiate a MicroPython device object.</td> |
|
33 </tr> |
|
34 </table> |
|
35 |
|
36 <hr /> |
|
37 <hr /> |
|
38 <a NAME="RP2040Device" ID="RP2040Device"></a> |
|
39 <h2>RP2040Device</h2> |
|
40 <p> |
|
41 Class implementing the device for RP2040 based boards. |
|
42 </p> |
|
43 |
|
44 <h3>Derived from</h3> |
|
45 BaseDevice |
|
46 <h3>Class Attributes</h3> |
|
47 <table> |
|
48 <tr><td>None</td></tr> |
|
49 </table> |
|
50 |
|
51 <h3>Class Methods</h3> |
|
52 <table> |
|
53 <tr><td>None</td></tr> |
|
54 </table> |
|
55 |
|
56 <h3>Methods</h3> |
|
57 <table> |
|
58 <tr> |
|
59 <td><a href="#RP2040Device.__init__">RP2040Device</a></td> |
|
60 <td>Constructor</td> |
|
61 </tr> |
|
62 <tr> |
|
63 <td><a href="#RP2040Device.__activateBootloader">__activateBootloader</a></td> |
|
64 <td>Private slot to switch the board into 'bootloader' mode.</td> |
|
65 </tr> |
|
66 <tr> |
|
67 <td><a href="#RP2040Device.__createRP2040Menu">__createRP2040Menu</a></td> |
|
68 <td>Private method to create the RP2040 submenu.</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#RP2040Device.__firmwareVersionResponse">__firmwareVersionResponse</a></td> |
|
72 <td>Private slot handling the response of the latest version request.</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#RP2040Device.__flashPython">__flashPython</a></td> |
|
76 <td>Private slot to flash a MicroPython firmware to the device.</td> |
|
77 </tr> |
|
78 <tr> |
|
79 <td><a href="#RP2040Device.__resetCountry">__resetCountry</a></td> |
|
80 <td>Private slot to reset the country of the connected ESP32 device.</td> |
|
81 </tr> |
|
82 <tr> |
|
83 <td><a href="#RP2040Device.__resetDevice">__resetDevice</a></td> |
|
84 <td>Private slot to reset the connected device.</td> |
|
85 </tr> |
|
86 <tr> |
|
87 <td><a href="#RP2040Device.__setCountry">__setCountry</a></td> |
|
88 <td>Private slot to configure the country of the connected RP2040 device.</td> |
|
89 </tr> |
|
90 <tr> |
|
91 <td><a href="#RP2040Device.__showFirmwareVersions">__showFirmwareVersions</a></td> |
|
92 <td>Private slot to show the firmware version of the connected device and the available firmware version.</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#RP2040Device._getSetTimeCode">_getSetTimeCode</a></td> |
|
96 <td>Protected method to get the device code to set the time.</td> |
|
97 </tr> |
|
98 <tr> |
|
99 <td><a href="#RP2040Device.activateBluetoothInterface">activateBluetoothInterface</a></td> |
|
100 <td>Public method to activate the Bluetooth interface.</td> |
|
101 </tr> |
|
102 <tr> |
|
103 <td><a href="#RP2040Device.addDeviceMenuEntries">addDeviceMenuEntries</a></td> |
|
104 <td>Public method to add device specific entries to the given menu.</td> |
|
105 </tr> |
|
106 <tr> |
|
107 <td><a href="#RP2040Device.addDeviceWifiEntries">addDeviceWifiEntries</a></td> |
|
108 <td>Public method to add device specific entries to the given menu.</td> |
|
109 </tr> |
|
110 <tr> |
|
111 <td><a href="#RP2040Device.canRunScript">canRunScript</a></td> |
|
112 <td>Public method to determine, if a script can be executed.</td> |
|
113 </tr> |
|
114 <tr> |
|
115 <td><a href="#RP2040Device.canStartFileManager">canStartFileManager</a></td> |
|
116 <td>Public method to determine, if a File Manager can be started.</td> |
|
117 </tr> |
|
118 <tr> |
|
119 <td><a href="#RP2040Device.canStartPlotter">canStartPlotter</a></td> |
|
120 <td>Public method to determine, if a Plotter can be started.</td> |
|
121 </tr> |
|
122 <tr> |
|
123 <td><a href="#RP2040Device.canStartRepl">canStartRepl</a></td> |
|
124 <td>Public method to determine, if a REPL can be started.</td> |
|
125 </tr> |
|
126 <tr> |
|
127 <td><a href="#RP2040Device.checkInternet">checkInternet</a></td> |
|
128 <td>Public method to check, if the internet can be reached.</td> |
|
129 </tr> |
|
130 <tr> |
|
131 <td><a href="#RP2040Device.checkInternetViaLan">checkInternetViaLan</a></td> |
|
132 <td>Public method to check, if the internet can be reached (LAN variant).</td> |
|
133 </tr> |
|
134 <tr> |
|
135 <td><a href="#RP2040Device.connectToLan">connectToLan</a></td> |
|
136 <td>Public method to connect the connected device to the LAN.</td> |
|
137 </tr> |
|
138 <tr> |
|
139 <td><a href="#RP2040Device.connectWifi">connectWifi</a></td> |
|
140 <td>Public method to connect a device to a WiFi network.</td> |
|
141 </tr> |
|
142 <tr> |
|
143 <td><a href="#RP2040Device.deactivateBluetoothInterface">deactivateBluetoothInterface</a></td> |
|
144 <td>Public method to deactivate the Bluetooth interface.</td> |
|
145 </tr> |
|
146 <tr> |
|
147 <td><a href="#RP2040Device.deactivateEthernet">deactivateEthernet</a></td> |
|
148 <td>Public method to deactivate the Ethernet interface of the connected device.</td> |
|
149 </tr> |
|
150 <tr> |
|
151 <td><a href="#RP2040Device.deactivateInterface">deactivateInterface</a></td> |
|
152 <td>Public method to deactivate a given WiFi interface of the connected device.</td> |
|
153 </tr> |
|
154 <tr> |
|
155 <td><a href="#RP2040Device.deviceName">deviceName</a></td> |
|
156 <td>Public method to get the name of the device.</td> |
|
157 </tr> |
|
158 <tr> |
|
159 <td><a href="#RP2040Device.disableWebrepl">disableWebrepl</a></td> |
|
160 <td>Public method to write the given WebREPL password to the connected device and modify the start script to start the WebREPL server.</td> |
|
161 </tr> |
|
162 <tr> |
|
163 <td><a href="#RP2040Device.disconnectFromLan">disconnectFromLan</a></td> |
|
164 <td>Public method to disconnect from the LAN.</td> |
|
165 </tr> |
|
166 <tr> |
|
167 <td><a href="#RP2040Device.disconnectWifi">disconnectWifi</a></td> |
|
168 <td>Public method to disconnect a device from the WiFi network.</td> |
|
169 </tr> |
|
170 <tr> |
|
171 <td><a href="#RP2040Device.enableWebrepl">enableWebrepl</a></td> |
|
172 <td>Public method to write the given WebREPL password to the connected device and modify the start script to start the WebREPL server.</td> |
|
173 </tr> |
|
174 <tr> |
|
175 <td><a href="#RP2040Device.forceInterrupt">forceInterrupt</a></td> |
|
176 <td>Public method to determine the need for an interrupt when opening the serial connection.</td> |
|
177 </tr> |
|
178 <tr> |
|
179 <td><a href="#RP2040Device.getBluetoothStatus">getBluetoothStatus</a></td> |
|
180 <td>Public method to get Bluetooth status data of the connected board.</td> |
|
181 </tr> |
|
182 <tr> |
|
183 <td><a href="#RP2040Device.getConnectedClients">getConnectedClients</a></td> |
|
184 <td>Public method to get a list of connected clients.</td> |
|
185 </tr> |
|
186 <tr> |
|
187 <td><a href="#RP2040Device.getDeviceScan">getDeviceScan</a></td> |
|
188 <td>Public method to perform a Bluetooth device scan.</td> |
|
189 </tr> |
|
190 <tr> |
|
191 <td><a href="#RP2040Device.getDocumentationUrl">getDocumentationUrl</a></td> |
|
192 <td>Public method to get the device documentation URL.</td> |
|
193 </tr> |
|
194 <tr> |
|
195 <td><a href="#RP2040Device.getDownloadMenuEntries">getDownloadMenuEntries</a></td> |
|
196 <td>Public method to retrieve the entries for the downloads menu.</td> |
|
197 </tr> |
|
198 <tr> |
|
199 <td><a href="#RP2040Device.getEthernetStatus">getEthernetStatus</a></td> |
|
200 <td>Public method to get Ethernet status data of the connected board.</td> |
|
201 </tr> |
|
202 <tr> |
|
203 <td><a href="#RP2040Device.getWifiData">getWifiData</a></td> |
|
204 <td>Public method to get data related to the current WiFi status.</td> |
|
205 </tr> |
|
206 <tr> |
|
207 <td><a href="#RP2040Device.hasBluetooth">hasBluetooth</a></td> |
|
208 <td>Public method to check the availability of Bluetooth.</td> |
|
209 </tr> |
|
210 <tr> |
|
211 <td><a href="#RP2040Device.hasEthernet">hasEthernet</a></td> |
|
212 <td>Public method to check the availability of Ethernet.</td> |
|
213 </tr> |
|
214 <tr> |
|
215 <td><a href="#RP2040Device.hasFlashMenuEntry">hasFlashMenuEntry</a></td> |
|
216 <td>Public method to check, if the device has its own flash menu entry.</td> |
|
217 </tr> |
|
218 <tr> |
|
219 <td><a href="#RP2040Device.hasNetworkTime">hasNetworkTime</a></td> |
|
220 <td>Public method to check the availability of network time functions.</td> |
|
221 </tr> |
|
222 <tr> |
|
223 <td><a href="#RP2040Device.hasWifi">hasWifi</a></td> |
|
224 <td>Public method to check the availability of WiFi.</td> |
|
225 </tr> |
|
226 <tr> |
|
227 <td><a href="#RP2040Device.hasWifiCountry">hasWifiCountry</a></td> |
|
228 <td>Public method to check, if the device has support to set the WiFi country.</td> |
|
229 </tr> |
|
230 <tr> |
|
231 <td><a href="#RP2040Device.isLanConnected">isLanConnected</a></td> |
|
232 <td>Public method to check the LAN connection status.</td> |
|
233 </tr> |
|
234 <tr> |
|
235 <td><a href="#RP2040Device.isWifiApConnected">isWifiApConnected</a></td> |
|
236 <td>Public method to check the WiFi connection status as access point.</td> |
|
237 </tr> |
|
238 <tr> |
|
239 <td><a href="#RP2040Device.isWifiClientConnected">isWifiClientConnected</a></td> |
|
240 <td>Public method to check the WiFi connection status as client.</td> |
|
241 </tr> |
|
242 <tr> |
|
243 <td><a href="#RP2040Device.removeCredentials">removeCredentials</a></td> |
|
244 <td>Public method to remove the saved credentials from the connected device.</td> |
|
245 </tr> |
|
246 <tr> |
|
247 <td><a href="#RP2040Device.removeLanAutoConnect">removeLanAutoConnect</a></td> |
|
248 <td>Public method to remove the saved IPv4 parameters from the connected device.</td> |
|
249 </tr> |
|
250 <tr> |
|
251 <td><a href="#RP2040Device.runScript">runScript</a></td> |
|
252 <td>Public method to run the given Python script.</td> |
|
253 </tr> |
|
254 <tr> |
|
255 <td><a href="#RP2040Device.scanNetworks">scanNetworks</a></td> |
|
256 <td>Public method to scan for available WiFi networks.</td> |
|
257 </tr> |
|
258 <tr> |
|
259 <td><a href="#RP2040Device.setButtons">setButtons</a></td> |
|
260 <td>Public method to enable the supported action buttons.</td> |
|
261 </tr> |
|
262 <tr> |
|
263 <td><a href="#RP2040Device.setNetworkTime">setNetworkTime</a></td> |
|
264 <td>Public method to set the time to the network time retrieved from an NTP server.</td> |
|
265 </tr> |
|
266 <tr> |
|
267 <td><a href="#RP2040Device.startAccessPoint">startAccessPoint</a></td> |
|
268 <td>Public method to start the access point interface.</td> |
|
269 </tr> |
|
270 <tr> |
|
271 <td><a href="#RP2040Device.stopAccessPoint">stopAccessPoint</a></td> |
|
272 <td>Public method to stop the access point interface.</td> |
|
273 </tr> |
|
274 <tr> |
|
275 <td><a href="#RP2040Device.writeCredentials">writeCredentials</a></td> |
|
276 <td>Public method to write the given credentials to the connected device and modify the start script to connect automatically.</td> |
|
277 </tr> |
|
278 <tr> |
|
279 <td><a href="#RP2040Device.writeLanAutoConnect">writeLanAutoConnect</a></td> |
|
280 <td>Public method to generate a script and associated configuration to connect the device to the LAN during boot time.</td> |
|
281 </tr> |
|
282 </table> |
|
283 |
|
284 <h3>Static Methods</h3> |
|
285 <table> |
|
286 <tr><td>None</td></tr> |
|
287 </table> |
|
288 |
|
289 |
|
290 <a NAME="RP2040Device.__init__" ID="RP2040Device.__init__"></a> |
|
291 <h4>RP2040Device (Constructor)</h4> |
|
292 <b>RP2040Device</b>(<i>microPythonWidget, deviceType, parent=None</i>) |
|
293 <p> |
|
294 Constructor |
|
295 </p> |
|
296 |
|
297 <dl> |
|
298 |
|
299 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
300 <dd> |
|
301 reference to the main MicroPython widget |
|
302 </dd> |
|
303 <dt><i>deviceType</i> (str)</dt> |
|
304 <dd> |
|
305 device type assigned to this device interface |
|
306 </dd> |
|
307 <dt><i>parent</i> (QObject)</dt> |
|
308 <dd> |
|
309 reference to the parent object |
|
310 </dd> |
|
311 </dl> |
|
312 <a NAME="RP2040Device.__activateBootloader" ID="RP2040Device.__activateBootloader"></a> |
|
313 <h4>RP2040Device.__activateBootloader</h4> |
|
314 <b>__activateBootloader</b>(<i></i>) |
|
315 <p> |
|
316 Private slot to switch the board into 'bootloader' mode. |
|
317 </p> |
|
318 |
|
319 <a NAME="RP2040Device.__createRP2040Menu" ID="RP2040Device.__createRP2040Menu"></a> |
|
320 <h4>RP2040Device.__createRP2040Menu</h4> |
|
321 <b>__createRP2040Menu</b>(<i></i>) |
|
322 <p> |
|
323 Private method to create the RP2040 submenu. |
|
324 </p> |
|
325 |
|
326 <a NAME="RP2040Device.__firmwareVersionResponse" ID="RP2040Device.__firmwareVersionResponse"></a> |
|
327 <h4>RP2040Device.__firmwareVersionResponse</h4> |
|
328 <b>__firmwareVersionResponse</b>(<i>reply</i>) |
|
329 <p> |
|
330 Private slot handling the response of the latest version request. |
|
331 </p> |
|
332 |
|
333 <dl> |
|
334 |
|
335 <dt><i>reply</i> (QNetworkReply)</dt> |
|
336 <dd> |
|
337 reference to the reply object |
|
338 </dd> |
|
339 </dl> |
|
340 <a NAME="RP2040Device.__flashPython" ID="RP2040Device.__flashPython"></a> |
|
341 <h4>RP2040Device.__flashPython</h4> |
|
342 <b>__flashPython</b>(<i></i>) |
|
343 <p> |
|
344 Private slot to flash a MicroPython firmware to the device. |
|
345 </p> |
|
346 |
|
347 <a NAME="RP2040Device.__resetCountry" ID="RP2040Device.__resetCountry"></a> |
|
348 <h4>RP2040Device.__resetCountry</h4> |
|
349 <b>__resetCountry</b>(<i></i>) |
|
350 <p> |
|
351 Private slot to reset the country of the connected ESP32 device. |
|
352 </p> |
|
353 <p> |
|
354 The country is the two-letter ISO 3166-1 Alpha-2 country code. This method |
|
355 resets it to the default code 'XX' representing the "worldwide" region. |
|
356 </p> |
|
357 |
|
358 <a NAME="RP2040Device.__resetDevice" ID="RP2040Device.__resetDevice"></a> |
|
359 <h4>RP2040Device.__resetDevice</h4> |
|
360 <b>__resetDevice</b>(<i></i>) |
|
361 <p> |
|
362 Private slot to reset the connected device. |
|
363 </p> |
|
364 |
|
365 <a NAME="RP2040Device.__setCountry" ID="RP2040Device.__setCountry"></a> |
|
366 <h4>RP2040Device.__setCountry</h4> |
|
367 <b>__setCountry</b>(<i></i>) |
|
368 <p> |
|
369 Private slot to configure the country of the connected RP2040 device. |
|
370 </p> |
|
371 <p> |
|
372 The country is the two-letter ISO 3166-1 Alpha-2 country code. |
|
373 </p> |
|
374 |
|
375 <a NAME="RP2040Device.__showFirmwareVersions" ID="RP2040Device.__showFirmwareVersions"></a> |
|
376 <h4>RP2040Device.__showFirmwareVersions</h4> |
|
377 <b>__showFirmwareVersions</b>(<i></i>) |
|
378 <p> |
|
379 Private slot to show the firmware version of the connected device and the |
|
380 available firmware version. |
|
381 </p> |
|
382 |
|
383 <a NAME="RP2040Device._getSetTimeCode" ID="RP2040Device._getSetTimeCode"></a> |
|
384 <h4>RP2040Device._getSetTimeCode</h4> |
|
385 <b>_getSetTimeCode</b>(<i></i>) |
|
386 <p> |
|
387 Protected method to get the device code to set the time. |
|
388 </p> |
|
389 <p> |
|
390 Note: This method must be implemented in the various device specific |
|
391 subclasses. |
|
392 </p> |
|
393 |
|
394 <dl> |
|
395 <dt>Return:</dt> |
|
396 <dd> |
|
397 code to be executed on the connected device to set the time |
|
398 </dd> |
|
399 </dl> |
|
400 <dl> |
|
401 <dt>Return Type:</dt> |
|
402 <dd> |
|
403 str |
|
404 </dd> |
|
405 </dl> |
|
406 <a NAME="RP2040Device.activateBluetoothInterface" ID="RP2040Device.activateBluetoothInterface"></a> |
|
407 <h4>RP2040Device.activateBluetoothInterface</h4> |
|
408 <b>activateBluetoothInterface</b>(<i></i>) |
|
409 <p> |
|
410 Public method to activate the Bluetooth interface. |
|
411 </p> |
|
412 |
|
413 <dl> |
|
414 <dt>Return:</dt> |
|
415 <dd> |
|
416 flag indicating the new state of the Bluetooth interface |
|
417 </dd> |
|
418 </dl> |
|
419 <dl> |
|
420 <dt>Return Type:</dt> |
|
421 <dd> |
|
422 bool |
|
423 </dd> |
|
424 </dl> |
|
425 <dl> |
|
426 |
|
427 <dt>Raises <b>OSError</b>:</dt> |
|
428 <dd> |
|
429 raised to indicate an issue with the device |
|
430 </dd> |
|
431 </dl> |
|
432 <a NAME="RP2040Device.addDeviceMenuEntries" ID="RP2040Device.addDeviceMenuEntries"></a> |
|
433 <h4>RP2040Device.addDeviceMenuEntries</h4> |
|
434 <b>addDeviceMenuEntries</b>(<i>menu</i>) |
|
435 <p> |
|
436 Public method to add device specific entries to the given menu. |
|
437 </p> |
|
438 |
|
439 <dl> |
|
440 |
|
441 <dt><i>menu</i> (QMenu)</dt> |
|
442 <dd> |
|
443 reference to the context menu |
|
444 </dd> |
|
445 </dl> |
|
446 <a NAME="RP2040Device.addDeviceWifiEntries" ID="RP2040Device.addDeviceWifiEntries"></a> |
|
447 <h4>RP2040Device.addDeviceWifiEntries</h4> |
|
448 <b>addDeviceWifiEntries</b>(<i>menu</i>) |
|
449 <p> |
|
450 Public method to add device specific entries to the given menu. |
|
451 </p> |
|
452 |
|
453 <dl> |
|
454 |
|
455 <dt><i>menu</i> (QMenu)</dt> |
|
456 <dd> |
|
457 reference to the context menu |
|
458 </dd> |
|
459 </dl> |
|
460 <a NAME="RP2040Device.canRunScript" ID="RP2040Device.canRunScript"></a> |
|
461 <h4>RP2040Device.canRunScript</h4> |
|
462 <b>canRunScript</b>(<i></i>) |
|
463 <p> |
|
464 Public method to determine, if a script can be executed. |
|
465 </p> |
|
466 |
|
467 <dl> |
|
468 <dt>Return:</dt> |
|
469 <dd> |
|
470 tuple containing a flag indicating it is safe to start a |
|
471 Plotter and a reason why it cannot. |
|
472 </dd> |
|
473 </dl> |
|
474 <dl> |
|
475 <dt>Return Type:</dt> |
|
476 <dd> |
|
477 tuple of (bool, str) |
|
478 </dd> |
|
479 </dl> |
|
480 <a NAME="RP2040Device.canStartFileManager" ID="RP2040Device.canStartFileManager"></a> |
|
481 <h4>RP2040Device.canStartFileManager</h4> |
|
482 <b>canStartFileManager</b>(<i></i>) |
|
483 <p> |
|
484 Public method to determine, if a File Manager can be started. |
|
485 </p> |
|
486 |
|
487 <dl> |
|
488 <dt>Return:</dt> |
|
489 <dd> |
|
490 tuple containing a flag indicating it is safe to start a |
|
491 File Manager and a reason why it cannot. |
|
492 </dd> |
|
493 </dl> |
|
494 <dl> |
|
495 <dt>Return Type:</dt> |
|
496 <dd> |
|
497 tuple of (bool, str) |
|
498 </dd> |
|
499 </dl> |
|
500 <a NAME="RP2040Device.canStartPlotter" ID="RP2040Device.canStartPlotter"></a> |
|
501 <h4>RP2040Device.canStartPlotter</h4> |
|
502 <b>canStartPlotter</b>(<i></i>) |
|
503 <p> |
|
504 Public method to determine, if a Plotter can be started. |
|
505 </p> |
|
506 |
|
507 <dl> |
|
508 <dt>Return:</dt> |
|
509 <dd> |
|
510 tuple containing a flag indicating it is safe to start a |
|
511 Plotter and a reason why it cannot. |
|
512 </dd> |
|
513 </dl> |
|
514 <dl> |
|
515 <dt>Return Type:</dt> |
|
516 <dd> |
|
517 tuple of (bool, str) |
|
518 </dd> |
|
519 </dl> |
|
520 <a NAME="RP2040Device.canStartRepl" ID="RP2040Device.canStartRepl"></a> |
|
521 <h4>RP2040Device.canStartRepl</h4> |
|
522 <b>canStartRepl</b>(<i></i>) |
|
523 <p> |
|
524 Public method to determine, if a REPL can be started. |
|
525 </p> |
|
526 |
|
527 <dl> |
|
528 <dt>Return:</dt> |
|
529 <dd> |
|
530 tuple containing a flag indicating it is safe to start a REPL |
|
531 and a reason why it cannot. |
|
532 </dd> |
|
533 </dl> |
|
534 <dl> |
|
535 <dt>Return Type:</dt> |
|
536 <dd> |
|
537 tuple of (bool, str) |
|
538 </dd> |
|
539 </dl> |
|
540 <a NAME="RP2040Device.checkInternet" ID="RP2040Device.checkInternet"></a> |
|
541 <h4>RP2040Device.checkInternet</h4> |
|
542 <b>checkInternet</b>(<i></i>) |
|
543 <p> |
|
544 Public method to check, if the internet can be reached. |
|
545 </p> |
|
546 |
|
547 <dl> |
|
548 <dt>Return:</dt> |
|
549 <dd> |
|
550 tuple containing a flag indicating reachability and an error string |
|
551 </dd> |
|
552 </dl> |
|
553 <dl> |
|
554 <dt>Return Type:</dt> |
|
555 <dd> |
|
556 tuple of (bool, str) |
|
557 </dd> |
|
558 </dl> |
|
559 <a NAME="RP2040Device.checkInternetViaLan" ID="RP2040Device.checkInternetViaLan"></a> |
|
560 <h4>RP2040Device.checkInternetViaLan</h4> |
|
561 <b>checkInternetViaLan</b>(<i></i>) |
|
562 <p> |
|
563 Public method to check, if the internet can be reached (LAN variant). |
|
564 </p> |
|
565 |
|
566 <dl> |
|
567 <dt>Return:</dt> |
|
568 <dd> |
|
569 tuple containing a flag indicating reachability and an error string |
|
570 </dd> |
|
571 </dl> |
|
572 <dl> |
|
573 <dt>Return Type:</dt> |
|
574 <dd> |
|
575 tuple of (bool, str) |
|
576 </dd> |
|
577 </dl> |
|
578 <a NAME="RP2040Device.connectToLan" ID="RP2040Device.connectToLan"></a> |
|
579 <h4>RP2040Device.connectToLan</h4> |
|
580 <b>connectToLan</b>(<i>config, hostname</i>) |
|
581 <p> |
|
582 Public method to connect the connected device to the LAN. |
|
583 </p> |
|
584 |
|
585 <dl> |
|
586 |
|
587 <dt><i>config</i> (str or tuple of (str, str, str, str))</dt> |
|
588 <dd> |
|
589 configuration for the connection (either the string 'dhcp' |
|
590 for a dynamic address or a tuple of four strings with the IPv4 parameters. |
|
591 </dd> |
|
592 <dt><i>hostname</i> (str)</dt> |
|
593 <dd> |
|
594 host name of the device |
|
595 </dd> |
|
596 </dl> |
|
597 <dl> |
|
598 <dt>Return:</dt> |
|
599 <dd> |
|
600 tuple containing a flag indicating success and an error message |
|
601 </dd> |
|
602 </dl> |
|
603 <dl> |
|
604 <dt>Return Type:</dt> |
|
605 <dd> |
|
606 tuple of (bool, str) |
|
607 </dd> |
|
608 </dl> |
|
609 <a NAME="RP2040Device.connectWifi" ID="RP2040Device.connectWifi"></a> |
|
610 <h4>RP2040Device.connectWifi</h4> |
|
611 <b>connectWifi</b>(<i>ssid, password, hostname</i>) |
|
612 <p> |
|
613 Public method to connect a device to a WiFi network. |
|
614 </p> |
|
615 |
|
616 <dl> |
|
617 |
|
618 <dt><i>ssid</i> (str)</dt> |
|
619 <dd> |
|
620 name (SSID) of the WiFi network |
|
621 </dd> |
|
622 <dt><i>password</i> (str)</dt> |
|
623 <dd> |
|
624 password needed to connect |
|
625 </dd> |
|
626 <dt><i>hostname</i> (str)</dt> |
|
627 <dd> |
|
628 host name of the device |
|
629 </dd> |
|
630 </dl> |
|
631 <dl> |
|
632 <dt>Return:</dt> |
|
633 <dd> |
|
634 tuple containing the connection status and an error string |
|
635 </dd> |
|
636 </dl> |
|
637 <dl> |
|
638 <dt>Return Type:</dt> |
|
639 <dd> |
|
640 tuple of (bool, str) |
|
641 </dd> |
|
642 </dl> |
|
643 <a NAME="RP2040Device.deactivateBluetoothInterface" ID="RP2040Device.deactivateBluetoothInterface"></a> |
|
644 <h4>RP2040Device.deactivateBluetoothInterface</h4> |
|
645 <b>deactivateBluetoothInterface</b>(<i></i>) |
|
646 <p> |
|
647 Public method to deactivate the Bluetooth interface. |
|
648 </p> |
|
649 |
|
650 <dl> |
|
651 <dt>Return:</dt> |
|
652 <dd> |
|
653 flag indicating the new state of the Bluetooth interface |
|
654 </dd> |
|
655 </dl> |
|
656 <dl> |
|
657 <dt>Return Type:</dt> |
|
658 <dd> |
|
659 bool |
|
660 </dd> |
|
661 </dl> |
|
662 <dl> |
|
663 |
|
664 <dt>Raises <b>OSError</b>:</dt> |
|
665 <dd> |
|
666 raised to indicate an issue with the device |
|
667 </dd> |
|
668 </dl> |
|
669 <a NAME="RP2040Device.deactivateEthernet" ID="RP2040Device.deactivateEthernet"></a> |
|
670 <h4>RP2040Device.deactivateEthernet</h4> |
|
671 <b>deactivateEthernet</b>(<i></i>) |
|
672 <p> |
|
673 Public method to deactivate the Ethernet interface of the connected device. |
|
674 </p> |
|
675 |
|
676 <dl> |
|
677 <dt>Return:</dt> |
|
678 <dd> |
|
679 tuple containg a flag indicating success and an error message |
|
680 </dd> |
|
681 </dl> |
|
682 <dl> |
|
683 <dt>Return Type:</dt> |
|
684 <dd> |
|
685 tuple of (bool, str) |
|
686 </dd> |
|
687 </dl> |
|
688 <a NAME="RP2040Device.deactivateInterface" ID="RP2040Device.deactivateInterface"></a> |
|
689 <h4>RP2040Device.deactivateInterface</h4> |
|
690 <b>deactivateInterface</b>(<i>interface</i>) |
|
691 <p> |
|
692 Public method to deactivate a given WiFi interface of the connected device. |
|
693 </p> |
|
694 |
|
695 <dl> |
|
696 |
|
697 <dt><i>interface</i> (str)</dt> |
|
698 <dd> |
|
699 designation of the interface to be deactivated (one of 'AP' |
|
700 or 'STA') |
|
701 </dd> |
|
702 </dl> |
|
703 <dl> |
|
704 <dt>Return:</dt> |
|
705 <dd> |
|
706 tuple containg a flag indicating success and an error message |
|
707 </dd> |
|
708 </dl> |
|
709 <dl> |
|
710 <dt>Return Type:</dt> |
|
711 <dd> |
|
712 tuple of (bool, str) |
|
713 </dd> |
|
714 </dl> |
|
715 <dl> |
|
716 |
|
717 <dt>Raises <b>ValueError</b>:</dt> |
|
718 <dd> |
|
719 raised to indicate a wrong value for the interface type |
|
720 </dd> |
|
721 </dl> |
|
722 <a NAME="RP2040Device.deviceName" ID="RP2040Device.deviceName"></a> |
|
723 <h4>RP2040Device.deviceName</h4> |
|
724 <b>deviceName</b>(<i></i>) |
|
725 <p> |
|
726 Public method to get the name of the device. |
|
727 </p> |
|
728 |
|
729 <dl> |
|
730 <dt>Return:</dt> |
|
731 <dd> |
|
732 name of the device |
|
733 </dd> |
|
734 </dl> |
|
735 <dl> |
|
736 <dt>Return Type:</dt> |
|
737 <dd> |
|
738 str |
|
739 </dd> |
|
740 </dl> |
|
741 <a NAME="RP2040Device.disableWebrepl" ID="RP2040Device.disableWebrepl"></a> |
|
742 <h4>RP2040Device.disableWebrepl</h4> |
|
743 <b>disableWebrepl</b>(<i></i>) |
|
744 <p> |
|
745 Public method to write the given WebREPL password to the connected device and |
|
746 modify the start script to start the WebREPL server. |
|
747 </p> |
|
748 |
|
749 <dl> |
|
750 <dt>Return:</dt> |
|
751 <dd> |
|
752 tuple containing a flag indicating success and an error message |
|
753 </dd> |
|
754 </dl> |
|
755 <dl> |
|
756 <dt>Return Type:</dt> |
|
757 <dd> |
|
758 tuple of (bool, str) |
|
759 </dd> |
|
760 </dl> |
|
761 <a NAME="RP2040Device.disconnectFromLan" ID="RP2040Device.disconnectFromLan"></a> |
|
762 <h4>RP2040Device.disconnectFromLan</h4> |
|
763 <b>disconnectFromLan</b>(<i></i>) |
|
764 <p> |
|
765 Public method to disconnect from the LAN. |
|
766 </p> |
|
767 |
|
768 <dl> |
|
769 <dt>Return:</dt> |
|
770 <dd> |
|
771 tuple containing a flag indicating success and an error message |
|
772 </dd> |
|
773 </dl> |
|
774 <dl> |
|
775 <dt>Return Type:</dt> |
|
776 <dd> |
|
777 tuple of (bool, str) |
|
778 </dd> |
|
779 </dl> |
|
780 <a NAME="RP2040Device.disconnectWifi" ID="RP2040Device.disconnectWifi"></a> |
|
781 <h4>RP2040Device.disconnectWifi</h4> |
|
782 <b>disconnectWifi</b>(<i></i>) |
|
783 <p> |
|
784 Public method to disconnect a device from the WiFi network. |
|
785 </p> |
|
786 |
|
787 <dl> |
|
788 <dt>Return:</dt> |
|
789 <dd> |
|
790 tuple containing a flag indicating success and an error string |
|
791 </dd> |
|
792 </dl> |
|
793 <dl> |
|
794 <dt>Return Type:</dt> |
|
795 <dd> |
|
796 tuple of (bool, str) |
|
797 </dd> |
|
798 </dl> |
|
799 <a NAME="RP2040Device.enableWebrepl" ID="RP2040Device.enableWebrepl"></a> |
|
800 <h4>RP2040Device.enableWebrepl</h4> |
|
801 <b>enableWebrepl</b>(<i>password</i>) |
|
802 <p> |
|
803 Public method to write the given WebREPL password to the connected device and |
|
804 modify the start script to start the WebREPL server. |
|
805 </p> |
|
806 |
|
807 <dl> |
|
808 |
|
809 <dt><i>password</i> (str)</dt> |
|
810 <dd> |
|
811 password needed to authenticate |
|
812 </dd> |
|
813 </dl> |
|
814 <dl> |
|
815 <dt>Return:</dt> |
|
816 <dd> |
|
817 tuple containing a flag indicating success and an error message |
|
818 </dd> |
|
819 </dl> |
|
820 <dl> |
|
821 <dt>Return Type:</dt> |
|
822 <dd> |
|
823 tuple of (bool, str) |
|
824 </dd> |
|
825 </dl> |
|
826 <a NAME="RP2040Device.forceInterrupt" ID="RP2040Device.forceInterrupt"></a> |
|
827 <h4>RP2040Device.forceInterrupt</h4> |
|
828 <b>forceInterrupt</b>(<i></i>) |
|
829 <p> |
|
830 Public method to determine the need for an interrupt when opening the |
|
831 serial connection. |
|
832 </p> |
|
833 |
|
834 <dl> |
|
835 <dt>Return:</dt> |
|
836 <dd> |
|
837 flag indicating an interrupt is needed |
|
838 </dd> |
|
839 </dl> |
|
840 <dl> |
|
841 <dt>Return Type:</dt> |
|
842 <dd> |
|
843 bool |
|
844 </dd> |
|
845 </dl> |
|
846 <a NAME="RP2040Device.getBluetoothStatus" ID="RP2040Device.getBluetoothStatus"></a> |
|
847 <h4>RP2040Device.getBluetoothStatus</h4> |
|
848 <b>getBluetoothStatus</b>(<i></i>) |
|
849 <p> |
|
850 Public method to get Bluetooth status data of the connected board. |
|
851 </p> |
|
852 |
|
853 <dl> |
|
854 <dt>Return:</dt> |
|
855 <dd> |
|
856 list of tuples containing the translated status data label and |
|
857 the associated value |
|
858 </dd> |
|
859 </dl> |
|
860 <dl> |
|
861 <dt>Return Type:</dt> |
|
862 <dd> |
|
863 list of tuples of (str, str) |
|
864 </dd> |
|
865 </dl> |
|
866 <dl> |
|
867 |
|
868 <dt>Raises <b>OSError</b>:</dt> |
|
869 <dd> |
|
870 raised to indicate an issue with the device |
|
871 </dd> |
|
872 </dl> |
|
873 <a NAME="RP2040Device.getConnectedClients" ID="RP2040Device.getConnectedClients"></a> |
|
874 <h4>RP2040Device.getConnectedClients</h4> |
|
875 <b>getConnectedClients</b>(<i></i>) |
|
876 <p> |
|
877 Public method to get a list of connected clients. |
|
878 </p> |
|
879 |
|
880 <dl> |
|
881 <dt>Return:</dt> |
|
882 <dd> |
|
883 a tuple containing a list of tuples containing the client MAC-Address |
|
884 and the RSSI (if supported and available) and an error message |
|
885 </dd> |
|
886 </dl> |
|
887 <dl> |
|
888 <dt>Return Type:</dt> |
|
889 <dd> |
|
890 tuple of ([(bytes, int)], str) |
|
891 </dd> |
|
892 </dl> |
|
893 <a NAME="RP2040Device.getDeviceScan" ID="RP2040Device.getDeviceScan"></a> |
|
894 <h4>RP2040Device.getDeviceScan</h4> |
|
895 <b>getDeviceScan</b>(<i>timeout=10</i>) |
|
896 <p> |
|
897 Public method to perform a Bluetooth device scan. |
|
898 </p> |
|
899 |
|
900 <dl> |
|
901 |
|
902 <dt><i>timeout</i> (int (optional))</dt> |
|
903 <dd> |
|
904 duration of the device scan in seconds (defaults |
|
905 to 10) |
|
906 </dd> |
|
907 </dl> |
|
908 <dl> |
|
909 <dt>Return:</dt> |
|
910 <dd> |
|
911 tuple containing a dictionary with the scan results and |
|
912 an error string |
|
913 </dd> |
|
914 </dl> |
|
915 <dl> |
|
916 <dt>Return Type:</dt> |
|
917 <dd> |
|
918 tuple of (dict, str) |
|
919 </dd> |
|
920 </dl> |
|
921 <a NAME="RP2040Device.getDocumentationUrl" ID="RP2040Device.getDocumentationUrl"></a> |
|
922 <h4>RP2040Device.getDocumentationUrl</h4> |
|
923 <b>getDocumentationUrl</b>(<i></i>) |
|
924 <p> |
|
925 Public method to get the device documentation URL. |
|
926 </p> |
|
927 |
|
928 <dl> |
|
929 <dt>Return:</dt> |
|
930 <dd> |
|
931 documentation URL of the device |
|
932 </dd> |
|
933 </dl> |
|
934 <dl> |
|
935 <dt>Return Type:</dt> |
|
936 <dd> |
|
937 str |
|
938 </dd> |
|
939 </dl> |
|
940 <a NAME="RP2040Device.getDownloadMenuEntries" ID="RP2040Device.getDownloadMenuEntries"></a> |
|
941 <h4>RP2040Device.getDownloadMenuEntries</h4> |
|
942 <b>getDownloadMenuEntries</b>(<i></i>) |
|
943 <p> |
|
944 Public method to retrieve the entries for the downloads menu. |
|
945 </p> |
|
946 |
|
947 <dl> |
|
948 <dt>Return:</dt> |
|
949 <dd> |
|
950 list of tuples with menu text and URL to be opened for each |
|
951 entry |
|
952 </dd> |
|
953 </dl> |
|
954 <dl> |
|
955 <dt>Return Type:</dt> |
|
956 <dd> |
|
957 list of tuple of (str, str) |
|
958 </dd> |
|
959 </dl> |
|
960 <a NAME="RP2040Device.getEthernetStatus" ID="RP2040Device.getEthernetStatus"></a> |
|
961 <h4>RP2040Device.getEthernetStatus</h4> |
|
962 <b>getEthernetStatus</b>(<i></i>) |
|
963 <p> |
|
964 Public method to get Ethernet status data of the connected board. |
|
965 </p> |
|
966 |
|
967 <dl> |
|
968 <dt>Return:</dt> |
|
969 <dd> |
|
970 list of tuples containing the translated status data label and |
|
971 the associated value |
|
972 </dd> |
|
973 </dl> |
|
974 <dl> |
|
975 <dt>Return Type:</dt> |
|
976 <dd> |
|
977 list of tuples of (str, str) |
|
978 </dd> |
|
979 </dl> |
|
980 <dl> |
|
981 |
|
982 <dt>Raises <b>OSError</b>:</dt> |
|
983 <dd> |
|
984 raised to indicate an issue with the device |
|
985 </dd> |
|
986 </dl> |
|
987 <a NAME="RP2040Device.getWifiData" ID="RP2040Device.getWifiData"></a> |
|
988 <h4>RP2040Device.getWifiData</h4> |
|
989 <b>getWifiData</b>(<i></i>) |
|
990 <p> |
|
991 Public method to get data related to the current WiFi status. |
|
992 </p> |
|
993 |
|
994 <dl> |
|
995 <dt>Return:</dt> |
|
996 <dd> |
|
997 tuple of three dictionaries containing the WiFi status data |
|
998 for the WiFi client, access point and overall data |
|
999 </dd> |
|
1000 </dl> |
|
1001 <dl> |
|
1002 <dt>Return Type:</dt> |
|
1003 <dd> |
|
1004 tuple of (dict, dict, dict) |
|
1005 </dd> |
|
1006 </dl> |
|
1007 <dl> |
|
1008 |
|
1009 <dt>Raises <b>OSError</b>:</dt> |
|
1010 <dd> |
|
1011 raised to indicate an issue with the device |
|
1012 </dd> |
|
1013 </dl> |
|
1014 <a NAME="RP2040Device.hasBluetooth" ID="RP2040Device.hasBluetooth"></a> |
|
1015 <h4>RP2040Device.hasBluetooth</h4> |
|
1016 <b>hasBluetooth</b>(<i></i>) |
|
1017 <p> |
|
1018 Public method to check the availability of Bluetooth. |
|
1019 </p> |
|
1020 |
|
1021 <dl> |
|
1022 <dt>Return:</dt> |
|
1023 <dd> |
|
1024 flag indicating the availability of Bluetooth |
|
1025 </dd> |
|
1026 </dl> |
|
1027 <dl> |
|
1028 <dt>Return Type:</dt> |
|
1029 <dd> |
|
1030 bool |
|
1031 </dd> |
|
1032 </dl> |
|
1033 <dl> |
|
1034 |
|
1035 <dt>Raises <b>OSError</b>:</dt> |
|
1036 <dd> |
|
1037 raised to indicate an issue with the device |
|
1038 </dd> |
|
1039 </dl> |
|
1040 <a NAME="RP2040Device.hasEthernet" ID="RP2040Device.hasEthernet"></a> |
|
1041 <h4>RP2040Device.hasEthernet</h4> |
|
1042 <b>hasEthernet</b>(<i></i>) |
|
1043 <p> |
|
1044 Public method to check the availability of Ethernet. |
|
1045 </p> |
|
1046 |
|
1047 <dl> |
|
1048 <dt>Return:</dt> |
|
1049 <dd> |
|
1050 tuple containing a flag indicating the availability of Ethernet |
|
1051 and the Ethernet type (picowiz) |
|
1052 </dd> |
|
1053 </dl> |
|
1054 <dl> |
|
1055 <dt>Return Type:</dt> |
|
1056 <dd> |
|
1057 tuple of (bool, str) |
|
1058 </dd> |
|
1059 </dl> |
|
1060 <dl> |
|
1061 |
|
1062 <dt>Raises <b>OSError</b>:</dt> |
|
1063 <dd> |
|
1064 raised to indicate an issue with the device |
|
1065 </dd> |
|
1066 </dl> |
|
1067 <a NAME="RP2040Device.hasFlashMenuEntry" ID="RP2040Device.hasFlashMenuEntry"></a> |
|
1068 <h4>RP2040Device.hasFlashMenuEntry</h4> |
|
1069 <b>hasFlashMenuEntry</b>(<i></i>) |
|
1070 <p> |
|
1071 Public method to check, if the device has its own flash menu entry. |
|
1072 </p> |
|
1073 |
|
1074 <dl> |
|
1075 <dt>Return:</dt> |
|
1076 <dd> |
|
1077 flag indicating a specific flash menu entry |
|
1078 </dd> |
|
1079 </dl> |
|
1080 <dl> |
|
1081 <dt>Return Type:</dt> |
|
1082 <dd> |
|
1083 bool |
|
1084 </dd> |
|
1085 </dl> |
|
1086 <a NAME="RP2040Device.hasNetworkTime" ID="RP2040Device.hasNetworkTime"></a> |
|
1087 <h4>RP2040Device.hasNetworkTime</h4> |
|
1088 <b>hasNetworkTime</b>(<i></i>) |
|
1089 <p> |
|
1090 Public method to check the availability of network time functions. |
|
1091 </p> |
|
1092 |
|
1093 <dl> |
|
1094 <dt>Return:</dt> |
|
1095 <dd> |
|
1096 flag indicating the availability of network time functions |
|
1097 </dd> |
|
1098 </dl> |
|
1099 <dl> |
|
1100 <dt>Return Type:</dt> |
|
1101 <dd> |
|
1102 bool |
|
1103 </dd> |
|
1104 </dl> |
|
1105 <dl> |
|
1106 |
|
1107 <dt>Raises <b>OSError</b>:</dt> |
|
1108 <dd> |
|
1109 raised to indicate an issue with the device |
|
1110 </dd> |
|
1111 </dl> |
|
1112 <a NAME="RP2040Device.hasWifi" ID="RP2040Device.hasWifi"></a> |
|
1113 <h4>RP2040Device.hasWifi</h4> |
|
1114 <b>hasWifi</b>(<i></i>) |
|
1115 <p> |
|
1116 Public method to check the availability of WiFi. |
|
1117 </p> |
|
1118 |
|
1119 <dl> |
|
1120 <dt>Return:</dt> |
|
1121 <dd> |
|
1122 tuple containing a flag indicating the availability of WiFi |
|
1123 and the WiFi type (picow or picowireless) |
|
1124 </dd> |
|
1125 </dl> |
|
1126 <dl> |
|
1127 <dt>Return Type:</dt> |
|
1128 <dd> |
|
1129 tuple of (bool, str) |
|
1130 </dd> |
|
1131 </dl> |
|
1132 <dl> |
|
1133 |
|
1134 <dt>Raises <b>OSError</b>:</dt> |
|
1135 <dd> |
|
1136 raised to indicate an issue with the device |
|
1137 </dd> |
|
1138 </dl> |
|
1139 <a NAME="RP2040Device.hasWifiCountry" ID="RP2040Device.hasWifiCountry"></a> |
|
1140 <h4>RP2040Device.hasWifiCountry</h4> |
|
1141 <b>hasWifiCountry</b>(<i></i>) |
|
1142 <p> |
|
1143 Public method to check, if the device has support to set the WiFi country. |
|
1144 </p> |
|
1145 |
|
1146 <dl> |
|
1147 <dt>Return:</dt> |
|
1148 <dd> |
|
1149 flag indicating the support of WiFi country |
|
1150 </dd> |
|
1151 </dl> |
|
1152 <dl> |
|
1153 <dt>Return Type:</dt> |
|
1154 <dd> |
|
1155 bool |
|
1156 </dd> |
|
1157 </dl> |
|
1158 <a NAME="RP2040Device.isLanConnected" ID="RP2040Device.isLanConnected"></a> |
|
1159 <h4>RP2040Device.isLanConnected</h4> |
|
1160 <b>isLanConnected</b>(<i></i>) |
|
1161 <p> |
|
1162 Public method to check the LAN connection status. |
|
1163 </p> |
|
1164 |
|
1165 <dl> |
|
1166 <dt>Return:</dt> |
|
1167 <dd> |
|
1168 flag indicating that the device is connected to the LAN |
|
1169 </dd> |
|
1170 </dl> |
|
1171 <dl> |
|
1172 <dt>Return Type:</dt> |
|
1173 <dd> |
|
1174 bool |
|
1175 </dd> |
|
1176 </dl> |
|
1177 <a NAME="RP2040Device.isWifiApConnected" ID="RP2040Device.isWifiApConnected"></a> |
|
1178 <h4>RP2040Device.isWifiApConnected</h4> |
|
1179 <b>isWifiApConnected</b>(<i></i>) |
|
1180 <p> |
|
1181 Public method to check the WiFi connection status as access point. |
|
1182 </p> |
|
1183 |
|
1184 <dl> |
|
1185 <dt>Return:</dt> |
|
1186 <dd> |
|
1187 flag indicating the WiFi connection status |
|
1188 </dd> |
|
1189 </dl> |
|
1190 <dl> |
|
1191 <dt>Return Type:</dt> |
|
1192 <dd> |
|
1193 bool |
|
1194 </dd> |
|
1195 </dl> |
|
1196 <a NAME="RP2040Device.isWifiClientConnected" ID="RP2040Device.isWifiClientConnected"></a> |
|
1197 <h4>RP2040Device.isWifiClientConnected</h4> |
|
1198 <b>isWifiClientConnected</b>(<i></i>) |
|
1199 <p> |
|
1200 Public method to check the WiFi connection status as client. |
|
1201 </p> |
|
1202 |
|
1203 <dl> |
|
1204 <dt>Return:</dt> |
|
1205 <dd> |
|
1206 flag indicating the WiFi connection status |
|
1207 </dd> |
|
1208 </dl> |
|
1209 <dl> |
|
1210 <dt>Return Type:</dt> |
|
1211 <dd> |
|
1212 bool |
|
1213 </dd> |
|
1214 </dl> |
|
1215 <a NAME="RP2040Device.removeCredentials" ID="RP2040Device.removeCredentials"></a> |
|
1216 <h4>RP2040Device.removeCredentials</h4> |
|
1217 <b>removeCredentials</b>(<i></i>) |
|
1218 <p> |
|
1219 Public method to remove the saved credentials from the connected device. |
|
1220 </p> |
|
1221 |
|
1222 <dl> |
|
1223 <dt>Return:</dt> |
|
1224 <dd> |
|
1225 tuple containing a flag indicating success and an error message |
|
1226 </dd> |
|
1227 </dl> |
|
1228 <dl> |
|
1229 <dt>Return Type:</dt> |
|
1230 <dd> |
|
1231 tuple of (bool, str) |
|
1232 </dd> |
|
1233 </dl> |
|
1234 <a NAME="RP2040Device.removeLanAutoConnect" ID="RP2040Device.removeLanAutoConnect"></a> |
|
1235 <h4>RP2040Device.removeLanAutoConnect</h4> |
|
1236 <b>removeLanAutoConnect</b>(<i></i>) |
|
1237 <p> |
|
1238 Public method to remove the saved IPv4 parameters from the connected device. |
|
1239 </p> |
|
1240 <p> |
|
1241 Note: This disables the LAN auto-connect feature. |
|
1242 </p> |
|
1243 |
|
1244 <dl> |
|
1245 <dt>Return:</dt> |
|
1246 <dd> |
|
1247 tuple containing a flag indicating success and an error message |
|
1248 </dd> |
|
1249 </dl> |
|
1250 <dl> |
|
1251 <dt>Return Type:</dt> |
|
1252 <dd> |
|
1253 tuple of (bool, str) |
|
1254 </dd> |
|
1255 </dl> |
|
1256 <a NAME="RP2040Device.runScript" ID="RP2040Device.runScript"></a> |
|
1257 <h4>RP2040Device.runScript</h4> |
|
1258 <b>runScript</b>(<i>script</i>) |
|
1259 <p> |
|
1260 Public method to run the given Python script. |
|
1261 </p> |
|
1262 |
|
1263 <dl> |
|
1264 |
|
1265 <dt><i>script</i> (str)</dt> |
|
1266 <dd> |
|
1267 script to be executed |
|
1268 </dd> |
|
1269 </dl> |
|
1270 <a NAME="RP2040Device.scanNetworks" ID="RP2040Device.scanNetworks"></a> |
|
1271 <h4>RP2040Device.scanNetworks</h4> |
|
1272 <b>scanNetworks</b>(<i></i>) |
|
1273 <p> |
|
1274 Public method to scan for available WiFi networks. |
|
1275 </p> |
|
1276 |
|
1277 <dl> |
|
1278 <dt>Return:</dt> |
|
1279 <dd> |
|
1280 tuple containing the list of available networks as a tuple of 'Name', |
|
1281 'MAC-Address', 'channel', 'RSSI' and 'security' and an error string |
|
1282 </dd> |
|
1283 </dl> |
|
1284 <dl> |
|
1285 <dt>Return Type:</dt> |
|
1286 <dd> |
|
1287 tuple of (list of tuple of (str, str, int, int, str), str) |
|
1288 </dd> |
|
1289 </dl> |
|
1290 <a NAME="RP2040Device.setButtons" ID="RP2040Device.setButtons"></a> |
|
1291 <h4>RP2040Device.setButtons</h4> |
|
1292 <b>setButtons</b>(<i></i>) |
|
1293 <p> |
|
1294 Public method to enable the supported action buttons. |
|
1295 </p> |
|
1296 |
|
1297 <a NAME="RP2040Device.setNetworkTime" ID="RP2040Device.setNetworkTime"></a> |
|
1298 <h4>RP2040Device.setNetworkTime</h4> |
|
1299 <b>setNetworkTime</b>(<i>server="pool.ntp.org", tzOffset=0, timeout=10</i>) |
|
1300 <p> |
|
1301 Public method to set the time to the network time retrieved from an |
|
1302 NTP server. |
|
1303 </p> |
|
1304 |
|
1305 <dl> |
|
1306 |
|
1307 <dt><i>server</i> (str (optional))</dt> |
|
1308 <dd> |
|
1309 name of the NTP server to get the network time from |
|
1310 (defaults to "0.pool.ntp.org") |
|
1311 </dd> |
|
1312 <dt><i>tzOffset</i> (int (optional))</dt> |
|
1313 <dd> |
|
1314 offset with respect to UTC (defaults to 0) |
|
1315 </dd> |
|
1316 <dt><i>timeout</i> (int)</dt> |
|
1317 <dd> |
|
1318 maximum time to wait for a server response in seconds |
|
1319 (defaults to 10) |
|
1320 </dd> |
|
1321 </dl> |
|
1322 <dl> |
|
1323 <dt>Return:</dt> |
|
1324 <dd> |
|
1325 tuple containing a flag indicating success and an error string |
|
1326 </dd> |
|
1327 </dl> |
|
1328 <dl> |
|
1329 <dt>Return Type:</dt> |
|
1330 <dd> |
|
1331 tuple of (bool, str) |
|
1332 </dd> |
|
1333 </dl> |
|
1334 <a NAME="RP2040Device.startAccessPoint" ID="RP2040Device.startAccessPoint"></a> |
|
1335 <h4>RP2040Device.startAccessPoint</h4> |
|
1336 <b>startAccessPoint</b>(<i>ssid, security=None, password=None, hostname=None, ifconfig=None, </i>) |
|
1337 <p> |
|
1338 Public method to start the access point interface. |
|
1339 </p> |
|
1340 |
|
1341 <dl> |
|
1342 |
|
1343 <dt><i>ssid</i> (str)</dt> |
|
1344 <dd> |
|
1345 SSID of the access point |
|
1346 </dd> |
|
1347 <dt><i>security</i> (int (optional))</dt> |
|
1348 <dd> |
|
1349 security method (defaults to None) |
|
1350 </dd> |
|
1351 <dt><i>password</i> (str (optional))</dt> |
|
1352 <dd> |
|
1353 password (defaults to None) |
|
1354 </dd> |
|
1355 <dt><i>hostname</i> (str (optional))</dt> |
|
1356 <dd> |
|
1357 host name of the device (defaults to None) |
|
1358 </dd> |
|
1359 <dt><i>ifconfig</i> (tuple of (str, str, str, str))</dt> |
|
1360 <dd> |
|
1361 IPv4 configuration for the access point if not default |
|
1362 (IPv4 address, netmask, gateway address, DNS server address) |
|
1363 </dd> |
|
1364 </dl> |
|
1365 <dl> |
|
1366 <dt>Return:</dt> |
|
1367 <dd> |
|
1368 tuple containing a flag indicating success and an error message |
|
1369 </dd> |
|
1370 </dl> |
|
1371 <dl> |
|
1372 <dt>Return Type:</dt> |
|
1373 <dd> |
|
1374 tuple of (bool, str) |
|
1375 </dd> |
|
1376 </dl> |
|
1377 <a NAME="RP2040Device.stopAccessPoint" ID="RP2040Device.stopAccessPoint"></a> |
|
1378 <h4>RP2040Device.stopAccessPoint</h4> |
|
1379 <b>stopAccessPoint</b>(<i></i>) |
|
1380 <p> |
|
1381 Public method to stop the access point interface. |
|
1382 </p> |
|
1383 |
|
1384 <dl> |
|
1385 <dt>Return:</dt> |
|
1386 <dd> |
|
1387 tuple containg a flag indicating success and an error message |
|
1388 </dd> |
|
1389 </dl> |
|
1390 <dl> |
|
1391 <dt>Return Type:</dt> |
|
1392 <dd> |
|
1393 tuple of (bool, str) |
|
1394 </dd> |
|
1395 </dl> |
|
1396 <a NAME="RP2040Device.writeCredentials" ID="RP2040Device.writeCredentials"></a> |
|
1397 <h4>RP2040Device.writeCredentials</h4> |
|
1398 <b>writeCredentials</b>(<i>ssid, password, hostname, country</i>) |
|
1399 <p> |
|
1400 Public method to write the given credentials to the connected device and modify |
|
1401 the start script to connect automatically. |
|
1402 </p> |
|
1403 |
|
1404 <dl> |
|
1405 |
|
1406 <dt><i>ssid</i> (str)</dt> |
|
1407 <dd> |
|
1408 SSID of the network to connect to |
|
1409 </dd> |
|
1410 <dt><i>password</i> (str)</dt> |
|
1411 <dd> |
|
1412 password needed to authenticate |
|
1413 </dd> |
|
1414 <dt><i>hostname</i> (str)</dt> |
|
1415 <dd> |
|
1416 host name of the device |
|
1417 </dd> |
|
1418 <dt><i>country</i> (str)</dt> |
|
1419 <dd> |
|
1420 WiFi country code |
|
1421 </dd> |
|
1422 </dl> |
|
1423 <dl> |
|
1424 <dt>Return:</dt> |
|
1425 <dd> |
|
1426 tuple containing a flag indicating success and an error message |
|
1427 </dd> |
|
1428 </dl> |
|
1429 <dl> |
|
1430 <dt>Return Type:</dt> |
|
1431 <dd> |
|
1432 tuple of (bool, str) |
|
1433 </dd> |
|
1434 </dl> |
|
1435 <a NAME="RP2040Device.writeLanAutoConnect" ID="RP2040Device.writeLanAutoConnect"></a> |
|
1436 <h4>RP2040Device.writeLanAutoConnect</h4> |
|
1437 <b>writeLanAutoConnect</b>(<i>config, hostname</i>) |
|
1438 <p> |
|
1439 Public method to generate a script and associated configuration to connect the |
|
1440 device to the LAN during boot time. |
|
1441 </p> |
|
1442 |
|
1443 <dl> |
|
1444 |
|
1445 <dt><i>config</i> (str or tuple of (str, str, str, str))</dt> |
|
1446 <dd> |
|
1447 configuration for the connection (either the string 'dhcp' |
|
1448 for a dynamic address or a tuple of four strings with the IPv4 parameters. |
|
1449 </dd> |
|
1450 <dt><i>hostname</i> (str)</dt> |
|
1451 <dd> |
|
1452 host name of the device |
|
1453 </dd> |
|
1454 </dl> |
|
1455 <dl> |
|
1456 <dt>Return:</dt> |
|
1457 <dd> |
|
1458 tuple containing a flag indicating success and an error message |
|
1459 </dd> |
|
1460 </dl> |
|
1461 <dl> |
|
1462 <dt>Return Type:</dt> |
|
1463 <dd> |
|
1464 tuple of (bool, str) |
|
1465 </dd> |
|
1466 </dl> |
|
1467 <div align="right"><a href="#top">Up</a></div> |
|
1468 <hr /> |
|
1469 <hr /> |
|
1470 <a NAME="createDevice" ID="createDevice"></a> |
|
1471 <h2>createDevice</h2> |
|
1472 <b>createDevice</b>(<i>microPythonWidget, deviceType, _vid, _pid, _boardName, _serialNumber</i>) |
|
1473 <p> |
|
1474 Function to instantiate a MicroPython device object. |
|
1475 </p> |
|
1476 |
|
1477 <dl> |
|
1478 |
|
1479 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
1480 <dd> |
|
1481 reference to the main MicroPython widget |
|
1482 </dd> |
|
1483 <dt><i>deviceType</i> (str)</dt> |
|
1484 <dd> |
|
1485 device type assigned to this device interface |
|
1486 </dd> |
|
1487 <dt><i>_vid</i> (int)</dt> |
|
1488 <dd> |
|
1489 vendor ID (unused) |
|
1490 </dd> |
|
1491 <dt><i>_pid</i> (int)</dt> |
|
1492 <dd> |
|
1493 product ID (unused) |
|
1494 </dd> |
|
1495 <dt><i>_boardName</i> (str)</dt> |
|
1496 <dd> |
|
1497 name of the board (unused) |
|
1498 </dd> |
|
1499 <dt><i>_serialNumber</i> (str)</dt> |
|
1500 <dd> |
|
1501 serial number of the board (unused) |
|
1502 </dd> |
|
1503 </dl> |
|
1504 <dl> |
|
1505 <dt>Return:</dt> |
|
1506 <dd> |
|
1507 reference to the instantiated device object |
|
1508 </dd> |
|
1509 </dl> |
|
1510 <dl> |
|
1511 <dt>Return Type:</dt> |
|
1512 <dd> |
|
1513 RP2040Device |
|
1514 </dd> |
|
1515 </dl> |
|
1516 <div align="right"><a href="#top">Up</a></div> |
|
1517 <hr /> |
|
1518 </body></html> |
|