google_photos: a connect page that explains itself; -m stays up on micropython.exe - #144
Merged
Merged
Conversation
…by itself; -m stays up on micropython.exe Connect page: three plain steps (scan, pick, tap Done - this screen moves on by itself), a live 'Waiting for your picks... 0:07' line, and buttons that name what they do: Open on this PC (desktop only), New link, Back. Back after PICK now puts the old list back (engine.snapshot/put_back) instead of landing on an empty one. Portrait stacks; landscape puts the QR beside the text. The link is printed once per new session. A leftover session restored from prefs is no longer drawn or printed while the new one is being created - that was the 'second link' in #143; create_session runs once per start. #142: micropython.exe can't read its command line on pydevices <= 0.5.0, so the launcher also recognises -m from sys.argv on MicroPython. The launcher no longer clears PYDEVICES_WIDTH/HEIGHT when its own panel size is None, so screenshot.py --resolution works on this example.
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The connect page now tells you what to do: scan with your phone, pick photos in Google Photos, tap Done, and this screen moves on by itself. A green line under the QR counts up (`Waiting for your picks... 0:07`) so you can see it's still listening. The buttons say what they do: Open on this PC (desktop only), New link, and Back. Back after PICK now puts your old list back. Before, it disappeared as soon as the new session arrived.
I checked the layout with screenshots at 320x480, 240x320, 480x320, 320x240 and 800x480. Portrait panels stack everything, and landscape panels put the QR beside the text.
#143: one session per start, not two. I counted `create_session()` calls. With a mocked engine it's one on a fresh start, one on a start with a leftover session in prefs, one per PICK and one per New link. Against the real API it's one `POST /sessions` on each of two starts. The "second link" was the previous run's session, restored from prefs and printed when the page first drew, before the new one arrived. The page now waits for the new session instead of drawing the old one, and the link is printed once, when Google hands out a new session. Closes #143.
#142: micropython.exe -m exits after ~2 s. `_hostloop.batch()` can't read the command line on micropython.exe, because it decodes it with a `utf-16-le` codec MicroPython doesn't have (fixed at the root in PyDevices/pydevices#63). So the launcher also recognises `-m` from `sys.argv` on MicroPython, and holds with `multimer.auto.sleep_ms`. On main, `micropython.exe -m examples.google_photos` returns after 1.7 s. With this branch it was still up after 32 s and Windows reported `Responding: True`. Linux micropython and CPython still stay up. Closes #142.
One small fix on the side: the launcher no longer blanks `PYDEVICES_WIDTH`/`HEIGHT` when its own panel size is `None`, so `tools/screenshot.py --resolution` works on this example.