issue174:micro-ci_micro-la
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue174:micro-ci_micro-la [2021/10/31 18:28] – créée auntiee | issue174:micro-ci_micro-la [2021/11/04 09:39] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Sometimes, when you update your microcontroller with a new version of MicroPython, | + | **Sometimes, when you update your microcontroller with a new version of MicroPython, |
I found a neat utility called mpfshell that can make your life a whole lot easier. You can find their repository at https:// | I found a neat utility called mpfshell that can make your life a whole lot easier. You can find their repository at https:// | ||
- | According to the repository main page, the utility is “A simple shell based file explorer for ESP8266 and WiPy Micropython based devices.” Just so you know, mpfshell works on more than just the ESP8266 and the WiPy. I’ve tested it on the ESP8266, the ESP32, and the Raspberry Pi Pico, and it works just fine on all three devices. For complete transparency, | + | According to the repository main page, the utility is “A simple shell based file explorer for ESP8266 and WiPy Micropython based devices.” Just so you know, mpfshell works on more than just the ESP8266 and the WiPy. I’ve tested it on the ESP8266, the ESP32, and the Raspberry Pi Pico, and it works just fine on all three devices. For complete transparency, |
- | Of course, you need to install the program to be able to use it, which is easy since it is on PyPi. In a terminal, you need to use only pip. On your main machine, open a terminal and type | + | Parfois, lorsque vous mettez à jour votre microcontrôleur avec une nouvelle version de MicroPython, |
+ | |||
+ | J'ai trouvé un utilitaire appelé mpfshell qui peut vous rendre la vie beaucoup plus facile. Vous pouvez trouver son dépôt à l' | ||
+ | |||
+ | Selon la page principale du dépôt, l' | ||
+ | |||
+ | **Of course, you need to install the program to be able to use it, which is easy since it is on PyPi. In a terminal, you need to use only pip. On your main machine, open a terminal and type | ||
$ pip install mpfshell | $ pip install mpfshell | ||
Ligne 24: | Ligne 30: | ||
-- Running on Python 3.7 using PySerial 3.4 -- | -- Running on Python 3.7 using PySerial 3.4 -- | ||
- | mpfs [/ | + | mpfs [/ |
+ | |||
+ | Bien sûr, vous devez installer le programme pour pouvoir l' | ||
+ | |||
+ | $ pip install mpfshell | ||
+ | |||
+ | Vous pouvez également télécharger le dépôt complet et l' | ||
+ | |||
+ | Une fois installé, ouvrez un terminal dans le dossier où vous souhaitez copier les fichiers de l' | ||
+ | |||
+ | Avant de commencer, vous devez savoir à quel port série votre appareil est connecté (voir ci-dessus). | ||
+ | |||
+ | Habituellement, | ||
+ | |||
+ | Maintenant, il suffit de lancer le programme : | ||
+ | |||
+ | $ mpfshell | ||
+ | |||
+ | ** Micropython File Shell v1.1.2, sw@kaltpost.de & junhuanchen@qq.com & lht856@foxmail.com ** | ||
+ | -- Exécuté sur Python 3.7 en utilisant PySerial 3.4 -- | ||
+ | |||
+ | mpfs [/]> ** | ||
- | Next, you have to tell mpfshell to connect to the device on the correct serial port with the open {port} command. I’ve seen this just seems to lock up sometimes. If that happens just do a < | + | **Next, you have to tell mpfshell to connect to the device on the correct serial port with the open {port} command. I’ve seen this just seems to lock up sometimes. If that happens just do a < |
mpfs [/]> open / | mpfs [/]> open / | ||
Ligne 46: | Ligne 74: | ||
mpfs [/]> | mpfs [/]> | ||
- | Of course, the files on your Microcontoller will be different from what’s on mine, but you get the idea. | + | Of course, the files on your Microcontoller will be different from what’s on mine, but you get the idea.** |
- | Now, let’s do a complete copy from the ESP32 (or whatever your Microcontroller is) to the computer’s hard drive. To do this, you need to use the mget command. However, you need to use a special command. The command is mget .*\.py . You might recognize that this command uses a regular expression (regex) to get all files. | + | Ensuite, vous devez dire à mpfshell de se connecter au périphérique sur le bon port série avec la commande open {port}. J'ai vu que cela semble se bloquer parfois. Si cela arrive, faites simplement un < |
+ | |||
+ | mpfs [/]> open / | ||
+ | Connected to esp32 | ||
+ | mpfs [/]> | ||
+ | |||
+ | Remarquez que mpfshell vous indique le type de périphérique auquel vous êtes connecté. Cela peut être très utile si vous avez plusieurs périphériques connectés. Maintenant que vous êtes connecté à votre microcontrôleur, | ||
+ | |||
+ | mpfs [/]> ls | ||
+ | Remote files in '/': | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | rnerd_ssd1306_esp32_graphics1.py | ||
+ | | ||
+ | mpfs [/]> | ||
+ | |||
+ | Bien sûr, les fichiers sur votre microcontrôleur seront différents de ceux qui se trouvent sur le mien, mais vous avez compris l' | ||
+ | |||
+ | **Now, let’s do a complete copy from the ESP32 (or whatever your Microcontroller is) to the computer’s hard drive. To do this, you need to use the mget command. However, you need to use a special command. The command is mget .*\.py . You might recognize that this command uses a regular expression (regex) to get all files. | ||
mpfs [/]> mget .*\.py | mpfs [/]> mget .*\.py | ||
Ligne 72: | Ligne 122: | ||
* put esp32i2cscan.py | * put esp32i2cscan.py | ||
* put .python-version | * put .python-version | ||
+ | * put gfx.py | ||
+ | mpfs [/]> ** | ||
+ | |||
+ | Maintenant, faisons une copie complète de l' | ||
+ | |||
+ | mpfs [/]> mget .*\.py | ||
+ | * get boot.py | ||
+ | * get esp32i2cscan.py | ||
+ | * get gfx.py | ||
+ | * get image1.py | ||
+ | * get image2.py | ||
+ | * get rnerd_ssd1306_esp32.py | ||
+ | * get rnerd_ssd1306_esp32_graphics1.py | ||
+ | * get ssd1306.py | ||
+ | mpfs [/ | ||
+ | |||
+ | Pour effectuer une copie en masse de votre ordinateur vers le microcontrôleur, | ||
+ | |||
+ | mpfs [/]> mput .*\.py | ||
+ | * put ssd1306.py | ||
+ | * put boot.py | ||
+ | * put image2.py | ||
+ | * put rnerd_ssd1306_esp32_graphics1.py | ||
+ | * put rnerd_ssd1306_esp32.py | ||
+ | * put image1.py | ||
+ | * mettre esp32i2cscan.py | ||
+ | * put esp32i2cscan.py | ||
* put gfx.py | * put gfx.py | ||
mpfs [/ | mpfs [/ | ||
- | You can copy a single file by just using the get or put command. | + | **You can copy a single file by just using the get or put command. |
mpfs [/]> get boot.py | mpfs [/]> get boot.py | ||
Ligne 92: | Ligne 169: | ||
cd exec lcd | cd exec lcd | ||
- | mpfs [/ | + | mpfs [/ |
+ | |||
+ | Vous pouvez copier un seul fichier en utilisant tout simplement les commandes get ou put. | ||
+ | |||
+ | mpfs [/]> get boot.py | ||
+ | mpfs [/]> put boot.py | ||
+ | | ||
+ | mpfs [/]> | ||
+ | |||
+ | Si, à un moment donné, vous ne vous souvenez plus de la commande que vous devez utiliser, tapez simplement help. | ||
+ | |||
+ | mpfs [/]> help | ||
+ | |||
+ | Documented commands (type help < | ||
+ | ======================================== | ||
+ | EOF close execfile | ||
+ | cat ef | ||
+ | cd exec lcd | ||
+ | |||
+ | mpfs [/]> | ||
- | You can also get help on any of the commands... | + | **You can also get help on any of the commands... |
mpfs [/]> help mget | mpfs [/]> help mget | ||
Ligne 111: | Ligne 208: | ||
I sincerely hope that you find this utility as helpful as I do. | I sincerely hope that you find this utility as helpful as I do. | ||
- | Until next time, as always; stay safe, healthy, positive and creative! | + | Until next time, as always; stay safe, healthy, positive and creative!** |
+ | |||
+ | Vous pouvez également obtenir de l'aide sur n' | ||
+ | |||
+ | mpfs [/]> help mget | ||
+ | mget < | ||
+ | Download all remote files that match the given regular expression. | ||
+ | The local files will be named the same as the remote files. | ||
+ | " | ||
+ | # | ||
+ | #Les fichiers locaux seront nommés de la même manière que les fichiers distants. | ||
+ | #« mget » ne récupère pas les répertoires, | ||
+ | |||
+ | mpfs [/]> | ||
+ | |||
+ | Et pour quitter mpfshell, tapez simplement quit. | ||
+ | |||
+ | mpfs [/]> quit | ||
+ | greg@earth : $ | ||
+ | |||
+ | J' | ||
+ | |||
+ | Jusqu' |
issue174/micro-ci_micro-la.1635701336.txt.gz · Dernière modification : 2021/10/31 18:28 de auntiee