pybytes Refresh Folder Hierarchy is missing files
I haven't touched several devices for months. I went in to update code and saw that there was firmware updates available. I was previously on 1.21.1 r1(?) and upgraded to 1.21.2.rc3
I think this problem existed before the update.. but all of my library files are missing from the /lib/ folder. Only boot.py and main.py exist
The devices are remote, so I wasn't able to plug directly and test.
but I went to Pybytes Terminal and ran these commands:
f='lib/nets.py' d=open(f,'w') d.write('Hello') d.close()
after executing these commands, and refreshed my folder heirarchy, the files reappeared and most of them had the original contents (the line 'Hello' not visible anywhere in the code).
What could be causing this to happen? Is there a better, safer way to get the files to be visible again? Preferably one that doesn't require me to manually retype the filenames?
@jirkakrepl What did you find out?
jirkakrepl last edited by
Hi @dnear1 we fixed it and deployed the fix today. Can you check again, please?
Hi @dnear1. We are working on it. You can expect a Pybytes update soon, with the fix for that problem. Thank you
I saw that there was an updated firmware release and pybytes.pycom.io UI requested a reload. So I flashed one of my units to this latest firmware to see if the problems were resolved (nothing related noted in the release notes).
Still have the same issue. I chose FatFS and Format during the Pycom firmware update routine and installed 1.20.2rc6
After format, I was still seeing all of the old files and file content listed in the browser until I clicked Refresh hierarchy. Afterwards, they disappeared, but switching to main.py and downloading, the old files would reappear in the browser.
Possibly related to my problem.
If I go in and select a file to edit in the UI, and then upload the change, maybe it goes thru. Then this is where it starts to get wierd.
After the upload completes, if I continue to make changes and click upload again (without re-selecting the appropriate file again), on the next "upload", it appears to be making a copy of itself in another location. Every now and then, I can see this in the folder hierarchy as shown /flash/flash/flash/lib.
When I click refresh hierarchy, those oddities disappear. But as noted previously, the 'original' file was unchanged. Maybe something amiss in the flashfs operations?
jirkakrepl last edited by
thanks for this extensive testing and bug report.
We're going to take a look at this.
While updating several units, I was nearly finished or did finish. They even started pushing data thru LoRa and were picked up on TheThingsNetwork.
Next thing I knew, they went offline, for about 10 minutes or so.
Finally popped back online. Flash completely blanked out. Every library file gone, and main.py back to factory default.
Even further studying of the issue, it seems there's at least 3 versions of code stored in the browser cache or UI. One gets presented when the device is offline but you click on the code. Another gets displayed when the device is online, and a third when you actually click 'download'.
After dozens of tests of changing, refreshing the browser and downloading/uploading, I've been able to get my devices working by doing this:
first, go to main.py and replace all of the code with
This stops the pycom from crashing and doing odd things while trying to patch my library files
after I upload that, I click another file, wait for that to display, then click back to main.py. Once the Pycom comes back online, it brings up the code that existed pre-wipe. If I click "Download" again, it changes back to #Wiped and seems to remain that way even when I click back to another file and click back to this one. If some of my library files were missing from the heirarchy, I edited main.py with commands to open, write and close each file that needed to be added. I then started back over above to wipe main.py and verify it was wiped before altering any of the library files.
I then repeated this with all of my library files. re-loading the correct source code, clicking upload, waiting for it to come online, then click Download to ensure the code is updated, then go to the next. After was able to re-upload all the libaries and verify the correct code downloaded, I went back to my main.py and loaded the correct source. It's finally back online and sending valid data to LoRa.
Probing further, it seems like it's maybe a firmware issue.
If I edit a file and upload it via Pybytes, then refresh hierarchy and select the file again, the change is gone.
Looking at other posts, I typed this into the pybytes terminal
os.fsformat('/flash/) import machine machine.reset()