Pymakr VS Code: Only sync changed files
-
When pressing Upload in the Pymakr plugin all files in the project is uploaded and that takes some time. What about storing a hash of all files, finding all files with changes since last sync and only upload changed files? (and maybe also delete removed files)
Johan
-
@johand Thanks for the info, I'm able to reproduce the issue. There's indeed a problem in the upload feature, which has been solved in the latest versions of Atom. The VSC plugin is a bit behind code wise. We're working on a refactor of the Atom upload feature right now, when that's done we'll upgrade VSC as well to be up to date with it. That'll solve this issue.
For now either be a bit patient with uploading with VSC or temporarily switch to Atom for this project. Sorry for the inconvenience!
-
@ralph
I can reproduce by creating a folder named "SerialProtocols", in this folder, place an empty file called init.py ([underscore][underscore]init[underscore][underscore].py)
-
@johand I guess something in your project is causing the pymakr status file on the board to not be written properly (its the last thing it writes when uploading). What you could do is try to narrow down on which file is causing the issue by copying a few files from your original project to your simple test project, upload to the board and check if it starts failing. If it doesn't, copy a few more files into the test project, and repeat, until it starts failing.
If you manage to find when/where it starts to go wrong, send me that file and I'll check if I can reproduce the issue and then fix it.
-
@ralph
VS Code 1.22.1
Pymakr 0.1.7
WiPy3 1.17.3.b1Everything works as expected in my project, so I guess everything is uploaded correctly.
I created a simple test project now and that works as expected, so there must be something wrong with my project. Any way to debug the upload process?
Johan
-
@johand Can you tell me which versions of atom and pymakr you are running? And which hardware and firmware-version you are running? If all of those versions are up to date, it should definitely work properly. Are all the files uploaded properly, even though it says 'upload failed' at the end? Try running
os.mkfs('/flash')
on the board once, in case something went wrong with the permissions of the project status file.
-
I just tried doing a safe boot before upload, but that didn´t help.
After upload is done I always get the message:
Upload failed. Please reboot your device manually.Is this why I have to sync all files? How can I prevent this problem?
-
That is exactly what pymakr does, if it is always syncing all the files this is because it has for one reason or another failed to read the previous hashes from the device. Try safe booting the device before uploading and see if that fixes the issue