#0-ESP32-MicroPython
Explore tagged Tumblr posts
Text
ESP32-S3-Matrix von Waveshare: Kompaktes Board mit 8x8 RGB-LED-Matrix im Test

Das kleine ESP32-S3-Matrix Board von Waveshare kombiniert moderne Mikrocontroller-Technik mit einer integrierten 8x8 RGB-LED-Matrix – ideal für kreative LED-Projekte, coole Animationen oder einfache Pixelspiele. In diesem Beitrag zeige ich dir, was mit diesem kompakten Board alles möglich ist. https://youtu.be/RxWwx_eNJn8 Du erfährst, wie du das Board schnell in Betrieb nimmst und programmierst – wahlweise über die Arduino IDE oder mit Visual Studio Code. Danach wird’s praktisch: Wir erstellen gemeinsam verschiedene Lichteffekte und Animationen auf der integrierten LED-Matrix. So bekommst du nicht nur einen Eindruck von der Vielseitigkeit des Boards, sondern auch direkt Inspiration für eigene Projekte.
Technische Daten des ESP32-S3-Matrix von Waveshare
Hier zunächst die technischen Daten des Boards: EigenschaftDetailsMikrocontrollerESP32-S3 mit Xtensa® 32-bit LX7 Dual-Core ProzessorTaktfrequenzBis zu 240 MHzArbeitsspeicher (RAM)512 KB SRAMROM384 KBRTC-SRAM16 KBFlash-Speicher4 MBFunkverbindungen2.4 GHz WiFi, Bluetooth Low Energy (BLE)AnschlussUSB Type-CGPIO-Pins20 digitale Ein-/Ausgänge (über Pinheader)Anzeigeeinheit8x8 RGB-LED-Matrix (64 LEDs insgesamt)BesonderheitenNiedriger Energieverbrauch, integrierte Antenne, hohe RF-LeistungHinweis zur LED-MatrixHelligkeit nicht zu hoch einstellen – Hitzeentwicklung kann das Board schädigen
ESP32-S3 Chip auf dem ESP32-S3-Matrix Board von Waveshare
Bezug des Mikrocontrollers
Du bekommst diesen Mikrocontroller auf eBay.de bereits ab ca. 8 € zzgl. Versandkosten*. Wenn du etwas sparen möchtest und etwas Geduld mitbringst, lohnt sich ein Blick auf AliExpress.com – dort ist das Board bereits ab rund 6 € zzgl. Versand erhältlich. Hinweis von mir: Die mit einem Sternchen (*) markierten Links sind Affiliate-Links. Wenn du über diese Links einkaufst, erhalte ich eine kleine Provision, die dazu beiträgt, diesen Blog zu unterstützen. Der Preis für dich bleibt dabei unverändert. Vielen Dank für deine Unterstützung! Lieferumfang Der Mikrocontroller wird in einer kleinen antistatischen Tüte geliefert ohne Pinleisten. Du musst dir somit noch zusätzlich eine 2,54mm Stiftleisten* besorgen. Diese Stiftleisten gibt es ebenso recht günstig auf Aliexpress oder ebay.de.
Pinout & Aufbau des Mikrocontrollers
Nachfolgend siehst du das Pinout des Mikrocontrollers. Besonders positiv fällt auf, dass es einen deutlich gekennzeichneten 5V-Pin gibt – das ist bei Mikrocontrollern der ESP32-Familie eher selten.
Pinout - ESP32-S3 Matrix Abgesehen davon sind nahezu alle GPIOs vielseitig nutzbar: Sie unterstützen UART, PWM, I2S, ADC, I2C und SPI-Kommunikation. Zusätzlich ermöglichen die beiden Pins unten rechts, TX und RX, die serielle Kommunikation mit anderen Geräten – etwa für Debugging-Zwecke oder die Anbindung externer Module. Aufbau der RGB LED Matrix Die RGB-LED-Matrix auf dem ESP32-S3-Matrix Board ist fest verlötet und folgt einem 8x8-Raster, also 64 einzeln adressierbaren LEDs. Standardmäßig ist die Matrix intern mit GPIO 14 des Mikrocontrollers verbunden – diesen Pin müssen wir auch in unserem Sketch angeben, um die LEDs korrekt anzusteuern. Die erste LED (Index 0) befindet sich dabei oben links, direkt neben dem USB-Anschluss, in der ersten Zeile. Von dort aus verläuft die Adressierung zeilenweise nach rechts, also in sogenannter „serienmäßiger Reihenfolge“ (row-major order). Das ist wichtig zu wissen, wenn man später eigene Muster oder Animationen umsetzen möchte.
Programmierung des Boards ESP32-S3-Matrix
In der offiziellen englischen Dokumentation zum Board von Waveshare wird dir erläutert wie du dieses Board in der Arduino IDE, Visual Studio Code, Espressif IDF sowie MicroPython programmierst. Ich möchte dir nachfolgend meinen Weg aufzeigen wie ich diesen in der Arduino IDE zum laufen gebracht und programmiert habe. Achtung: Helligkeit nicht zu hoch einstellen Ein wichtiger, aber leicht zu übersehender Hinweis findet sich in einem der Beispielsketches von Waveshare: Die Helligkeit der RGB-LED-Matrix sollte nicht zu hoch eingestellt werden, da sich das Board sonst stark erwärmen kann. Durch die kompakte Bauweise und die hohe Leistungsaufnahme der LEDs besteht die Gefahr, dass sich die Temperatur schnell erhöht – was auf Dauer zu einer Beschädigung der Platine führen kann. Programmieren in der Arduino IDE Die Entwicklungsumgebung Arduino IDE ist für die Mikrocontroller der Arduino-Familie (wie der Name es erahnen lässt) ausgelegt. Damit wir den Mikrocontroller mit dem ESP32-S3 Chip programmieren können, müssen wir zunächst den Boardtreiber installieren. Installieren des Boardtreibers für Espressif Chips Im ersten Schritt öffnen wir die Einstellungen – entweder über das Hauptmenü Datei > Einstellungen oder mit der Tastenkombination Strg + , (Komma).
In den Einstellungen klicken wir auf die in der zweiten Grafik markierte Schaltfläche (2), um den Dialog „Zusätzliche Boardverwalter-URLs“ zu öffnen. Dort fügen wir die folgende URL ein und bestätigen mit OK: https://espressif.github.io/arduino-esp32/package_esp32_index.json Sobald dieser Schritt abgeschlossen ist, kannst du den Boardverwalter über das linke Menü (6) öffnen und dort nach „esp32“ suchen (7). In der Ergebnisliste sollte der Eintrag „esp32 von Espressif Systems“ erscheinen. Wähle dort die Schaltfläche „INSTALLIEREN“ (8), um die Boarddefinitionen zu installieren.
Die Installation kann etwas Zeit in Anspruch nehmen, da es zahlreiche Varianten des ESP32 gibt und alle benötigten Treiber von einem eher langsamen Server heruntergeladen werden. Bei mir hat der Vorgang rund 5 Minuten gedauert. Den Fortschritt der Installation kannst du im Fenster „Ausgabe“ mitverfolgen. Damit sind die benötigten Boardtreiber installiert. Du findest nun unter Werkzeuge > Board > esp32 eine große Auswahl an ESP32-Boards. Für das hier verwendete Board wählen wir den Eintrag „ESP32-S3 Dev Module“ aus.
Programmieren der 8x8 RGB Matrix mit der Adafruit NeoPixel Bibliothek Wie man eine RGB-LED vom Typ WS2812B am Mikrocontroller ansteuert, habe ich bereits in mehreren Beiträgen gezeigt. Besonders einfach gelingt das mit der Adafruit NeoPixel Bibliothek, die ich auch in diesem Beispiel wiederverwende. - RGB Beleuchtung einfach steuern: NeoPixel Ring mit Arduino - Arduino Lektion 31: 12bit RGB NeoPixel Ring - LED-Würfel: Zufallszahlen auf der Pixelmatrix darstellen Du kannst die Bibliothek ganz bequem über den Bibliotheksverwalter der Arduino IDE installieren – inklusive aller nötigen Abhängigkeiten (engl. dependencies). Suche dazu einfach nach „Adafruit NeoPixel“ und klicke auf Installieren. Hilfsfunktion zum ansteuern einer LED via X & Y Koordinate Um eine einzelne LED auf der Pixelmatrix anzusteuern, benötigen wir ihren Index im Array. Dieser beginnt oben links bei 0 und endet unten rechts bei 63. Das direkte Arbeiten mit diesen eindimensionalen Indizes kann beim Zeichnen von Figuren jedoch schnell unübersichtlich und fehleranfällig werden. Deshalb habe ich mir eine kleine Hilfsfunktion erstellt, mit der man stattdessen über X- und Y-Koordinaten arbeiten kann. Dabei steht X für die Spalte und Y für die Zeile, was dem gewohnten Koordinatensystem entspricht. So lässt sich die Positionierung einzelner Pixel deutlich klarer und intuitiver gestalten, besonders beim Aufbau grafischer Muster in einem zweidimensionalen Array. // Gerade Verdrahtung: Zeile für Zeile von links nach rechts uint16_t xy(uint8_t x, uint8_t y) { // Die LED-Matrix ist 8 Spalten (x) breit und 8 Zeilen (y) hoch. // Die LEDs sind zeilenweise verdrahtet – also: // erste Zeile von links nach rechts (x = 0 bis 7), // dann zweite Zeile direkt danach, usw. // Um die Position (x, y) auf den eindimensionalen LED-Array-Index (0–63) zu berechnen, // multiplizieren wir die Zeilennummer mit 8 (Anzahl Spalten), um den Zeilen-Offset zu bekommen: // y * 8 = Startposition dieser Zeile im Array // Dann addieren wir die Spaltennummer x hinzu: // So ergibt sich die konkrete LED-Nummer in der 1D-LED-Liste return y * 8 + x; // Beispiel: // x = 3, y = 2 → 2. Zeile = Offset 16 → Index = 16 + 3 = 19 // Das bedeutet: Pixel an Spalte 3, Zeile 2 → LED Nr. Read the full article
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the��CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
1 note
·
View note
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
1 note
·
View note
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
ESP32: Zurück von MicroPython zur Arduino IDE in nur einem Schritt

