From 56fb7e590d66336ccb4a79eff5f091fc7fcefe1a Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sun, 10 May 2026 19:54:27 +0100 Subject: [PATCH] [presto] rename records_on_the_day.py to main.py --- presto/AGENTS.md | 8 +++---- presto/README.md | 27 ++++++++++++----------- presto/{records_on_the_day.py => main.py} | 8 ++++--- presto/mise.toml | 4 ++-- 4 files changed, 25 insertions(+), 22 deletions(-) rename presto/{records_on_the_day.py => main.py} (99%) diff --git a/presto/AGENTS.md b/presto/AGENTS.md index 01e9f3aa..9fbd87f7 100644 --- a/presto/AGENTS.md +++ b/presto/AGENTS.md @@ -1,12 +1,12 @@ # Presto App Guidance This directory contains MicroPython apps for the Pimoroni Presto. The main app is -`records_on_the_day.py`, deployed to the device as `main.py`. +`main.py`, deployed to the device as `main.py`. ## Context To Read First - Read `README.md` before changing setup, deployment, user-facing behavior, or API response assumptions. -- Read `records_on_the_day.py` before changing layout, touch handling, networking, display sleep, or performance-sensitive code. +- Read `main.py` before changing layout, touch handling, networking, display sleep, or performance-sensitive code. - The root project conventions still apply, but most Phoenix/Elixir conventions are not relevant inside `presto/`. ## Deployment And Verification @@ -18,7 +18,7 @@ mise run presto # deploy and reset Manual deployment: ```bash -mpremote fs cp records_on_the_day.py :main.py +mpremote fs cp main.py :main.py mpremote fs cp secrets.py :secrets.py mpremote reset ``` @@ -26,7 +26,7 @@ mpremote reset Syntax check (no `__pycache__`): ```bash -python3 -c "import py_compile; py_compile.compile('records_on_the_day.py', cfile='/tmp/records_on_the_day.pyc', doraise=True)" +python3 -c "import py_compile; py_compile.compile('main.py', cfile='/tmp/main.pyc', doraise=True)" ``` Do not claim device behavior is verified unless it was tested on the physical Presto. diff --git a/presto/README.md b/presto/README.md index 018826b0..fc8f088f 100644 --- a/presto/README.md +++ b/presto/README.md @@ -50,7 +50,7 @@ Copy the files to the root of your Presto's flash storage. You can use Thonny, ` pip install mpremote # Copy files to the Presto -mpremote fs cp records_on_the_day.py :main.py +mpremote fs cp main.py :main.py mpremote fs cp secrets.py :secrets.py # Reset the device to start the app @@ -63,18 +63,19 @@ After `secrets.py` has been copied to the device once, you can redeploy the app mise run presto ``` -This copies `records_on_the_day.py` to `:main.py` and resets the device; it does not copy `secrets.py`. +This copies `main.py` to `:main.py` and resets the device; it does not copy `secrets.py`. **Using Thonny:** 1. Open Thonny and select "MicroPython (Raspberry Pi Pico)" as the interpreter -2. Open `records_on_the_day.py` and `secrets.py` in Thonny -3. Use File → Save Copy → Raspberry Pi Pico to save `records_on_the_day.py` as `main.py` and `secrets.py` as `secrets.py` +2. Open `main.py` and `secrets.py` in Thonny +3. Use File → Save Copy → Raspberry Pi Pico to save `main.py` as `main.py` and `secrets.py` as `secrets.py` 4. Press the reset button on the Presto, or use Run → Send EOF / Soft Reboot ### 3. The app starts automatically The Presto runs `main.py` on boot. The app will: + 1. Show a startup screen 2. Connect to WiFi (showing progress) 3. Sync time via NTP @@ -119,7 +120,7 @@ The Presto runs `main.py` on boot. The app will: ``` presto/ - records_on_the_day.py # Application source, deployed to the device as main.py + main.py # Application source, deployed to the device as main.py config.example.py # Template for secrets.py secrets.py # Your credentials (git-ignored, create from example) README.md # This file @@ -127,14 +128,14 @@ presto/ ## Troubleshooting -| Symptom | Likely cause | Fix | -|---------|-------------|-----| -| Stuck on "secrets.py not found" | `secrets.py` not on the device | Copy `config.example.py` to `secrets.py` and deploy it | -| Stuck on "WiFi connection failed" | Wrong SSID/password, or network down | Check `secrets.py` credentials; verify network is up | -| "Could not reach server" on day tap | API token invalid, or server down | Check `API_TOKEN` in `secrets.py`; verify the server is running | -| Images show as grey rectangles | JPEG decoder not available, or image URLs unreachable | Check firmware version; ensure Presto has internet access | -| Touch not responding | Firmware touch API mismatch | Try updating Presto firmware to the latest version | -| Display is black after idle | Backlight sleep is active | Touch once to wake the display | +| Symptom | Likely cause | Fix | +| ----------------------------------- | ----------------------------------------------------- | --------------------------------------------------------------- | +| Stuck on "secrets.py not found" | `secrets.py` not on the device | Copy `config.example.py` to `secrets.py` and deploy it | +| Stuck on "WiFi connection failed" | Wrong SSID/password, or network down | Check `secrets.py` credentials; verify network is up | +| "Could not reach server" on day tap | API token invalid, or server down | Check `API_TOKEN` in `secrets.py`; verify the server is running | +| Images show as grey rectangles | JPEG decoder not available, or image URLs unreachable | Check firmware version; ensure Presto has internet access | +| Touch not responding | Firmware touch API mismatch | Try updating Presto firmware to the latest version | +| Display is black after idle | Backlight sleep is active | Touch once to wake the display | ## API Endpoint diff --git a/presto/records_on_the_day.py b/presto/main.py similarity index 99% rename from presto/records_on_the_day.py rename to presto/main.py index 14ed8c54..4741e9f7 100644 --- a/presto/records_on_the_day.py +++ b/presto/main.py @@ -1,13 +1,15 @@ """ -Presto Music Library - Records On This Day Calendar +Presto Music Library =================================================== A MicroPython application for the Pimoroni Presto (RP2350B, 720x720 touch -display, WiFi) that connects to the Music Library API and lets you browse -records by release date. +display, WiFi) that connects to the Music Library API and lets you: +- browse records by release date +- search records in the collection Features: - WiFi auto-connect with retry - NTP time synchronisation + - Full text search for collection records - Month calendar view with day-of-week headers - Tap a day to see records released on that date (cover art, artist, title) - Navigate months with arrow buttons diff --git a/presto/mise.toml b/presto/mise.toml index 39be36fc..3921f99a 100644 --- a/presto/mise.toml +++ b/presto/mise.toml @@ -5,11 +5,11 @@ [tasks.presto] run = ''' -mpremote fs cp records_on_the_day.py :main.py +mpremote fs cp main.py :main.py mpremote reset ''' dir = "{{cwd}}" [tasks.emulator] -run = 'pimoroni-emulator --device presto records_on_the_day.py' +run = 'pimoroni-emulator --device presto main.py' dir = "{{cwd}}"