Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

software.py can't get user apps. #404

Open
sbot50 opened this issue Mar 8, 2023 · 6 comments
Open

software.py can't get user apps. #404

sbot50 opened this issue Mar 8, 2023 · 6 comments

Comments

@sbot50
Copy link

sbot50 commented Mar 8, 2023

Software.py tries to use os.listdir("apps") to list all the user apps in the apps folder, the problem with this is that said folder is never generated on the smartwatch itself.

Does anyone else have this problem?

Watch: PineTime
Wasp-os version: https://github.com/wasp-os/wasp-os/actions/runs/4310694500
Wasp-os Bootloader: latest from the releases tab

@sbot50
Copy link
Author

sbot50 commented Mar 8, 2023

It's also not just apps from this repo, adding my own apps to ./wasp-os/wasp/apps and then building from scratch gives the same result, same for adding it to ./wasp-os/apps

@sbot50
Copy link
Author

sbot50 commented Mar 8, 2023

Update: adding the folder itself and then file into it using eval to the watch makes it work, but isnt ideal.

@fgaz
Copy link
Member

fgaz commented Mar 8, 2023

Why isn't it ideal? What do you suggest? I think it's mostly just a documentation problem, and #392 fixes that. #403 instead makes it possible to customize the image itself, do you think that would be better?

@sbot50
Copy link
Author

sbot50 commented Mar 9, 2023

Why isn't it ideal? What do you suggest? I think it's mostly just a documentation problem, and #392 fixes that. #403 instead makes it possible to customize the image itself, do you think that would be better?

Well why doesnt it check for the files in the main 'flash' dir instead, or just generate the 'apps' automatically

#392 ye ik about uploading as .mpy and then adding a line to main.py to upload it to ram, but i really dont want that.

#403 same day as this post i found out by looking at the source how to add apps to the binary through the manifest file and aoftware.py, tho #403 still seems like a great tool.

@beardeddude
Copy link
Contributor

beardeddude commented Mar 9, 2023

It only checks the app dir because the simulator and the os on the watch itself both share the same code. From the simulator's perspective that is where the apps should be. I agree it would be more user friendly if the dir was created automatically and I think that is what should be happening when you upload via wasptool. If you look at the upload methods near the end of the wasptool file there is code to do just that ( lines 313 and 355 ). But I can confirm that it does not seem to work for me either.

Hopefully #403 will be adopted and that will make flash apps less necessary. In my experience for an app of any real size to work it needs to be frozen into the firmware. Even loading a small .mpy from flash uses most of the system's ram.

@drtonyr
Copy link
Contributor

drtonyr commented Oct 8, 2023

Hopefully #403 will be adopted and that will make flash apps less necessary. In my experience for an app of any real size to work it needs to be frozen into the firmware. Even loading a small .mpy from flash uses most of the system's ram.

#403 has been adopted and working well for some time now - thanks!

As you say, "for an app of any real size to work it needs to be frozen into the firmware. Even loading a small .mpy from flash uses most of the system's ram.". The logical conclusion is that we have to look at RAM usage before putting any more effort into loading mpy from /flash. I see about 24448 bytes free in safe mode, but boot normally and I have about 8176 bytes free. If we chose to change things so that there is more memory free on normal boot then (and only then) does it make sense to be loading from /flash (SPI). If I get the time I'd love to find out where the memory goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants