[presto] rename records_on_the_day.py to main.py
This commit is contained in:
+4
-4
@@ -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.
|
||||
|
||||
+7
-6
@@ -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
|
||||
@@ -128,7 +129,7 @@ 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 |
|
||||
|
||||
@@ -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
|
||||
+2
-2
@@ -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}}"
|
||||
|
||||
Reference in New Issue
Block a user