Der ESP32 ist ein vielseitiger Mikrocontroller, der sich flexibel mit verschiedenen Umgebungen programmieren lässt – darunter MicroPython, CircuitPython, LuatOS und mehr. Wenn du deinen ESP32 nach dem Flashen mit einer dieser Firmwares wieder in der Arduino IDE programmieren möchtest, zeige ich dir hier, wie du in wenigen Schritten den gesamten Speicher überschreibst und so den Wechsel einfach machst. https://youtu.be/wlYsI5ma7Qo In diesem Beitrag verwende ich einen ESP32-WROOM-32, der standardmäßig bereits für die Programmierung in der Arduino IDE vorbereitet ist. Für ein kleines Projekt habe ich ihn zunächst mit der aktuellen MicroPython-Firmware geflasht. Jetzt möchte ich wieder zur Arduino IDE wechseln – und das geht erfreulich einfach.

Mikrocontroller - ESP32 WROOM 32 Für diesen Wechsel benötigst du lediglich die Arduino IDE – entweder die klassische Version oder die neue 2.x-Version. Zuerst installieren wir den passenden Boardtreiber und wählen dann unter Werkzeuge > Board > ESP32 das richtige Modell aus. Danach legen wir den Port fest und können direkt das angezeigte leere Programm auf den ESP32 hochladen. Zusätzliche Bordverwalter URL für den Boardtreiber: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json Alternativ kannst du auch dieses einfache Programm verwenden: Es lässt die interne LED des ESP32 alle 0,5 Sekunden blinken und gibt gleichzeitig die Nachricht „Hallo, aus der Arduino IDE“ auf der seriellen Schnittstelle aus. // interne LED des ESP32 mit dem GPIO02 verbunden #define led 2 void setup() { //beginn der seriellen Kommunikation mit 115200 baud Serial.begin(115200); //Pin der LED als Ausgang definieren pinMode(led, OUTPUT); //Ausgabe des Textes auf der seriellen Schnittstelle Serial.println("Hallo, aus der Arduino IDE"); } void loop() { //aktivieren der LED digitalWrite(led, HIGH); //eine kleine Pause von 0,5 Sekunden delay(500); //deaktivieren der LED digitalWrite(led, LOW); //eine kleine Pause von 0,5 Sekunden delay(500); } Die Ausgabe auf der seriellen Schnittstelle sollte wie folgt sein: Hallo, aus der Arduino IDE Wenn du den Mikrocontroller über die RESET- oder BOOT-Taste neu startest, kann es vorkommen, dass zusätzliche Ausgaben erscheinen – diese stammen vom Mikrocontroller selbst. Um dies zu vermeiden, kannst du die Baudrate in der seriellen Konsole beispielsweise auf 9600 setzen; so sollte diese Meldung nicht mehr angezeigt werden. ets Jul 29 2019 12:21:46 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0030,len:4832 load:0x40078000,len:16460 load:0x40080400,len:4 load:0x40080404,len:3504 entry 0x400805cc
Fazit - von MicroPython zur Arduino IDE am ESP32
Mit wenigen, einfachen Schritten lässt sich der ESP32 von MicroPython zurück auf die Arduino IDE umstellen. So bleibt der Mikrocontroller flexibel für verschiedene Projekte und Entwicklungsumgebungen einsetzbar. Diese Anleitung zeigt dir, wie der Wechsel gelingt und stellt sicher, dass du schnell und ohne Umwege zwischen den Programmiertools wechseln kannst. Read the full article
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes
Text
Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266
This posts exhibits easy methods to flash MicroPython firmware on ESP32/ESP8266 boards utilizing the esptool.py. It really works on Home windows, Mac OS X, and Linux. For the official documentation, you possibly can go to the esptool.py GitHub web page.
Tip: for a neater technique to flash the ESP32/ESP8266 with MicroPython, we advocate studying this information to flash MicroPython with uPyCraft IDE. Nevertheless, we’ve just lately acquired feedback from our readers about having hassle putting in/utilizing uPyCraft IDE. For that cause, we’re posting an alternate technique utilizing the esptool.py software program.
Putting in esptool.py in your pc
To work with esptool.py, you’ll want both Python 2.7, Python three.Four or a more moderen Python set up on your system. We advocate utilizing Python three.7.X, so go to Python’s web site and set up it in your pc.
With Python three put in, open a Terminal window and set up the newest secure esptool.py launch with pip:
pip set up esptool
Observe: with some Python installations that command might not work and you’ll obtain an error. If that’s the case, attempt to set up esptool.py with:
pip3 set up esptool
python -m pip set up esptool
pip2 set up esptool
After putting in, you’ll have esptool.py put in into the default Python executables listing and you must have the ability to run it with the command esptool.py. In your Terminal window, run the next command:
esptool.py
If it was put in correctly, it ought to show an identical message (no matter your working system):
With esptool.py put in in your pc, you’ll be able to simply flash your ESP32 or ESP8266 boards with the MicroPython firmware. This publish is split in two elements, learn Half 1 or Half 2 relying on your board:
Half 1 – ESP32
Half 2 – ESP8266
Word: after putting in MicroPython firmware on your ESP32 or ESP8266, you possibly can return and use Arduino IDE once more. You simply have to add code utilizing Arduino IDE. Then, if you wish to use MicroPython once more, you must flash MicroPython firmware.
[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32
To obtain the newest model of MicroPython firmware for the ESP32, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP32 part.
You need to see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP32 .bin file – for instance: esp32-20181007-v1.9.Four-631-g338635ccc.bin.
Word: should you’re utilizing a unique board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the correct firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP32 serial port identify (in our case it’s COM7)
Shut your Arduino IDE software program
Essential: for those who plug your ESP32 board to your pc, however you possibly can’t discover the ESP32 Port out there in your Arduino IDE, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. For those who don’t see your ESP’s COM port out there, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP32 DEVKIT V1 DOIT board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you must see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you possibly can’t see your gadget, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP32. Utilizing a a correct USB cable ought to clear up your drawback.
Discovering your MicroPython .bin file
After downloading the ESP32 .bin file, it must be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Record all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP32 .bin file is situated within the Downloads folder: esp32-20190113-v1.9.Four-779-g5064df207.bin.
Erasing ESP32 Flash Reminiscence
Earlier than flashing the MicroPython firmware, it is advisable to erase the ESP32 flash reminiscence. So, with your ESP32 related to your pc, hold-down the “BOOT/FLASH” button in your ESP32 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP32 flash reminiscence:
esptool.py –chip esp32 erase_flash
When the “Erasing” course of begins, you’ll be able to launch the “BOOT/FLASH” button. After a couple of seconds, the ESP32 flash reminiscence will probably be erased.
Word: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP32 shouldn’t be in flashing mode. It’s essential repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP32 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP32 with esptool.py
Together with your ESP32 flash reminiscence erased, you possibly can lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP32 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp32 –port <serial_port> write_flash -z 0x1000 <esp32-X.bin>
In our case, the ultimate command seems like this:
esptool.py –chip esp32 –port COM7 write_flash -z 0x1000 esp32-20190113-v1.9.Four-779-g5064df207.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a number of seconds that is what it is best to see:
Your ESP32 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP32 “BOOT/FLASH” button.
[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266
To obtain the newest model of MicroPython firmware for the ESP8266, go to the MicroPython Downloads web page and scroll all the best way right down to the ESP8266 part.
You must see an analogous net web page (see determine under) with the newest hyperlink to obtain the ESP8266 .bin file – for instance: esp8266-20180511-v1.9.Four.bin.
Observe: in case you’re utilizing a special board (like a PyBoard, WiPy, or different), go to MicroPython Downloads web page and obtain the proper firmware on your board.
Discovering the Serial Port Identify
It’s a bit totally different to seek out the Serial port identify in every working system, so for simplicity causes we advocate discovering your ESP serial port identify via the Arduino IDE. Comply with these steps:
Join your board to your pc
Open the Arduino IDE
Go to Instruments > Port
Save your ESP8266 serial port identify (in our case it’s COM4)
Shut your Arduino IDE software program
Necessary: when you plug your ESP8266 board to your pc, however you’ll be able to’t discover the ESP8266 Port out there in your Arduino, it may be certainly one of these two issues: 1. USB drivers lacking or 2. USB cable with out knowledge wires.
1. Should you don’t see your ESP’s COM port obtainable, this typically means you don’t have the USB drivers put in. Take a better take a look at the chip subsequent to the voltage regulator on board and examine its identify.
The ESP8266 ESP-12E NodeMCU board makes use of the CP2102 chip.
Go to Google and seek for your particular chip to seek out the drivers and set up them in your working system.
You possibly can obtain the CP2102 drivers on the Silicon Labs web site.
After they’re put in, restart the Arduino IDE and you need to see the serial port within the Instruments > Port menu.
2. When you’ve got the drivers put in, however you’ll be able to’t see your system, double-check that you simply’re utilizing a USB cable with knowledge wires.
USB cables from powerbanks typically don’t have knowledge wires (they’re cost solely). So, your pc won’t ever set up a serial communication with your ESP8266. Utilizing a a correct USB cable ought to remedy your drawback.
Discovering your MicroPython .bin file
After downloading the ESP8266 .bin file, it ought to be in your Downloads folder. So, with your Terminal window, you’ll have to navigate to the Downloads folder utilizing the cd command:
cd Downloads
Listing all information in your Downloads folder to make sure that’s the place the .bin file is situated. In Home windows, you employ:
dir
On Mac OS X or Linux, run the subsequent command:
ls
As you’ll be able to see within the previous screenshot, the ESP8266 .bin file is situated within the Downloads folder: esp8266-20180511-v1.9.Four.bin.
Erasing ESP8266 Flash Reminiscence
Earlier than flashing the MicroPython firmware, you’ll want to erase the ESP8266 flash reminiscence. So, with your ESP8266 related to your pc, hold-down the “BOOT/FLASH” button in your ESP8266 board:
Whereas holding down the “BOOT/FLASH” button, run the next command to erase the ESP8266 flash reminiscence:
esptool.py –chip esp8266 erase_flash
When the “Erasing” course of begins, you possibly can launch the “BOOT/FLASH” button. After a couple of seconds, the ESP8266 flash reminiscence shall be erased.
Notice: if after the “Connecting …” message you retain seeing new dots showing, it signifies that your ESP8266 is just not in flashing mode. You could repeat all of the steps described earlier and maintain the “BOOT/FLASH” button once more to make sure that your ESP8266 goes into flashing mode and completes the erasing course of efficiently.
Flashing MicroPython Firmware on ESP8266 with esptool.py
Together with your ESP8266 flash reminiscence erased, you’ll be able to lastly flash the MicroPython firmware. You want your serial port identify (COM7 in our case) and the ESP8266 .bin file location. Substitute the subsequent command with your particulars:
esptool.py –chip esp8266 –port <serial_port> write_flash –flash_mode dio –flash_size detect 0x0 <esp8266-X.bin>
In our case, the ultimate command appears like this:
esptool.py –chip esp8266 –port COM4 write_flash –flash_mode dio –flash_size detect 0x0 esp8266-20180511-v1.9.Four.bin
Maintain down the “BOOT/FLASH“, earlier than operating the flash command. After a couple of seconds that is what you must see:
Your ESP8266 was efficiently flashed with MicroPython firmware!
Notice: in the event you obtain an error making an attempt to flash the firmware, run the command once more and be sure to are holding down the ESP8266 “BOOT/FLASH” button.
Wrapping Up
We hope you’ve discovered this tutorial helpful. Your ESP32/ESP8266 ought to now be flashed with MicroPython firmware. To study extra about MicroPython learn: Getting Began with MicroPython on ESP32 and ESP8266.
For those who appreciated this submit, you may like our subsequent ones, so be sure to subscribe to the RNT weblog and obtain our free electronics eBooks.
Really helpful Assets
The post Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266 appeared first on Playtab Tech.
0 notes