esptool | Espressif SoC serial bootloader utility

 by   espressif Python Version: 4.8.dev3 License: GPL-2.0

kandi X-RAY | esptool Summary

kandi X-RAY | esptool Summary

esptool is a Python library. esptool has no bugs, it has no vulnerabilities, it has build file available, it has a Strong Copyleft License and it has high support. You can install using 'pip install esptool' or download it from GitHub, PyPI.

esptool.py was initially created by Fredrik Ahlberg (@themadinventor, @kongo), and is currently maintained by Angus Gratton (@projectgus). It has also received improvements from many members of the ESP8266 community - including @rojer, @jimparis, @jms19, @pfalcon, @tommie, @0ff, @george-hopkins and others. This document and the attached source code are released under GNU General Public License Version 2. See the accompanying file LICENSE for a copy.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              esptool has a highly active ecosystem.
              It has 4871 star(s) with 1285 fork(s). There are 233 watchers for this library.
              There were 5 major release(s) in the last 6 months.
              There are 31 open issues and 694 have been closed. On average issues are closed in 104 days. There are no pull requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of esptool is 4.8.dev3

            kandi-Quality Quality

              esptool has 0 bugs and 0 code smells.

            kandi-Security Security

              esptool has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              esptool code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              esptool is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              esptool releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              esptool saves you 4399 person hours of effort in developing the same functionality from scratch.
              It has 10927 lines of code, 805 functions and 48 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed esptool and discovered the below as its top functions. This is intended to give you an instant insight into esptool implemented functionality, and help decide if they suit your requirements.
            • Entry point for ESP32
            • Return an ESPEfuse
            • Close the stream
            • Burn all blocks from all blocks
            • Get an Efuse controller
            • Write a flash file
            • Raise fatal error if invalid
            • Load firmware image
            • Update image flash parameters
            • Read an ELF file
            • Returns the diff between two files
            • Set the voltage of the efuse
            • Merge bin files
            • Burn the block
            • Saves the value of the field
            • Saves the image to disk
            • Stops all blocks from all blocks
            • Wrap an ELF file
            • Write the given efuse to the given efuse
            • Print information about the ADC
            • Generate signature information
            • Show image information
            • Saves memory to disk
            • Create an image
            • Returns a list of chip features
            • Prints summary of efuse
            • Check if Efuse is already read
            Get all kandi verified functions for this library.

            esptool Key Features

            No Key Features are available at this moment for esptool.

            esptool Examples and Code Snippets

            Xiaomi_LYWSD03MMC_for_HA,Building The Solution
            Pythondot img1Lines of Code : 93dot img1no licencesLicense : No License
            copy iconCopy
            ssid = 'your_ssid'
            password = 'your password'
            mqtt_server = 'your_mqtt address'
            
            MicroPython v1.12 on 2019-12-20; ESP32 module (spiram) with ESP32
            Type "help()" for more information.
            >>> import mqtt
            I (6680) modsocket: Initializing
            I (15807)  
            MicroPython class for OV2640 Camera,Usage - Software
            Pythondot img2Lines of Code : 18dot img2License : Permissive (MIT)
            copy iconCopy
            sudo esptool.py --port /dev/ttyUSB0 erase_flash
            sudo esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 ~/Downloads/esp8266-20170526-v1.9.bin
            git clone https://github.com/namato/micropython-ov2640
            cd micropython-ov2640
            sud  
            copy iconCopy
            $ ls /dev/tty*
            
            $ esptool.py -p /dev/tty.wchusbserial1420 erase_flash
            esptool.py v1.1
            Connecting...
            Erasing flash (this may take a while)...
            
            $ esptool.py -p /dev/tty.wchusbserial1420 write_flash -fm dio -fs 32m 0 esp8266-20160827-v1.8.3-61-g531217a.  

            Community Discussions

            QUESTION

            How to fix Failed to connect to ESP32: Timed out waiting for packet header error?
            Asked 2022-Jan-24 at 17:16

            I tried to flash an ESP32 but I didn't succeed, I tried with esptool.py and Arduino IDE. I tried to press the boot button and reset but it didn't work. Here is the error:

            ...

            ANSWER

            Answered 2022-Jan-01 at 22:17

            To make your ESP32 board go into flashing/uploading mode automatically, you can connect a 10 μF electrolytic capacitor between the EN pin and GND. When I had the same problem, when I followed this advice, the problem was solved.

            References

            Source https://stackoverflow.com/questions/70532139

            QUESTION

            Run Django in docker container with GDAL
            Asked 2021-Dec-20 at 11:25

            I am currently trying to run a Django project inside a docker container, to provide the project with a local DB.

            The Project is depending on GDAL, but when trying to install the requirements it always runs into the same problem. The following is my dockerfile:

            ...

            ANSWER

            Answered 2021-Dec-20 at 11:25

            I found the problem. The conda install fixed the GDAL problem. BUT. When installing requirements.txt, GDAL got installed a second time and this caused the error, since the normal pip install is not working properly with GDAL.

            Source https://stackoverflow.com/questions/70394285

            QUESTION

            ESP8266 NodeMCU MicroPython garbage in serial, cannot erase_flash or upload files
            Asked 2021-Dec-18 at 23:14

            Looks like I broke my NodeMCU Lolin esp8266 module, please confirm)

            Firstly everything worked fine, but then...

            1. I uploaded a bit strange boot.py to play with UART0
            ...

            ANSWER

            Answered 2021-Dec-03 at 09:48

            It's more likely that you are experiencing hardware related issues than software related issues as you imply yourself.

            Re-solder the part that broke off and try again. You probably broke of a resistor/capacitor that is used for noise filtering the output (I am not a hardware guy) or something that is vital to regulating the voltage required for the board to operate.

            EDIT

            As indicated by: https://raw.githubusercontent.com/hallard/NodeMCU-Gateway/master/pictures/NodeMCU-Lora-Gateway-top.png it seems, albeit that board is of a different design, that you broke off a capacitor or diode. Either resolder or get yourself a new one (100nf) or a diode (1N4148)

            Source https://stackoverflow.com/questions/69705172

            QUESTION

            Problem with Flash size on ESP8266-01S on VSCode (PlatformIO)
            Asked 2021-Dec-07 at 23:58

            I have a problem with programing my ESP8266-01S with PlatformIO on VSCode. Actually, it is working well on Arduino, but I would like to use VSCode because it is more comfortable (and it is not working on VSCode !). I've noticed a difference in the terminal when I upload my code between the two softwares. Let me show you :

            This is what I get on Arduino :

            ...

            ANSWER

            Answered 2021-Dec-07 at 23:58

            I think it has nothing to do with flash memory size from the comments you provided.

            If your setup on Arduino IDE is Generic ESP8266 Module and it is working, it means that the LED_BUILTIN is configured at GPIO1 as shown in the source code of ESP8266 core for Arduino.

            This means that you had an EPS-01 instead of an ESP-01S. One of the differences between ESP-01 and ESP-01S is that the LED_BUILTIN is wired to the different GPIO pin. ESP-01 has the LED_BUILTIN wired to GPIO1, while ESP-01S has the LED_BUILTIN wired to GPIO2.

            This picture shows the different between ESP-01 and ESP-01S, visually ESP-01 has 2 LEDs on board near the antenna, while ESP-01S have two extra resistor between header pins and ESP8266EX chip, and with only one LED near the antenna.

            Easier way to fix it

            The easier way to address it is to define your own pin assignment instead of using pre-defined LED_BUILTIN.

            Source https://stackoverflow.com/questions/70238001

            QUESTION

            NodeMCU ESP8266 cannot upload sketch - timeout error
            Asked 2021-Oct-04 at 09:14

            Using arduino-cli, the arduino-ide, or directly the esptool.py (from https://github.com/espressif/esptool) I obtain the following error when uploading a simple (correct) sketch.

            ...

            ANSWER

            Answered 2021-Oct-04 at 09:14

            The problem was that my last apt upgrade updated the kernel from the 5.4.0-86-generic to 5.4.0-88-generic (I checked the update in /var/log/apt/history.log.1.gz). The driver CH341 in 5.4.0-88 is not working properly (the ESP I'm using require CH340G drivers). The solution is to go back to the 5.4.0-86 drivers and in the following I list what I've done.

            1. disconnect any ESP or board connected to any USB. Then test that the CH341 module (which allows the serial communication with the EPS) is loaded. You can use this code to test the correct unload/load of the module in steps 2, 3.

            Source https://stackoverflow.com/questions/69433568

            QUESTION

            ESP-IDF wifi event loop keeps receiving SYSTEM_EVENT_STA_WPS_ER_PIN even after code rollback
            Asked 2021-Jun-01 at 20:46

            I have been working on a project using the ESP32 with the ESP-IDF that will check it's NVS memory for wifi credentials before starting the network stack. If it has said credentials, it will connect to the wifi network in STA mode, if it lacks them, it will launch as it's own AP to allow the user to send it the credentials over HTTP.

            After manually putting my test credentials into NVS, I started working on the AP code. Once all the AP code and logic was complete, I manually wiped the flash memory with esptool to force the board to launch in that mode. Doing so worked fine, and I was able to send it the updated credentials over HTTP.

            At this point, the board attempted to connect as STA upon reset, however, the SYSTEM_EVENT_STA_WPS_ER_PIN event kept being caught by the wifi event loop. The board has since only experienced this event and has been completely unable to connect to wifi since. To make matters stranger, even after rolling back to a previous version with git, the problem still persists.

            main.c

            ...

            ANSWER

            Answered 2021-May-22 at 13:33

            Useful to solve the problem. I'm in the proces of learning to use the ESP32 wifi, read your message checked, the ESP-idf and esp-32 technical manual not much info there I found this URI https://www.wi-fi.org/downloads-public/Wi-Fi_Protected_Setup_Best_Practices_v2.0.2.pdf/8188

            Kind regards

            Update: check the sdkconfig file in your projectmap against the one in the example map for wifi config settings.

            Source https://stackoverflow.com/questions/67576386

            QUESTION

            Problem uploading sketch to arduino uno/esp8266
            Asked 2021-May-04 at 15:24

            Getting this error while uploading:

            ...

            ANSWER

            Answered 2021-Apr-30 at 15:46

            Could you give more details about the 3.3V regulator that you using? Do you have it connected between the serial signals?

            If that is the case, I suggest this connection instead:

            3.3V signal voltage divisor

            ESP TX and Arduino RX can be connected directly without any issue

            Source https://stackoverflow.com/questions/67320143

            QUESTION

            ESP32 toit provisioning fails
            Asked 2021-Apr-09 at 05:43

            Setup: Macbook Pro 2020 with a Satechi USB dongle, which serves the usb connections to the microcontroller. The USB cable suited for file transferring. I am using an ESP32-wroom-32E, but when that failed I also tried with an ESP32-wroom-32D and an ESP32 (v1). All of them are development boards.

            Tried to provision with the following command from https://docs.toit.io/getstarted/provision/:

            toit serial provision --baud 460800 -p wifi.ssid=toitwifi -p wifi.password=toitware -m esp32-4mb

            This resulted in the following:

            ...

            ANSWER

            Answered 2021-Apr-09 at 05:43

            Most often provisioning fails because of drivers that aren't updated.

            For macOS these would be (latest version):

            According to your update you already installed those.

            Some devices also need lower baud rates. For example the LILYGO TTGO T-Wristband only works with limited bandwidths. Maybe try with a lower value (as low as 9600).

            Since the macOS USB hardware is known to be a bit finicky you could also try to put the devkit behind a USB hub (with an external power supply).

            Finally, there are some devices that are known to have a bad hardware setup and which are difficult to flash on macOS. Sometimes pulling the GPIO0 to ground (for example with a resistor) can make the flashing work.

            Others have reported success with adding a capacitor: https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/

            Since you only need to provision/flash a device once, the breadboard solution would be enough. Concretely, adding a 10uF electrolytic capacitor between the EN pin and GND could work.

            Source https://stackoverflow.com/questions/67015569

            QUESTION

            How do you erase ESP32 wifi Smartconfig credentials from flash?
            Asked 2021-Jan-25 at 12:15

            I am using esp32 smartconfig to setup wifi credentials and it is working reliably. I want to be able to erase the credentials which are stored somewhere in flash from my arduino esp32 sketch.

            The only way I have been able to erase the credentials (I'm not sure where they are stored) is to erase the entire flash using esptool.py from my Windows PC:

            ...

            ANSWER

            Answered 2021-Jan-25 at 12:15

            You haven't provided much details on your implementation, but if assuming the standard ESP-IDF implementation then the WiFi credentials are stored in Flash on the default NVS partition named "nvs" (overview). You can easily perform an erase cycle on the entire partition which will erase everything stored in your device.

            Alternatively you can hunt down the specific NVS keys used by the ESP WiFi component to store the credentials and erase only those. This is slightly risky as they haven't open-sourced the WiFi drivers and might change the implementation at any time. With that in mind, current ESP IDF 4.2 seems to store those keys in the default NVS partition under namespace "nvs.net80211". The relevant key names would appear to be "sta.authmode", "sta.ssid" and "sta.pswd".

            Source https://stackoverflow.com/questions/65873683

            QUESTION

            What does "stub" mean in the context of ESP32 and esptool option --no-stub?
            Asked 2021-Jan-16 at 14:08

            I want to program a board with an esp32 on it using esp-prog and esptool. When I do that I get the following error:

            ...

            ANSWER

            Answered 2021-Jan-16 at 14:08

            In software development, a stub is a piece of code or a program which is used in place of another. They often simulate the behavior of the original feature and sometimes they are used as a temporaro substitute for undeveloped code.

            In the case of esptool, it uses a stub loader, which basically replaces the original bootloader used in the ESP to load your program via serial port to the ROM of your ESP32 device.

            Basically this stub bootloader has the same behavior as the original bootloader, but it uses some UART routines which are more heavily optimised to load the ROM code.

            Using --no-stub you will be using the original ESP32 bootloader, which is known to be slower at flashing the program and at some other operations. There are some commands which can only be used in the esptool bootloader, but if you are not using any optional commands to boot your code, it is safe to use --no-stub

            Source https://stackoverflow.com/questions/65749587

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install esptool

            You will need either Python 2.7 or Python 3.4 or newer installed on your system.
            Development mode allows you to run the latest development version from this repository. This will install esptool's dependencies and create some executable script wrappers in the user's bin directory. The wrappers will run the scripts found in the git working directory directly, so any time the working directory contents change it will pick up the new versions. It's also possible to run the scripts directly from the working directory with this Development Mode installation. (Note: if you actually plan to do development work with esptool itself, see the CONTRIBUTING.md file.).
            The merge_bin command will merge multiple binary files (of any kind) into a single file that can be flashed to a device later. Any gaps between the input files are padded with 0xFF bytes (same as unwritten flash contents). Will create a file merged-flash.bin with the contents of the other 3 files. This file can be later be written to flash with esptool.py write_flash 0x0 merged-flash.bin. Note: Because gaps between the input files are padded with 0xFF bytes, when the merged binary is written then any flash sectors between the individual files will be erased. To avoid this, write the files individually.

            Support

            Flashing problems can be fiddly to troubleshoot. Try the suggestions here if you're having problems:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install esptool

          • CLONE
          • HTTPS

            https://github.com/espressif/esptool.git

          • CLI

            gh repo clone espressif/esptool

          • sshUrl

            git@github.com:espressif/esptool.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link