[presto] rename records_on_the_day.py to main.py
This commit is contained in:
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
# Presto App Guidance
|
# Presto App Guidance
|
||||||
|
|
||||||
This directory contains MicroPython apps for the Pimoroni Presto. The main app is
|
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
|
## Context To Read First
|
||||||
|
|
||||||
- Read `README.md` before changing setup, deployment, user-facing behavior, or API response assumptions.
|
- 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/`.
|
- The root project conventions still apply, but most Phoenix/Elixir conventions are not relevant inside `presto/`.
|
||||||
|
|
||||||
## Deployment And Verification
|
## Deployment And Verification
|
||||||
@@ -18,7 +18,7 @@ mise run presto # deploy and reset
|
|||||||
Manual deployment:
|
Manual deployment:
|
||||||
|
|
||||||
```bash
|
```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 fs cp secrets.py :secrets.py
|
||||||
mpremote reset
|
mpremote reset
|
||||||
```
|
```
|
||||||
@@ -26,7 +26,7 @@ mpremote reset
|
|||||||
Syntax check (no `__pycache__`):
|
Syntax check (no `__pycache__`):
|
||||||
|
|
||||||
```bash
|
```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.
|
Do not claim device behavior is verified unless it was tested on the physical Presto.
|
||||||
|
|||||||
+14
-13
@@ -50,7 +50,7 @@ Copy the files to the root of your Presto's flash storage. You can use Thonny, `
|
|||||||
pip install mpremote
|
pip install mpremote
|
||||||
|
|
||||||
# Copy files to the Presto
|
# 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
|
mpremote fs cp secrets.py :secrets.py
|
||||||
|
|
||||||
# Reset the device to start the app
|
# 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
|
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:**
|
**Using Thonny:**
|
||||||
|
|
||||||
1. Open Thonny and select "MicroPython (Raspberry Pi Pico)" as the interpreter
|
1. Open Thonny and select "MicroPython (Raspberry Pi Pico)" as the interpreter
|
||||||
2. Open `records_on_the_day.py` and `secrets.py` in Thonny
|
2. Open `main.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`
|
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
|
4. Press the reset button on the Presto, or use Run → Send EOF / Soft Reboot
|
||||||
|
|
||||||
### 3. The app starts automatically
|
### 3. The app starts automatically
|
||||||
|
|
||||||
The Presto runs `main.py` on boot. The app will:
|
The Presto runs `main.py` on boot. The app will:
|
||||||
|
|
||||||
1. Show a startup screen
|
1. Show a startup screen
|
||||||
2. Connect to WiFi (showing progress)
|
2. Connect to WiFi (showing progress)
|
||||||
3. Sync time via NTP
|
3. Sync time via NTP
|
||||||
@@ -119,7 +120,7 @@ The Presto runs `main.py` on boot. The app will:
|
|||||||
|
|
||||||
```
|
```
|
||||||
presto/
|
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
|
config.example.py # Template for secrets.py
|
||||||
secrets.py # Your credentials (git-ignored, create from example)
|
secrets.py # Your credentials (git-ignored, create from example)
|
||||||
README.md # This file
|
README.md # This file
|
||||||
@@ -127,14 +128,14 @@ presto/
|
|||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
| Symptom | Likely cause | Fix |
|
| 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 "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 |
|
| 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 |
|
| "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 |
|
| 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 |
|
| 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 |
|
| Display is black after idle | Backlight sleep is active | Touch once to wake the display |
|
||||||
|
|
||||||
## API Endpoint
|
## API Endpoint
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
A MicroPython application for the Pimoroni Presto (RP2350B, 720x720 touch
|
||||||
display, WiFi) that connects to the Music Library API and lets you browse
|
display, WiFi) that connects to the Music Library API and lets you:
|
||||||
records by release date.
|
- browse records by release date
|
||||||
|
- search records in the collection
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
- WiFi auto-connect with retry
|
- WiFi auto-connect with retry
|
||||||
- NTP time synchronisation
|
- NTP time synchronisation
|
||||||
|
- Full text search for collection records
|
||||||
- Month calendar view with day-of-week headers
|
- Month calendar view with day-of-week headers
|
||||||
- Tap a day to see records released on that date (cover art, artist, title)
|
- Tap a day to see records released on that date (cover art, artist, title)
|
||||||
- Navigate months with arrow buttons
|
- Navigate months with arrow buttons
|
||||||
+2
-2
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
[tasks.presto]
|
[tasks.presto]
|
||||||
run = '''
|
run = '''
|
||||||
mpremote fs cp records_on_the_day.py :main.py
|
mpremote fs cp main.py :main.py
|
||||||
mpremote reset
|
mpremote reset
|
||||||
'''
|
'''
|
||||||
dir = "{{cwd}}"
|
dir = "{{cwd}}"
|
||||||
|
|
||||||
[tasks.emulator]
|
[tasks.emulator]
|
||||||
run = 'pimoroni-emulator --device presto records_on_the_day.py'
|
run = 'pimoroni-emulator --device presto main.py'
|
||||||
dir = "{{cwd}}"
|
dir = "{{cwd}}"
|
||||||
|
|||||||
Reference in New Issue
Block a user