Closed ZweiEuro closed 3 years ago
Hi @ZweiEuro, after re-uploading the partition table and new application, have you also uploaded the SPIFFS partition binary? Or is your intention to start from an empty SPIFFS partition?
@igrr I wanted to start with an all new spiffs since erase_flash just erases everything. My fault though was in esp_vgs_spiffs_conf_t .format_if_mount_failed was false, after changing it to true it works again. (Sorry that issue must've sounded serious )
I am still kinda bummed that I can't use the otatool to free the otadata but still, I now have a way to reset the whole chip if something fails
@ZweiEuro thanks for confirming that the SPIFFS part works. I've reopened the issue so that we can track fixing the otatool failure.
Hi @ZweiEuro.
cd components/app_update/
./otatool.py
At this point, do you have $IDF_PATH
set? (i.e. echo $IDF_PATH
shows a correct path)
Does the following command work for you (and points to the right IDF_PATH)?
python -c 'import os; print(os.path.expandvars(os.path.join("$IDF_PATH", "components")))'
@dobairoland
yes, IDF Path shows correctly where i have installed the esp-idf ( in my case /home/zweieuro/Documents/tools/esp-idf
)
python -c 'import os; print(os.path.expandvars(os.path.join("$IDF_PATH", "components")))'
returns
/home/zweieuro/Documents/tools/esp-idf/components
Trying to use an otatool command directly (previously iwas trying it from the ota_example script):
command reconstructed from https://github.com/espressif/esp-idf/blob/master/examples/system/ota/otatool/otatool_example.sh
./otatool.py -q --port /dev/ttyUSB0 erase_otadata
Running /home/zweieuro/.espressif/python_env/idf4.0_py3.8_env/bin/python /home/zweieuro/Documents/tools/esp-idf/components/esptool_py/esptool/esptool.py --port /dev/ttyUSB0 read_flash 32768 3072 /tmp/tmpicmy629e...
/home/zweieuro/.espressif/python_env/idf4.0_py3.8_env/bin/python: can't open file '/home/zweieuro/Documents/tools/esp-idf/components/esptool_py/esptool/esptool.py': [Errno 2] No such file or directory
An exception: ** Command '['/home/zweieuro/.espressif/python_env/idf4.0_py3.8_env/bin/python', '/home/zweieuro/Documents/tools/esp-idf/components/esptool_py/esptool/esptool.py', '--port', '/dev/ttyUSB0', 'read_flash', '32768', '3072', '/tmp/tmpicmy629e']' returned non-zero exit status 2. ** occurred in _call_esptool.
Traceback (most recent call last):
File "./otatool.py", line 388, in <module>
main()
File "./otatool.py", line 339, in main
target = OtatoolTarget(**target_args)
File "./otatool.py", line 56, in __init__
self.target = ParttoolTarget(port, baud, partition_table_offset, partition_table_file, esptool_args,
File "/home/zweieuro/Documents/tools/esp-idf/components/partition_table/parttool.py", line 112, in __init__
self._call_esptool(["read_flash", str(partition_table_offset), str(gen.MAX_PARTITION_LENGTH), temp_file.name])
File "/home/zweieuro/Documents/tools/esp-idf/components/partition_table/parttool.py", line 139, in _call_esptool
raise e
File "/home/zweieuro/Documents/tools/esp-idf/components/partition_table/parttool.py", line 136, in _call_esptool
subprocess.check_call(esptool_args, stdout=out, stderr=subprocess.STDOUT)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/zweieuro/.espressif/python_env/idf4.0_py3.8_env/bin/python', '/home/zweieuro/Documents/tools/esp-idf/components/esptool_py/esptool/esptool.py', '--port', '/dev/ttyUSB0', 'read_flash', '32768', '3072', '/tmp/tmpicmy629e']' returned non-zero exit status 2.
Which reads like esptool wasn't installed properly?
@ZweiEuro The esptool issue is probably caused by not initializing the submodules. git submodule update --init --recursive
should help.
@dobairoland after running your command and retrying
./otatool.py -q --port /dev/ttyUSB0 erase_otadata
I still get:
Traceback (most recent call last):
File "./otatool.py", line 29, in <module>
from parttool import PartitionName, PartitionType, ParttoolTarget, PARTITION_TABLE_OFFSET
ModuleNotFoundError: No module named 'parttool'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./otatool.py", line 35, in <module>
from parttool import PartitionName, PartitionType, ParttoolTarget, PARTITION_TABLE_OFFSET
ModuleNotFoundError: No module named 'parttool'
@ZweiEuro I'm sorry that I cannot give you a straight solution but this is new to me as well.
Can I ask you to try to run idf.py python-clean
and see if it helps?
I can run your command successfully for IDFv4.0 you are using.
I no longer have access to the system that produced this error; Sorry but I can't debug this further (something else completley broke) Should I leave this issue open or close it ? @dobairoland
Thank you @ZweiEuro for the feedback. Yes, I'm closing this issue because I cannot reproduce it. Feel free to create a new one if you encounter this again.
Environment
Development Kit: ESP32 Devkit V1 -Doit (I think, it's soldered i can't look at it anymore) here
Kit version -
Module or chip used: ESP32-WROOM-32
IDF version (run
git describe --tags
to find it): framework-espidf 3.40001.200521 (4.0.1) (PIO)Build System: platformio
Compiler version (run
xtensa-esp32-elf-gcc --version
to find it): xtensa-esp32-elf-gcc (crosstool-NG esp-2019r2) 8.2.0Operating System: Linux
Using an IDE?: Vscode platformio
Power Supply: USB
Problem Description
Wrote OTA example native into my program, tried it out, succeeded. But then i couldn't upload locally anymore since it kept using the OTA'd version.
Parttool just straight up refuses to start (yes I have followed the instructions for installation trice and thoroughly) it keeps saying some py files are missing. Running:
following everything from otatool at https://github.com/espressif/esp-idf/tree/master/examples/system/ota/otatool
Result: Traceback (most recent call last): File "./otatool.py", line 29, in
from parttool import PartitionName, PartitionType, ParttoolTarget, PARTITION_TABLE_OFFSET
ModuleNotFoundError: No module named 'parttool'
Which of course causes https://github.com/espressif/esp-idf/tree/master/examples/system/ota/otatool to fail as well. With the same error.
So now i am stuck with a chip i can't change since the version on the ota doesn't have the ota yet.
So i tried using esptool to reset the whole thing with erase_flash and then re-> uploading with a partition table and the firmware.
Now it boots from the new firmware but produces this for spiffs: esp_err_t ret = esp_vfs_spiffs_register(&spiffs_conf); returns ESP_FAIL
and now i am stuck with a dead chip.
did OTA overwrite something ciritcal?