OSError: error renaming file when OTA UPDATE
Re: Error at OTA Update
I have this error:
Traceback (most recent call last):
File "main.py", line 32, in <module>
File "/flash/lib/OTA.py", line 80, in update
OSError: error renaming file '/flash/lib/new_config.py.new' to '/flash/lib/new_config.py'
Pycom MicroPython 1.18.2.r1 [v1.8.6-849-d6b3616] on 2019-02-22; LoPy4 with ESP32
Type "help()" for more information.
any ideas for the solution?
@robert-hh ah ok thanks for the explanation.
Thank you at all
I will try booth solutions 👌👌
robert-hh last edited by
@Francesco123 os is the alias to uos. Just using uos instead should not change anything. One common reason why rename fails is, that the target name exists. So an attempt to erase the new name first is helpful, like:
try: os.remove(_newname) except OSError: pass os.rename(_oldname, _newname)
obviously you have to import:
try and let me know
Hello, I have the same problem on multiple lopy.
Sometimes it runs, sometimes not...
After a unsuccessful try I erase the _old files and try again.