src/eric7/Documentation/Source/eric7.MicroPython.Devices.EspDevices.html

branch
mpy_network
changeset 9799
a79430a8811d
parent 9765
6378da868bb0
child 9840
d41ee69fa69b
equal deleted inserted replaced
9798:4402d76c5fa9 9799:a79430a8811d
138 <tr> 138 <tr>
139 <td><a href="#EspDevice.canStartRepl">canStartRepl</a></td> 139 <td><a href="#EspDevice.canStartRepl">canStartRepl</a></td>
140 <td>Public method to determine, if a REPL can be started.</td> 140 <td>Public method to determine, if a REPL can be started.</td>
141 </tr> 141 </tr>
142 <tr> 142 <tr>
143 <td><a href="#EspDevice.checkInternet">checkInternet</a></td>
144 <td>Public method to check, if the internet can be reached.</td>
145 </tr>
146 <tr>
147 <td><a href="#EspDevice.connectWifi">connectWifi</a></td>
148 <td>Public method to connect a device to a WiFi network.</td>
149 </tr>
150 <tr>
151 <td><a href="#EspDevice.deactivateInterface">deactivateInterface</a></td>
152 <td>Public method to deactivate a given WiFi interface of the connected device.</td>
153 </tr>
154 <tr>
143 <td><a href="#EspDevice.deviceName">deviceName</a></td> 155 <td><a href="#EspDevice.deviceName">deviceName</a></td>
144 <td>Public method to get the name of the device.</td> 156 <td>Public method to get the name of the device.</td>
145 </tr> 157 </tr>
146 <tr> 158 <tr>
159 <td><a href="#EspDevice.disconnectWifi">disconnectWifi</a></td>
160 <td>Public method to disconnect a device from the WiFi network.</td>
161 </tr>
162 <tr>
147 <td><a href="#EspDevice.forceInterrupt">forceInterrupt</a></td> 163 <td><a href="#EspDevice.forceInterrupt">forceInterrupt</a></td>
148 <td>Public method to determine the need for an interrupt when opening the serial connection.</td> 164 <td>Public method to determine the need for an interrupt when opening the serial connection.</td>
149 </tr> 165 </tr>
150 <tr> 166 <tr>
167 <td><a href="#EspDevice.getConnectedClients">getConnectedClients</a></td>
168 <td>Public method to get a list of connected clients.</td>
169 </tr>
170 <tr>
151 <td><a href="#EspDevice.getDocumentationUrl">getDocumentationUrl</a></td> 171 <td><a href="#EspDevice.getDocumentationUrl">getDocumentationUrl</a></td>
152 <td>Public method to get the device documentation URL.</td> 172 <td>Public method to get the device documentation URL.</td>
153 </tr> 173 </tr>
154 <tr> 174 <tr>
155 <td><a href="#EspDevice.getFirmwareUrl">getFirmwareUrl</a></td> 175 <td><a href="#EspDevice.getFirmwareUrl">getFirmwareUrl</a></td>
156 <td>Public method to get the device firmware download URL.</td> 176 <td>Public method to get the device firmware download URL.</td>
157 </tr> 177 </tr>
158 <tr> 178 <tr>
179 <td><a href="#EspDevice.getWifiData">getWifiData</a></td>
180 <td>Public method to get data related to the current WiFi status.</td>
181 </tr>
182 <tr>
159 <td><a href="#EspDevice.hasFlashMenuEntry">hasFlashMenuEntry</a></td> 183 <td><a href="#EspDevice.hasFlashMenuEntry">hasFlashMenuEntry</a></td>
160 <td>Public method to check, if the device has its own flash menu entry.</td> 184 <td>Public method to check, if the device has its own flash menu entry.</td>
161 </tr> 185 </tr>
162 <tr> 186 <tr>
187 <td><a href="#EspDevice.hasWifi">hasWifi</a></td>
188 <td>Public method to check the availability of WiFi.</td>
189 </tr>
190 <tr>
191 <td><a href="#EspDevice.removeCredentials">removeCredentials</a></td>
192 <td>Public method to remove the saved credentials from the connected device.</td>
193 </tr>
194 <tr>
163 <td><a href="#EspDevice.runScript">runScript</a></td> 195 <td><a href="#EspDevice.runScript">runScript</a></td>
164 <td>Public method to run the given Python script.</td> 196 <td>Public method to run the given Python script.</td>
165 </tr> 197 </tr>
166 <tr> 198 <tr>
199 <td><a href="#EspDevice.scanNetworks">scanNetworks</a></td>
200 <td>Public method to scan for available WiFi networks.</td>
201 </tr>
202 <tr>
167 <td><a href="#EspDevice.setButtons">setButtons</a></td> 203 <td><a href="#EspDevice.setButtons">setButtons</a></td>
168 <td>Public method to enable the supported action buttons.</td> 204 <td>Public method to enable the supported action buttons.</td>
205 </tr>
206 <tr>
207 <td><a href="#EspDevice.startAccessPoint">startAccessPoint</a></td>
208 <td>Public method to start the access point interface.</td>
209 </tr>
210 <tr>
211 <td><a href="#EspDevice.stopAccessPoint">stopAccessPoint</a></td>
212 <td>Public method to stop the access point interface.</td>
213 </tr>
214 <tr>
215 <td><a href="#EspDevice.writeCredentials">writeCredentials</a></td>
216 <td>Public method to write the given credentials to the connected device and modify the start script to connect automatically.</td>
169 </tr> 217 </tr>
170 </table> 218 </table>
171 <h3>Static Methods</h3> 219 <h3>Static Methods</h3>
172 220
173 <table> 221 <table>
410 <dt>Return Type:</dt> 458 <dt>Return Type:</dt>
411 <dd> 459 <dd>
412 tuple of (bool, str) 460 tuple of (bool, str)
413 </dd> 461 </dd>
414 </dl> 462 </dl>
463 <a NAME="EspDevice.checkInternet" ID="EspDevice.checkInternet"></a>
464 <h4>EspDevice.checkInternet</h4>
465 <b>checkInternet</b>(<i></i>)
466
467 <p>
468 Public method to check, if the internet can be reached.
469 </p>
470 <dl>
471 <dt>Return:</dt>
472 <dd>
473 tuple containing a flag indicating reachability and an error string
474 </dd>
475 </dl>
476 <dl>
477 <dt>Return Type:</dt>
478 <dd>
479 tuple of (bool, str)
480 </dd>
481 </dl>
482 <a NAME="EspDevice.connectWifi" ID="EspDevice.connectWifi"></a>
483 <h4>EspDevice.connectWifi</h4>
484 <b>connectWifi</b>(<i>ssid, password</i>)
485
486 <p>
487 Public method to connect a device to a WiFi network.
488 </p>
489 <dl>
490
491 <dt><i>ssid</i> (str)</dt>
492 <dd>
493 name (SSID) of the WiFi network
494 </dd>
495 <dt><i>password</i> (str)</dt>
496 <dd>
497 password needed to connect
498 </dd>
499 </dl>
500 <dl>
501 <dt>Return:</dt>
502 <dd>
503 tuple containing the connection status and an error string
504 </dd>
505 </dl>
506 <dl>
507 <dt>Return Type:</dt>
508 <dd>
509 tuple of (bool, str)
510 </dd>
511 </dl>
512 <a NAME="EspDevice.deactivateInterface" ID="EspDevice.deactivateInterface"></a>
513 <h4>EspDevice.deactivateInterface</h4>
514 <b>deactivateInterface</b>(<i>interface</i>)
515
516 <p>
517 Public method to deactivate a given WiFi interface of the connected device.
518 </p>
519 <dl>
520
521 <dt><i>interface</i> (str)</dt>
522 <dd>
523 designation of the interface to be deactivated (one of 'AP'
524 or 'STA')
525 </dd>
526 </dl>
527 <dl>
528 <dt>Return:</dt>
529 <dd>
530 tuple containg a flag indicating success and an error message
531 </dd>
532 </dl>
533 <dl>
534 <dt>Return Type:</dt>
535 <dd>
536 tuple of (bool, str)
537 </dd>
538 </dl>
539 <dl>
540
541 <dt>Raises <b>ValueError</b>:</dt>
542 <dd>
543 raised to indicate a wrong value for the interface type
544 </dd>
545 </dl>
415 <a NAME="EspDevice.deviceName" ID="EspDevice.deviceName"></a> 546 <a NAME="EspDevice.deviceName" ID="EspDevice.deviceName"></a>
416 <h4>EspDevice.deviceName</h4> 547 <h4>EspDevice.deviceName</h4>
417 <b>deviceName</b>(<i></i>) 548 <b>deviceName</b>(<i></i>)
418 549
419 <p> 550 <p>
429 <dt>Return Type:</dt> 560 <dt>Return Type:</dt>
430 <dd> 561 <dd>
431 str 562 str
432 </dd> 563 </dd>
433 </dl> 564 </dl>
565 <a NAME="EspDevice.disconnectWifi" ID="EspDevice.disconnectWifi"></a>
566 <h4>EspDevice.disconnectWifi</h4>
567 <b>disconnectWifi</b>(<i></i>)
568
569 <p>
570 Public method to disconnect a device from the WiFi network.
571 </p>
572 <dl>
573 <dt>Return:</dt>
574 <dd>
575 tuple containing a flag indicating success and an error string
576 </dd>
577 </dl>
578 <dl>
579 <dt>Return Type:</dt>
580 <dd>
581 tuple of (bool, str)
582 </dd>
583 </dl>
434 <a NAME="EspDevice.forceInterrupt" ID="EspDevice.forceInterrupt"></a> 584 <a NAME="EspDevice.forceInterrupt" ID="EspDevice.forceInterrupt"></a>
435 <h4>EspDevice.forceInterrupt</h4> 585 <h4>EspDevice.forceInterrupt</h4>
436 <b>forceInterrupt</b>(<i></i>) 586 <b>forceInterrupt</b>(<i></i>)
437 587
438 <p> 588 <p>
449 <dt>Return Type:</dt> 599 <dt>Return Type:</dt>
450 <dd> 600 <dd>
451 bool 601 bool
452 </dd> 602 </dd>
453 </dl> 603 </dl>
604 <a NAME="EspDevice.getConnectedClients" ID="EspDevice.getConnectedClients"></a>
605 <h4>EspDevice.getConnectedClients</h4>
606 <b>getConnectedClients</b>(<i></i>)
607
608 <p>
609 Public method to get a list of connected clients.
610 </p>
611 <dl>
612 <dt>Return:</dt>
613 <dd>
614 a tuple containing a list of tuples containing the client MAC-Address
615 and the RSSI (if supported and available) and an error message
616 </dd>
617 </dl>
618 <dl>
619 <dt>Return Type:</dt>
620 <dd>
621 tuple of ([(bytes, int)], str)
622 </dd>
623 </dl>
454 <a NAME="EspDevice.getDocumentationUrl" ID="EspDevice.getDocumentationUrl"></a> 624 <a NAME="EspDevice.getDocumentationUrl" ID="EspDevice.getDocumentationUrl"></a>
455 <h4>EspDevice.getDocumentationUrl</h4> 625 <h4>EspDevice.getDocumentationUrl</h4>
456 <b>getDocumentationUrl</b>(<i></i>) 626 <b>getDocumentationUrl</b>(<i></i>)
457 627
458 <p> 628 <p>
487 <dt>Return Type:</dt> 657 <dt>Return Type:</dt>
488 <dd> 658 <dd>
489 str 659 str
490 </dd> 660 </dd>
491 </dl> 661 </dl>
662 <a NAME="EspDevice.getWifiData" ID="EspDevice.getWifiData"></a>
663 <h4>EspDevice.getWifiData</h4>
664 <b>getWifiData</b>(<i></i>)
665
666 <p>
667 Public method to get data related to the current WiFi status.
668 </p>
669 <dl>
670 <dt>Return:</dt>
671 <dd>
672 tuple of three dictionaries containing the WiFi status data
673 for the WiFi client, access point and overall data
674 </dd>
675 </dl>
676 <dl>
677 <dt>Return Type:</dt>
678 <dd>
679 tuple of (dict, dict, dict)
680 </dd>
681 </dl>
682 <dl>
683
684 <dt>Raises <b>OSError</b>:</dt>
685 <dd>
686 raised to indicate an issue with the device
687 </dd>
688 </dl>
492 <a NAME="EspDevice.hasFlashMenuEntry" ID="EspDevice.hasFlashMenuEntry"></a> 689 <a NAME="EspDevice.hasFlashMenuEntry" ID="EspDevice.hasFlashMenuEntry"></a>
493 <h4>EspDevice.hasFlashMenuEntry</h4> 690 <h4>EspDevice.hasFlashMenuEntry</h4>
494 <b>hasFlashMenuEntry</b>(<i></i>) 691 <b>hasFlashMenuEntry</b>(<i></i>)
495 692
496 <p> 693 <p>
506 <dt>Return Type:</dt> 703 <dt>Return Type:</dt>
507 <dd> 704 <dd>
508 bool 705 bool
509 </dd> 706 </dd>
510 </dl> 707 </dl>
708 <a NAME="EspDevice.hasWifi" ID="EspDevice.hasWifi"></a>
709 <h4>EspDevice.hasWifi</h4>
710 <b>hasWifi</b>(<i></i>)
711
712 <p>
713 Public method to check the availability of WiFi.
714 </p>
715 <dl>
716 <dt>Return:</dt>
717 <dd>
718 tuple containing a flag indicating the availability of WiFi
719 and the WiFi type (esp32)
720 </dd>
721 </dl>
722 <dl>
723 <dt>Return Type:</dt>
724 <dd>
725 tuple of (bool, str)
726 </dd>
727 </dl>
728 <a NAME="EspDevice.removeCredentials" ID="EspDevice.removeCredentials"></a>
729 <h4>EspDevice.removeCredentials</h4>
730 <b>removeCredentials</b>(<i></i>)
731
732 <p>
733 Public method to remove the saved credentials from the connected device.
734 </p>
735 <dl>
736 <dt>Return:</dt>
737 <dd>
738 tuple containing a flag indicating success and an error message
739 </dd>
740 </dl>
741 <dl>
742 <dt>Return Type:</dt>
743 <dd>
744 tuple of (bool, str)
745 </dd>
746 </dl>
511 <a NAME="EspDevice.runScript" ID="EspDevice.runScript"></a> 747 <a NAME="EspDevice.runScript" ID="EspDevice.runScript"></a>
512 <h4>EspDevice.runScript</h4> 748 <h4>EspDevice.runScript</h4>
513 <b>runScript</b>(<i>script</i>) 749 <b>runScript</b>(<i>script</i>)
514 750
515 <p> 751 <p>
520 <dt><i>script</i> (str)</dt> 756 <dt><i>script</i> (str)</dt>
521 <dd> 757 <dd>
522 script to be executed 758 script to be executed
523 </dd> 759 </dd>
524 </dl> 760 </dl>
761 <a NAME="EspDevice.scanNetworks" ID="EspDevice.scanNetworks"></a>
762 <h4>EspDevice.scanNetworks</h4>
763 <b>scanNetworks</b>(<i></i>)
764
765 <p>
766 Public method to scan for available WiFi networks.
767 </p>
768 <dl>
769 <dt>Return:</dt>
770 <dd>
771 tuple containing the list of available networks as a tuple of 'Name',
772 'MAC-Address', 'channel', 'RSSI' and 'security' and an error string
773 </dd>
774 </dl>
775 <dl>
776 <dt>Return Type:</dt>
777 <dd>
778 tuple of (list of tuple of (str, str, int, int, str), str)
779 </dd>
780 </dl>
525 <a NAME="EspDevice.setButtons" ID="EspDevice.setButtons"></a> 781 <a NAME="EspDevice.setButtons" ID="EspDevice.setButtons"></a>
526 <h4>EspDevice.setButtons</h4> 782 <h4>EspDevice.setButtons</h4>
527 <b>setButtons</b>(<i></i>) 783 <b>setButtons</b>(<i></i>)
528 784
529 <p> 785 <p>
530 Public method to enable the supported action buttons. 786 Public method to enable the supported action buttons.
531 </p> 787 </p>
788 <a NAME="EspDevice.startAccessPoint" ID="EspDevice.startAccessPoint"></a>
789 <h4>EspDevice.startAccessPoint</h4>
790 <b>startAccessPoint</b>(<i>ssid, security=None, password=None, ifconfig=None</i>)
791
792 <p>
793 Public method to start the access point interface.
794 </p>
795 <dl>
796
797 <dt><i>ssid</i> (str)</dt>
798 <dd>
799 SSID of the access point
800 </dd>
801 <dt><i>security</i> (int (optional))</dt>
802 <dd>
803 security method (defaults to None)
804 </dd>
805 <dt><i>password</i> (str (optional))</dt>
806 <dd>
807 password (defaults to None)
808 </dd>
809 <dt><i>ifconfig</i> (tuple of (str, str, str, str))</dt>
810 <dd>
811 IPv4 configuration for the access point if not default
812 (IPv4 address, netmask, gateway address, DNS server address)
813 </dd>
814 </dl>
815 <dl>
816 <dt>Return:</dt>
817 <dd>
818 tuple containing a flag indicating success and an error message
819 </dd>
820 </dl>
821 <dl>
822 <dt>Return Type:</dt>
823 <dd>
824 tuple of (bool, str)
825 </dd>
826 </dl>
827 <a NAME="EspDevice.stopAccessPoint" ID="EspDevice.stopAccessPoint"></a>
828 <h4>EspDevice.stopAccessPoint</h4>
829 <b>stopAccessPoint</b>(<i></i>)
830
831 <p>
832 Public method to stop the access point interface.
833 </p>
834 <dl>
835 <dt>Return:</dt>
836 <dd>
837 tuple containg a flag indicating success and an error message
838 </dd>
839 </dl>
840 <dl>
841 <dt>Return Type:</dt>
842 <dd>
843 tuple of (bool, str)
844 </dd>
845 </dl>
846 <a NAME="EspDevice.writeCredentials" ID="EspDevice.writeCredentials"></a>
847 <h4>EspDevice.writeCredentials</h4>
848 <b>writeCredentials</b>(<i>ssid, password</i>)
849
850 <p>
851 Public method to write the given credentials to the connected device and modify
852 the start script to connect automatically.
853 </p>
854 <dl>
855
856 <dt><i>ssid</i> (str)</dt>
857 <dd>
858 SSID of the network to connect to
859 </dd>
860 <dt><i>password</i> (str)</dt>
861 <dd>
862 password needed to authenticate
863 </dd>
864 </dl>
865 <dl>
866 <dt>Return:</dt>
867 <dd>
868 tuple containing a flag indicating success and an error message
869 </dd>
870 </dl>
871 <dl>
872 <dt>Return Type:</dt>
873 <dd>
874 tuple of (bool, str)
875 </dd>
876 </dl>
532 <div align="right"><a href="#top">Up</a></div> 877 <div align="right"><a href="#top">Up</a></div>
533 <hr /> 878 <hr />
534 <hr /> 879 <hr />
535 <a NAME="createDevice" ID="createDevice"></a> 880 <a NAME="createDevice" ID="createDevice"></a>
536 <h2>createDevice</h2> 881 <h2>createDevice</h2>

eric ide

mercurial