Hack-wipy-repl

De MCHobby - Wiki
Révision datée du 22 mai 2016 à 18:26 par Admin (discussion | contributions) (Page créée avec « {{WIPY-NAV}} {{traduction}} == Obtenir une ligne de commande REPL == REPL stands for Read Evaluate Print Loop, and is the name given to the interactive MicroPython promp... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Obtenir une ligne de commande REPL

REPL stands for Read Evaluate Print Loop, and is the name given to the interactive MicroPython prompt that you can access on the WiPy. Using the REPL is by far the easiest way to test out your code and run commands. You can use the REPL in addition to writing scripts in main.py.

To use the REPL, you must connect to the WiPy either via [[|telnet], or with a USB to serial converter wired to one of the two UARTs on the WiPy. To enable REPL duplication on UART0 (the one accessible via the expansion board) do:

>>> from machine import UART
>>> import os
>>> uart = UART(0, 115200)
>>> os.dupterm(uart)

Place this piece of code inside your boot.py so that it’s done automatically after reset.

Avec Windows

First you need to install the FTDI drivers for the expansion board’s USB to serial converter. Then you need a terminal software. The best option is to download the free program PuTTY: putty.exe.

In order to get to the telnet REPL:

Using putty, select Telnet as connection type, leave the default port (23) and enter the IP address of your WiPy (192.168.1.1 when in WLAN.AP mode), then click open.

In order to get to the REPL UART:

Using your serial program you must connect to the COM port that you found in the previous step. With PuTTY, click on “Session” in the left-hand panel, then click the “Serial” radio button on the right, then enter you COM port (eg COM4) in the “Serial Line” box. Finally, click the “Open” button.


Tutoriel WiPy tutorials and examples & general information about WiPy sous copyright de Damien George et contributeurs en ce qui concerne MicroPython et/ou PyCom en ce qui concerne les informations relatives a WiPy et LoPy.

Tutoriel traduit par Meurisse D. pour MCHobby.be

Traduit avec l'autorisation de micropython.org - Translated with the authorisation of micropython.org également avec l'accord de Daniel Compara (créateur de WiPy).

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.