Tumgik
#esptool.py
adafruit · 4 months
Text
RP2040 USB host to program ESP chips through CDC chips
Historically, we've tested and programmed our Feather ESP8266 (https://www.adafruit.com/product/2821) and ESP32 boards (https://www.adafruit.com/product/3405) from a Raspberry Pi. We'd connect over USB and run esptool.py, which works fine but has more things that can go wrong: power flickering, SD card failures, etc. It's better to fully program it with a Pico RP2040 brain board. We can do that now because TinyUSB has support for USB CDC Serial chips (https://github.com/adafruit/Adafruit_TinyUSB_Arduino/tree/master/examples/DualRole/CDC/serial_host_bridge) like the FT232, CP210x, and WCH9102! We upload the stub and test firmware, then listen on the CDC for the self-test output. It works really fast and is much easier to manage.
1 note · View note
draegerit · 6 months
Text
Flashen eines ESP8266 für WLED
Tumblr media
Mit dem Projekt WLED kannst du auf deinem ESP8266 und auch ESP32 LED-Stripes betreiben. In diesem Beitrag möchte ich dir zeigen, wie du deinen Mikrocontroller ESP8266 über das Tool esptool.py flasht. https://youtu.be/rXKLOl0ojuc Das Projekt WLED habe ich dir bereits im Beitrag WLED Webserver für ESP32 einrichten vorgestellt und gezeigt, wie man ein LED-Stripe am ESP32 einrichtet. Der einfache Weg ist hier einen der unterstützten Geräte zu verwenden und die Adresse https://install.wled.me/ aufzurufen. Jedoch kannst du auch andere Geräte flashen, welche von dem Online-Installer nicht unterstützt werden und wie dieses geht, erfährst du in den nächsten Schritten. Wenn du also eine der beiden Fehlermeldungen vom Online-Installer erhalten hast, dann bist auch du genau hier richtig.
Tumblr media
ESP32-C3 von WLED nicht unterstützt
Tumblr media
Wemos D1 Mini mit ESP8266 wird nicht unterstützt
Mikrocontroller ESP8266 für WLED
Um einen LED-Streifen zu steuern, benötigst du keinen teuren ESP32, hier reicht ein einfacher ESP8266 aus, dieser hat in der Regel genug Pins für diese Projekte und auch einen analogen Pin, sodass du dort auch ein Geräuschdetektor anschließen kannst und auch deine Projekte über Sound steuern kannst. In meinem Fall benutze ich einen Wemos D1 Mini V4.0.0.
Tumblr media
Wemos D1 Mini V4 - Vorderseite
Tumblr media
Rückseite des Mikrocontrollers - Wemos D1 Mini V4
Installieren von esptool zum Flashen des ESP8266
Damit wir die neue Firmware auf den ESP8266 aufspielen können, benötigen wir das Tool esptool. Dieses kannst du als ZIP-Datei vom GitHub Repository espressif/esptool herunterladen und über die Kommandozeile installieren. Jedoch gibt es auch hier einen deutlich einfacheren Weg über pip - Python. Schritt 1 - Installieren von Python3.11 Wir benötigen in jedem Fall zunächst einmal Python 3, dieses kannst du von https://www.python.org/downloads/ für Windows, Linux/UNIX, macOS und andere herunterladen und installieren, oder du nutzt den Microsoft Store. Schritt 2 - Installieren von esptool via pip Wenn Python3 installiert wurde, dann können wir das esptool via pip installieren. Dazu öffnen wir die Kommandozeile und geben dort den nachstehenden Befehl ein: pip install esptool Es werden dann verschiedene Scripte und Ressourcen aus dem Internet geladen. Im Anschluss findest du das Tool dann in einem versteckten Ordner. C:UsersBenutzernameAppDataLocalPackagesPythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0LocalCachelocal-packagesPython311Scripts
Tumblr media
Download der BIN-Datei von WLED für den ESP8266
Vom GitHub Repository Aircoookie / WLED laden wir im nächsten Schritt nun eine BIN-Datei für den ESP8266 herunter. Diese Datei enthält die neue Firmware, welche ebenso auch die kleine Webseite zum Konfigurieren enthält. In meinem Fall lade ich die Datei WLED_0.14.0_ESP8266.bin herunter.
Tumblr media
Damit im nächsten Schritt die Eingabe des Befehls nicht zu lang wird, kopiere ich diese BIN-Datei in denselben Ordner, wo auch die Datei esptool.exe liegt.
Flashen des Mikrocontrollers ESP8266 mit esptool
Nachdem wir jetzt alle Ressourcen installiert oder heruntergeladen haben, können wir den Mikrocontroller über die Kommandozeile flashen. Dazu verbinden wir den Mikrocontroller via USB-Schnittstelle mit dem PC und navigieren zum Ordner von esptool und geben auf der Kommandozeile den nachfolgenden Befehl ein: esptool write_flash 0x0 ./WLED_0.14.0_ESP8266.bin
Tumblr media
Flashen des ESP8266 für WLED mit esptool
Einrichten von WLED auf dem ESP8266
Nachdem die neue Firmware installiert wurde, wird jetzt ein Accesspoint von dem Mikrocontroller bereitgestellt. Das Passwort zu diesem lautet wled1234.
Tumblr media
Wenn die Verbindung aufgebaut wurde, dann können wir im Browser die IP-Adresse 4.3.2.1 eingeben und gelangen auf eine Seite, wo wir die WiFi-Verbindung einrichten können. Einrichten der WiFi-Verbindung Auf der Seite können wir nun nach 2,4 GHz Netzwerke scannen. In meinem Fall wurde das Netzwerk gefunden und ich brauchte nur noch das Passwort zu diesem eingeben. Über diese Seite kannst du deinem Mikrocontroller auch eine feste IP-Adresse vergeben, da meine Fritz!Box jedoch mit DHCP läuft, überlasse ich dieses dem Router.
Tumblr media
Wenn die Konfiguration abgeschlossen ist, bestätigen wir die Eingaben mit "Save & Connect" und die Seite kann dann geschlossen werden. Der Mikrocontroller baut eine Verbindung zum genannten Netzwerk auf und erhält dann eine neue IP-Adresse / oder eben die du vergeben hast.
Webseite von WLED
Wenn du die neue IP-Adresse des Mikrocontrollers im Browser eingibst, dann öffnet sich WLED und du musst zunächst dein LED-Stripe konfigurieren.
Tumblr media
Dazu navigierst du über "Config" > "LED Preferences" und wählst dort den Pin, an welchem die LED-Stripe angeschlossen ist, zusätzlich musst du noch die Anzahl der verbauten LEDs festlegen.
Tumblr media
Troubleshooting
Bluescreen CH341S64.SYS Nachdem ich meinen Mikrocontroller geflasht und ins Wi-Fi Netzwerk eingebunden hatte, konnte dieser nicht mehr über den PC erreicht werden. Man hat über den Windows-Sound gehört, dass dieser eingebunden und wenige Sekunden wieder getrennt wurde. Das führte zum Schluss dazu, dass mein PC sich mit einem Bluescreen verabschiedet hat. (Nein, dieser ist nicht kaputt!)
Tumblr media
Zurück zur Originalen Firmware
Wenn du deinen Mikrocontroller auf die original Firmware des ESP8266 zurücksetzen möchtest, dann musst du zunächst die Datei esp-at.bin von Espressif - release/v2.2.0.0_esp8266 herunterladen. Das Tool esptool haben wir bereits im Schritt zum Installieren / Flashen von WLED auf dem PC eingerichtet. Somit brauchen wir lediglich die BIN-Datei in den Ordner von esptool kopieren und von dort den Befehl aufzurufen. Wie unter Troubleshooting erwähnt habe ich mit meinem Mikrocontroller das Problem gehabt, dass dieser immer wieder verbunden und getrennt wurde. Somit musste ich den richtigen Moment finden, indem der Mikrocontroller eingebunden wurde (siehe Bild).
Tumblr media
Read the full article
0 notes
nahaskiosk · 2 years
Text
Ubuntu esp8266 serial port
Tumblr media
#UBUNTU ESP8266 SERIAL PORT HOW TO#
#UBUNTU ESP8266 SERIAL PORT INSTALL#
#UBUNTU ESP8266 SERIAL PORT ZIP FILE#
#UBUNTU ESP8266 SERIAL PORT SERIAL#
#UBUNTU ESP8266 SERIAL PORT INSTALL#
Next, Install the esptool.py python module.
#UBUNTU ESP8266 SERIAL PORT ZIP FILE#
So I had to go with the older 1.6.2 that supported a 512 KiB + 512 KiB map.ĭownload your preferred firmware zip file, extract the zip file and navigate to. The ESP-01 by Ai Thinker only had 1 MB in total. ie, You need 2 MB of flash space on your board. The latest firmware at the time of writing this was 1.7.3 and as you can see from the description on the download page, that only supported a 1024 + 1024 KiB flash map. This requires some understanding of terminal and any wrong step here may brick your module. This the default tool which is provided by Espressif to flash firmware onto ESP chips. Using Esptool from the terminal (command line) After this, you can restart the ESP8266 after removing GPIO-0 from GND. After that press upload button as usual and your firmware will be flashed.
#UBUNTU ESP8266 SERIAL PORT SERIAL#
Now select the correct serial port and choose the Blink example. The installation of ESP8266 in Arduino IDE is done.Now close the Boards Manager window and select the Generic ESP8266 Module from the board selection list.Click the Install button to install the ESP8266 Board.Add the below-given link to Additional Boards Manager URLs.For flashing official firmware head on to next method The Arduino method is only flashing the user-written firmware. There are 2 ways to flash your firmware, the First one is using esptool which is a bit complicated process and the second one is using Arduino IDE which also uses esptool at backend abstracting all its complexities. When we restart the module, this setup will put it into bootloader mode. To put ESP8266 into bootloader mode we need to first pull GPIO-0 to GND.
#UBUNTU ESP8266 SERIAL PORT HOW TO#
USB-TTL ( learn how to use Arduino as USB-TTL adapter).
ESP8266 (obvious, but still needs a mention).
We need below-mentioned hardware components: This module has a powerful on-board processing and storage capability that allows it to be integrated with the sensors and other applications through its GPIOs. The other type by the generic manufacturers might just have 512 KiB flash (and their PCBs could be blue in color).ĮSP8266 comes pre-programmed with an AT command set firmware, meaning, you can simply hook this up to your Arduino device and get about as much WiFi-ability as a WiFi Shield offers. These have a flash memory of 1 Megabyte (aka 8 megabits). The AI-Thinker boards have a black PCB with the words “AI-CloudInside” printed near the PCB antenna. So to simplify the whole process and understanding of putting your firmware on ESP8266-01 (by AI-Thinker), we are writing this article. But sometimes it becomes a bit tedious task to flash your firmware onto it. This is why you can communicate with the board serially using a USB cable and the Serial Monitor feature of the Arduino IDE.We know that ESP8266-01 is an impressive, low cost and powerful module with networking capabilities. The Arduino UNO has its own FTDI chip whose function is to convert TTL signal levels to USB. The Arduino act as a USB serial bridge between the computer’s USB port and the MCU’s serial port. I always use this method to communicate with an ESP8266 module. Here we will learn how to use Arduino as a USB Serial converter. Or for some other reason, we need a USB to serial converter. There are always USB-TTL adapters available for Serial communication but sometimes we are in a dire need of these adapters but can’t find it. USB is the universally accepted port these days, and if you are into Microprocessor Programming you must be dealing with Serial communication to communicate with your device.
Tumblr media
0 notes
amigadventures · 4 years
Text
Getting the Amiga CD32 online
Tumblr media
Yes, 59 kilobits per second of PURE INTERNET! But how did I get here? Well, follow me and I’ll show you.
The basic concept is to use the Amiga’s serial port to talk to an ESP8266 running a SLIP Router, which will then link to your wifi and the internet. The idea is that the CD32 and the ESP8266 (ESP-01) belong to a network of two, attached via the serial lines. Separately, the ESP-01 connects to your wifi and gets assigned an address as normal. The ESP firmware then shuffles data between the two networks, acting as a router:
Tumblr media
Yes, it’s rather convoluted but we’ll take it step by step!
Credit to Stephen Leary & co at exxos forum for doing the hard work!
What you’ll need
You will need some hardware:
Amiga CD32
ESP8266 ESP-01
TerribleFire TF330, or alternative Fast RAM, IDE & keyboard solution and a cable to break out the Tx/Rx on the ‘Aux’ port
ESP8266 programmer or FTDI 3.3 usb->ttl or similar
A bit of jumper wire
2x4 2.54mm pitch header (optional but recommended)
And a bunch of software
Roadshow TCP/IP stack (demo available)
should also work with AmiTCP, Genesis or Miami, but you’ll need to follow the instructions for those accordingly
Web browser like IBrowse (demo available)
AWeb is free but ancient
slip.device and installer script by Stephen Leary
or from aminet
esp_slip_router firmware
esptool.py and python
Hardware Setup
The first job is to flash the new firmware onto the ESP8266. This is apparently possible by using an Arduino as a programmer but I couldn’t get it to work. I did have a usb-TTL converter but that was 5v whereas the ESP is 3.3v and I didn’t want to let the magic smoke out, so I ended up buying a little programmer, as linked above.
Download & install the python, follow the instructions to install pip and esptool.py and then download the esp_slip_router firmware. Plug the esp-01 into the programmer and pop it into a usb socket, then fire up a terminal. 
I used Windows; if you’re using Linux replace COM3 with /dev/ttyUSB0. COM port / tty device will need to be modified according to what your computer assigns it. In Windows, look in Device Manager. Make sure you’re running this from the esp_slip_router folder, where the ‘firmware’ subfolder lives.
python esptool.py --port COM3 write_flash -fs 8m 0x00000 firmware/0x00000.bin 0x10000 firmware/0x10000.bin
Now, this didn’t work for me, I got error messages about invalid headers. I tried all manner of things and it would not bloody work. Eventually I discovered that one of the pins needs to be grounded to put it in “programming” mode - this is where the bit of wire comes in handy.
Plug the ESP-01 into the programmer
Plug the programmer into the USB port
Connect GPIO0 to GND, There’s a little blue LED that should flash
Run esptool.py
Tumblr media
If it doesn’t work, unplug the thing from the USB port and try again. I didn’t need to keep GPIO0 grounded during the whole process, just initially to put it in programming mode - your mileage may vary.
With the thing finally flashed, I (badly) soldered a header onto the TF330 and plugged the ESP-01 in:
Tumblr media
Note the direction! It points “away” from the board:
Tumblr media
With this, we’re ready to start with the Amiga side of things.
Software Setup
You’ll need to transfer some software to the Amiga. I assume if you’re here then you already know how to do this and are using a CF or SD card on the IDE interface anyway.
Copy over the TCP/IP stack, browser, slip.device & setup scripts and telnet client. Install them in this order:
Install your TCP/IP stack
reboot
In a shell, go to the directory you unpacked tf3xxx_slip.zip ‘execute install_script’, and reboot
Note, I needed to remove this line from install_script to avoid getting errors:
echo >>Devs:NetInterfaces/Slip "interface=Slip" 
At this point, the Amiga should be able to talk to the ESP over the serial connection. But that won’t do anything yet, as we have to configure the other side of the bridge. You can run c:showNetStatus if you want to check everything is fine so far:
Tumblr media
Next, install your telnet client, and we’ll configure the esp_slip_router to connect to your wifi.
Make sue that local echo is on so that you can see what you’re doing, and that return issues a CR+LF:
Tumblr media
Connect to 192.168.240.1 port 7777, a special configuration telnet client running on the ESP.
Tumblr media
You should see a command prompt like “CMD>”
set ssid YOUR_SSID_HERE
set password YOUR_PASSWORD_HERE
set use_ap 0
save
reset
The ESP will then reset itself. If you connect again and type “show”, you should see that the wifi-side of the router has been allocated an address on your home network:
Tumblr media
That’s it, you can talk to the ESP8266 and it can talk to your wifi. Your CD32 is now online!
You can now fire up the browser of your choice and get surfing. The recently released IBrowse2.5 can handle modern-ish websites, such as this one! You’ll need to install AmiSSL 4.5 too.
Tumblr media
What else can you do with an Amiga CD32 with a network connection?
A spot of IRC chatting
Transfer files via either Samba or NFS, or maybe FTP
Telnet into one of many Amiga BBS sites
Check your email
Impress your friends! Well, probably not that one
5 notes · View notes
llinx14789 · 3 years
Quote
Arduino:1.8.13 (Windows Store 1.8.42.0) (Windows 10), Kort:"ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None" Sketch uses 207921 bytes (15%) of program storage space. Maximum is 1310720 bytes. Global variables use 15228 bytes (4%) of dynamic memory, leaving 312452 bytes for local variables. Maximum is 327680 bytes. esptool.py v2.6 Serial port COM3 Traceback (most recent call last):  File "esptool.py", line 2959, in  File "esptool.py", line 2952, in _main  File "esptool.py", line 2652, in main  File "esptool.py", line 222, in __init__  File "site-packages\serial\__init__.py", line 88, in serial_for_url  File "site-packages\serial\serialwin32.py", line 62, in open serial.serialutil.SerialException: could not open port 'COM3': WindowsError(2, 'Det g\xe5r inte att hitta filen.') Failed to execute script esptool Den valda seriella porten Failed to execute script esptool existerar inte eller så är din board inte ansluten. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
no fucking source except alduino fuck you you bitch ass butt munching cuck im just trying to do some fucking school work but you give me this shit? no fuck off
0 notes
kjunichi · 4 years
Text
M5StickC/ATOM on MacOS Catalina can't upload/ ESP32: Timed out waiting for packet header solution | M5Stack Community [はてなブックマーク]
Tumblr media
M5StickC/ATOM on MacOS Catalina can't upload/ ESP32: Timed out waiting for packet header solution | M5Stack Community
Home Official Updates M5StickC/ATOM on MacOS Catalina can't upload/ ESP32: Timed out waiting for packet header solution M5StickC/ATOM on MacOS Catalina can't upload/ ESP32: Timed out waiting for packet header solution upload time out error log esptool.py v2.8-dev Serial port /dev/cu.usbserial-xxx...
Tumblr media Tumblr media
from kjw_junichiのはてなブックマーク https://ift.tt/2DV6KwO
0 notes
tdcomfort-blog · 4 years
Photo
Tumblr media
Voor de handige doe-het-zelvers wellicht een leuk project: * https://www.superhouse.tv/episodes * https://www.superhouse.tv/37-installing-tasmota-using-tasmotizer/ Het installeren van Tasmota op een apparaat zoals een Sonoff wordt meestal gedaan met esptool.py, een krachtig opdrachtregelhulpprogramma, maar het kan een beetje verwarrend zijn als je er niet aan gewend bent. Nu is het gekoppeld aan een verbazingwekkende grafische interface genaamd Tasmotizer die u het gemak van aanwijzen en klikken biedt en enkele handige functies toevoegt voor het configureren van uw apparaten. Zie de link hierboven voor een stapsgewijze handleiding. SuperHouse: - https://www.superhouse.tv - https://twitter.com/superhousetv - https://www.facebook.com/superhousetv/ Jonathan Oxer: - https://www.facebook.com/jonoxer/ - https://twitter.com/jonoxer Steun me op Patreon om exclusieve kortingscodes, toegang tot Patron-only secties van de SuperHouse Discord en vroege toegang tot nieuwe https://is.gd/D3cGMJ
0 notes
marsic-84 · 4 years
Video
youtube
Прошивка Sonoff Touch: Tasmota & ESPurna + OpenHAB. Дешевые выключатели для умного дома. | Room31
Выключатели Sonoff Touch это отличная вещь для бюджетного умного дома. Но с родной прошивкой подключить их к альтернативным системам умного дома, таких как Openhab, Domoticz, Majordomo и др. нельзя. К счастью, это недоразумение можно легко исправить.
🔶 В этом видео: ◽ 00:27 Микро обзор Sonoff Touch ◽ 00:51 Подготовка к прошивке: паяние разъема ◽ 02:04 Схема подключения для прошивки ◽ 02:34 Установка Python на Windows ◽ 02:57 Установка ESPTool.py ◽ 03:18 Прошивка Sonoff Touch с помощью ESPTool.py (бекап, очистка, прошивка) ◽ 05:36 Прошивка Sonoff Touch с помощью NodeMCU PyFlasher (очистка, прошивка) ◽ 06:38 PuTTy в качестве Serial Monitor ◽ 06:58 Настройка WiFi в прошивке Tasmota ◽ 07:49 Настройка WiFi в прошивке ESPurna ◽ 10:20 Настройка MQTT в прошивках Tasmota и ESPurna ◽ 11:35 Настройка OpenHAB ◽ 15:40 Донастройка мелочей ◽ 17:34 Результат проделанной работы ◽ 18:30 Советы P.S.
🔶 Где взять устройства из этого видео?: 
◽ WiFi выключатель Sonoff Touch: http://ali.pub/4nfd20 
◽ USB-UART стик: http://ali.pub/4nfdjw 
◽ Паяльник Ksger T12: http://ali.pub/4nfeme
🔶 Полезные ссылки по теме этого видео: ◽ Архив с файлами из видео: https://mega.nz/#!EiJiUS4I!FNK1aOgyislHi7QB1mAwNOuQuMwIa83Yia18GWBrNNc ◽ Прошивка ESPurna: https://github.com/xoseperez/espurna/releases ◽ Прошивка Tasmota: https://github.com/arendst/Sonoff-Tasmota/releases ◽ NodeMCU PyFlasher: https://github.com/marcelstoer/nodemcu-pyflasher/releases ◽ Питон: https://www.python.org/downloads/
🔶 Мои другие видео: ◽ 14. Прошивка Sonoff Touch: Tasmota & ESPurna + OpenHAB | Room31:   https://youtu.be/AHicER0zTgE ◽ 13. Расширение OpenHAB для браузера Chrome: https://youtu.be/4SgWZxUGSO4 ◽ 12. Умный настенный светильник (бра) своими руками + Openhab: https://youtu.be/_RlpP1xVL8M ◽ 11. Умный дом своими руками. Arduino + MQTT + OpenHAB: https://youtu.be/tb-BMCLp_0Y ◽ 10. Увлажнители Xiaomi + Openhab: https://youtu.be/h7ex3zWCLDg ◽ 9. Умный дом и WiFi LED контроллеры для чайников. MagicHome + OpenHAB https://youtu.be/0Lg7y6yLOks ◽ 8. Подключение кондиционера к умному дому. Gree Smart + OpenHAB: https://youtu.be/cY6RfOjI-Ts ◽ 7. Настройка подключения OpenHAB к MQTT брокеру: https://youtu.be/5IrIg9eQcX0 ◽ 6. Установка MQTT broker на WINDOWS 10: https://youtu.be/FEoy5YkrBIE ◽ 5. Установка MQTT broker на Raspberry Pi: https://youtu.be/cgqFEyMQhsI ◽ 4. Установка openHAB на Windows 10: https://youtu.be/2R90hlC5Jzs ◽ 3. Установка openHAB на Raspberry Pi 3: https://youtu.be/D6Px3jDNxPM ◽ 2. Самодельное настенное крепление для планшета из трубы: https://youtu.be/u8zFNUIHgRg ◽ 1. Умный Дом - Начало: https://youtu.be/1WDVufuN90Q
🔶 Music by: ◽ Zero Chaotic, Zvykar - Warlike (Original Mix) ◽ Hexalyte - Silence ◽ Markvard - Perfect Day ◽ TheDiabolicalWaffle - Kaleidoscope [Argofox Release] ◽ Trip - Real Hypha ◽ Digital Math - The Musky Thrust [Argofox Release] ◽ Alexander Nakarada - Main theme overture the grand score
#SonoffTouch #Прошивка #OpenHAB #MQTT #Tasmota #ESPurna #Sonoff-Tasmota
0 notes
awsexchage · 5 years
Photo
Tumblr media
SOCINNO「IoT電子工作 スマートリモコン製作キット」をUbuntu 18.04で使う場合の追加作業 https://ift.tt/2SDJjLD
株式会社SOCINNOが提供する「IoT電子工作 スマートリモコン製作キット」は基礎からWi-Fi利用、クラウド接続まで順を追って丁寧に解説されている秀逸な教材である。
このキットをArduino IDE 1.8.9 + Ubuntu 18.04環境で使う際にいくつか追加で作業する必要があったので補足する。
以下、同キット向けのIoT電子工作ガイドの章立てに沿って説明する。
2-1 電子部品利用 > LED点滅
スケッチコンパイルエラー
スケッチコンパイル時に以下のようなエラーが発生する場合。
: Pyserial is not installed for /usr/bin/python. Check the README for installation instructions.Traceback (most recent call last): File "/home/neo/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module> import serial ImportError: No module named serial exit status 1 Error compiling for board ESP32 Dev Module.
python-serialパッケージをインストールすればエラーが発生しなくなる。
$ sudo apt install python-serial
2-3 電子部品利用 > 温湿度センサ
スケッチコンパイルエラー
スケッチコンパイル時に以下のようなエラーが発生する場合。
: In file included from /home/ard/Arduino/libraries/DHT_sensor_library/DHT_U.cpp:22:0: /home/ard/Arduino/libraries/DHT_sensor_library/DHT_U.h:25:29: fatal error: Adafruit_Sensor.h: No such file or directory #include <Adafruit_Sensor.h> ^ compilation terminated. Using library DHT_sensor_library at version 1.3.4 in folder: /home/ard/Arduino/libraries/DHT_sensor_library exit status 1 Error compiling for board ESP32 Dev Module.
ライブラリマネージャから「Adafruit Unified Sensor」をインストールすればエラーが発生しなくなる。
3-2 Wi-Fi利用 > Webサーバ機能
スケッチコンパイルエラー
スケッチコンパイル時に以下のようなエラーが発生する場合。
: Multiple libraries were found for "WiFi.h" Blink:2:31: error: ESPAsyncWebServer.h: No such file or directory compilation terminated. Used: /home/ard/.arduino15/packages/esp32/hardware/esp32/1.0.2/libraries/WiFi Not used: /home/ard/opt/arduino-1.8.9/libraries/WiFi exit status 1 ESPAsyncWebServer.h: No such file or directory This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
以下の2つをダウンロードして[Sketch] > [Include Library] > [Add .ZIP Library…]でそれぞれインストールすればエラーが発生しなくなる。
https://github.com/me-no-dev/ESPAsyncTCP/archive/master.zip
https://github.com/me-no-dev/AsyncTCP/archive/master.zip
DHCPサーバ利用
IPアドレス情報をDHCPサーバから動的に受け取る場合は以下のIPアドレス設定は不要。(以降の章も同様)
IPAddress ip(192, 168, 1, 123); // IPアドレス(本機が利用するIP) IPAddress gateway(192, 168, 1, 1); // デフォルトゲートウェイ IPAddress subnet(255, 255, 255, 0); // サブネットマスク : void setup() { : WiFi.config( ip, gateway, subnet ); :
4-2 データ利用 > SPIFFSによるファイル操作
SPIFFSマウントエラー
プログラム実行時に以下のようなエラーが発生する場合。
E (36) SPIFFS: mount failed, -10025
SPIFFS.hだけでなくFS.hもincludeすればエラーが発生しなくなる。
#include <FS.h> <--- 追加 #include <SPIFFS.h>
それ以降
上記の対応を経て、無事リモコンが動作した。
⦿リモコン設定(ON/OFF信号記録)
Tumblr media Tumblr media
⦿リモコン操作(ON/OFF信号発信)
Tumblr media Tumblr media
関連記事
IoT時代に対応すべく、電子工作を基礎から応用まで学習! 「IoT電子工作 スマートリモコン製作キット」発売 (@Press)
SOCINNO、電子工作を基礎から応用まで学習できる「IoT電子工作 スマートリモコン製作キット」発売 (IoTNEWS)
元記事はこちら
「 SOCINNO「IoT電子工作 スマートリモコン製作キット」をUbuntu 18.04で使う場合の追加作業」
July 25, 2019 at 12:00PM
0 notes
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
draegerit · 11 months
Text
Mikrocontroller ESP32 H2 im Test
Tumblr media
In diesem Beitrag möchte ich dir den Mikrocontroller ESP32 H2 vorstellen und diesen auch mit anderen baugleichen Mikrocontrollern der ESP32 Reihe vergleichen.
Tumblr media
Der Mikrocontroller wurde das erste Mal von Espressif auf der Seite https://www.espressif.com/en/news/ESP32_H2 im August 2021 angepriesen. Das Releasedate ist jedoch immer wieder bedingt durch die Covid Pandemie verschoben worden und liegt nun auf das erste Quartal 2023 und somit konnte ich mir eines dieser Geräte ergattern.
ESP32 H2 kaufen
Den Mikrocontroller bekommst du derzeit für knapp 16 € zzgl. Versandkosten auf aliexpress.com.
Tumblr media
ESP32 H2 auf aliexpress.com Das ist für einen ESP32 nicht gerade günstig, aber gemessen an den Features (werde ich im nächsten Kapitel aufzeigen) finde ich den Preis angemessen.
Tumblr media Tumblr media
Features des ESP32 H2
Besonders zu nennen ist, dass der Mikrocontroller als "Zigbee-konforme Plattform" zertifiziert und eine "Thread-zertifizierte 1.3.0-Komponente" ist. Des Weiteren wird Bluetooth 5.2 (LE) & IEEE 802.15.4 unterstützt, somit ist dieser Mikrocontroller bestens für deine Low Energy Projekte im Bereich IoT geeignet. Der ESP32-H2 macht es einfacher, sichere Geräte zu bauen. Er hat viele Funktionen, die sicherstellen, dass die Daten sicher sind, wie z.B. das sichere Booten, die Flash-Verschlüsselung und digitale Signaturen. Auch die Identität des Geräts ist geschützt. All diese Funktionen machen den Mikrocontroller erschwinglich und geben dem Benutzer die Sicherheit, dass seine Daten geschützt sind.
Technische Daten
Hier nun die, wie ich finde, technischen Daten des Mikrocontrollers: Chipsingle core, 32-bit RISC-VTaktfrequenz160 MHzSpeicher128 KB ROM 320 KB SRAM 4 KB LP Speicher 2 MB oder 4MB SiP Flash SpeicherSchnittstellen2x USB-Typ-C 2.0, SPI, UART, I2C, I2CBluetooth 5.2 Low Energy, IEEE 802.15.4, Zigbee & ThreadGPIOs19 frei programmierbare GPIOsTechnische Daten des ESP32-H2 Dies ist nur ein kleiner Auszug aus den technischen Daten, welche du komplett als PDF Dokument unter https://cdn-shop.adafruit.com/product-files/5715/esp32-h2_datasheet_en.pdf findest.
Pinout & Aufbau
Was als Erstes auffällt ist, dass der Mikrocontroller zwei USB-C Schnittstellen hat. Des Weiteren verfügt dieser auf der Vorder- und Rückseite über Pinbeschriftungen.
Tumblr media
Mikrocontroller - ESP32-H2-DevKitM-1
Tumblr media
Mikrocontroller - ESP32-H2-DevKitM-1 (Rückseite) Auf der Vorderseite finden wir einen RGB NeoPixel sowie zwei Taster Boot & Reset. Über den Jumper J5 kannst du die Stromaufnahme des Mikrocontrollers messen, hier musst du den Jumper entfernen und ein Strommessgerät in Reihe schalten.
Tumblr media
Aufbau des ESP32-H2 DevKitM-1
Anschluss an den PC
Wenn du dein USB-Typ-C Kabel in den mit USB beschrifteten Anschluss mit dem PC verbindest dann wird dieses Gerät als "Serielles USB-Gerät" erkannt. Am Anschluss UART wird das Gerät als "Silicon Labs CP210x USB to UART Bridge" erkannt.
Tumblr media Tumblr media
Programmieren in der Arduino IDE
Den Mikrocontroller kannst du derzeit (Stand 25.05.2023) nicht in der Arduino IDE 2.0 programmieren. Der ESP32 wird zwar erkannt aber leider nicht korrekt.
Tumblr media
Arduino IDE 2.0 - Mikrocontroller ESP32-H2-DevKitM-1 als ESP32-S3 erkannt Wenn wir nun einen Code hochladen dann erhalten wir die Ausgabe vom esptool.py das der gewählte Chip nicht passt. Sketch uses 257969 bytes (19%) of program storage space. Maximum is 1310720 bytes. Global variables use 19496 bytes (5%) of dynamic memory, leaving 308184 bytes for local variables. Maximum is 327680 bytes. esptool.py v4.5.1 Serial port COM4 Connecting... A fatal error occurred: This chip is ESP32-H2 not ESP32-S3. Wrong --chip argument? Auch ein Update des Boardtreibers auf die Version 2.0.9 bringt derzeit nicht den passenden Treiber mit und daher bleibt derzeit nur die Wahl zur Espressif IDE. Du bekommst jedoch für Eclipse & VSCode ein passendes Plugin welches du installieren kannst und dann deinen Mikrocontroller über diese IDE programmieren kannst. Wie du das machst erfährst du demnächst auf meinem Blog! Read the full article
0 notes
sourmarame-blog · 5 years
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
reputationbitch · 5 years
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
siyahspreyboyasblog · 5 years
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
wildehorroruniverse · 5 years
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