Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
319242c
Pin MQTT to Krake PubInv and clean 1-100 volume handling
nk25719 May 30, 2026
be362c2
Revert web data-file changes causing UI regressions
nk25719 May 30, 2026
a07002a
Return settings menu to main page after inactivity
nk25719 May 30, 2026
4bb3117
Add safe LittleFS diagnostics and mount failure handling
nk25719 May 30, 2026
31aead1
Remove remaining Public Shiftr broker defaults
nk25719 May 30, 2026
7f56ebf
Preserve WiFi credentials across LittleFS uploads
nk25719 May 30, 2026
23d11d9
Apply inactivity timeout to LCD icon menus
nk25719 May 30, 2026
f47d93b
Simplify fixed Krake PubInv broker handling
nk25719 May 30, 2026
a54ad0e
Bound WiFi recovery so LittleFS uploads cannot stall startup
nk25719 May 30, 2026
41c1542
fixing broker monitor visualizer dimensions.
nk25719 May 30, 2026
0cd5886
fixing broker monitor visualizer dimensions.
nk25719 May 30, 2026
60cce98
Clean GPAD web bundle and align routes
nk25719 May 31, 2026
6926d66
Merge pull request #77 from nk25719/codex/clean-and-adapt-gpad-api-da…
nk25719 May 31, 2026
aca7008
Restore GPAD binary web assets
nk25719 May 31, 2026
878ae9c
Merge branch 'codex/set-krakepubinv-as-default-broker-3alspu' into co…
nk25719 May 31, 2026
8d1c9c6
Merge pull request #78 from nk25719/codex/clean-and-adapt-gpad-api-da…
nk25719 May 31, 2026
ee781f5
Fix GPAD stylesheet source serving
nk25719 May 31, 2026
3bdb140
Merge branch 'codex/set-krakepubinv-as-default-broker-3alspu' into co…
nk25719 May 31, 2026
34fd5bc
Merge pull request #79 from nk25719/codex/clean-and-adapt-gpad-api-da…
nk25719 May 31, 2026
95b4a22
Fix Chrome access and add retained MQTT clearing
nk25719 May 31, 2026
2e94708
Merge branch 'codex/set-krakepubinv-as-default-broker-3alspu' into co…
nk25719 May 31, 2026
d16eeeb
Merge pull request #80 from nk25719/codex/clean-and-adapt-gpad-api-da…
nk25719 May 31, 2026
8f9a81e
Automate GPAD semantic version bumps after merges
nk25719 May 31, 2026
8d727d9
Merge pull request #81 from nk25719/codex/clean-and-adapt-gpad-api-da…
nk25719 May 31, 2026
3226a09
Merge pull request #76 from nk25719/codex/set-krakepubinv-as-default-…
nk25719 May 31, 2026
363143f
Bump GPAD firmware version for PR #76
github-actions[bot] May 31, 2026
fafd624
Reset LCD frames after inactivity
nk25719 May 31, 2026
b5a83fe
Reset LCD frames after inactivity
nk25719 May 31, 2026
536998b
Merge branch 'codex/set-krakepubinv-as-default-broker-3alspu' into co…
nk25719 May 31, 2026
74ee591
Merge pull request #82 from nk25719/codex/clean-and-adapt-gpad-api-da…
nk25719 May 31, 2026
fee2b47
Merge pull request #84 from nk25719/codex/set-krakepubinv-as-default-…
nk25719 May 31, 2026
ce15839
Bump GPAD firmware version for PR #84
github-actions[bot] May 31, 2026
f87e02b
Merge branch 'codex/set-krakepubinv-as-default-broker-3alspu' into co…
nk25719 May 31, 2026
a1949a0
Merge pull request #83 from nk25719/codex/clean-and-adapt-gpad-api-da…
nk25719 May 31, 2026
9fc724c
Merge pull request #85 from nk25719/codex/set-krakepubinv-as-default-…
nk25719 May 31, 2026
fcfd8a4
Bump GPAD firmware version for PR #85
github-actions[bot] May 31, 2026
7e5cf79
Add developer menu WiFi credential clear action
nk25719 May 31, 2026
016b2f8
Restore established WiFi connection flow
nk25719 May 31, 2026
03b910e
Restore main page LCD cursor selection
nk25719 May 31, 2026
ee1afa3
Merge pull request #86 from nk25719/codex/debug-and-run-the-application
nk25719 May 31, 2026
f69ea35
Bump GPAD firmware version for PR #86
github-actions[bot] May 31, 2026
d93e28d
Add infinite mute and assign firmware versions on PR open
nk25719 Jun 1, 2026
45cdddb
Clarify indefinite mute unmute behavior
nk25719 Jun 1, 2026
a0ab14b
Add explicit infinite mute menu action
nk25719 Jun 1, 2026
903b447
Add mute menu selection feedback
nk25719 Jun 1, 2026
59f5f54
Merge pull request #87 from nk25719/codex/add-infinite-muting-option-…
nk25719 Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/gpad-firmware-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Assign GPAD firmware PR version

on:
pull_request_target:
branches: ["main"]
types: [opened, reopened]

permissions:
contents: write

jobs:
assign-version:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout pull request branch
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Configure version commit identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Increment patch version and record pull request
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
set -euo pipefail
git show "$BASE_SHA:scripts/bump_gpad_firmware_version.py" > /tmp/bump_gpad_firmware_version.py
python3 /tmp/bump_gpad_firmware_version.py --pr-number "$PR_NUMBER"
if git diff --quiet -- Firmware/GPAD_API/FIRMWARE_VERSION; then
echo "Version already includes PR #$PR_NUMBER; nothing to commit."
exit 0
fi
git add Firmware/GPAD_API/FIRMWARE_VERSION
git commit -m "Assign GPAD firmware version for PR #$PR_NUMBER"
git push origin HEAD:"$HEAD_REF"
1 change: 1 addition & 0 deletions Firmware/GPAD_API/FIRMWARE_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.58.4+pr.86
62 changes: 37 additions & 25 deletions Firmware/GPAD_API/GPAD_API/DFPlayer.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#include "DFPlayer.h"
#include "gpad_utility.h"
#include "debug_macros.h"
#include "operator_settings.h"
#include "setup_status.h"
#include <DFRobotDFPlayerMini.h>

DFRobotDFPlayerMini dfPlayer;
extern HardwareSerial uartSerial2;

const int LED_PIN = 13; // Krake
const int nDFPlayer_BUSY = 4; // active LOW BUSY pin from DFPlayer
const int MIN_VOLUME_PERCENT = 1;
const int MAX_VOLUME_PERCENT = 100;
const int MIN_DFPLAYER_VOLUME = 1;
const int MAX_DFPLAYER_VOLUME = 30;

bool isDFPlayerDetected = false;
int volumeDFPlayer = 20; // Range: 1 to 30
int volumeDFPlayer = 20; // Range: 1 to 100 (%)
int numberFilesDF = 0; // Number of audio files found on SD card
extern bool currentlyMuted;
char command;
Expand Down Expand Up @@ -80,17 +86,21 @@ void checkSerial(void)

if (command == '+')
{
dfPlayer.volumeUp();
setVolume(volumeDFPlayer + 1);
saveVolumeSetting(volumeDFPlayer);
DBG_PRINT(F("Current volume: "));
DBG_PRINTLN(dfPlayer.readVolume());
DBG_PRINT(volumeDFPlayer);
DBG_PRINTLN(F("%"));
menu_opcoes();
}

if (command == '-')
{
dfPlayer.volumeDown();
setVolume(volumeDFPlayer - 1);
saveVolumeSetting(volumeDFPlayer);
DBG_PRINT(F("Current volume: "));
DBG_PRINTLN(dfPlayer.readVolume());
DBG_PRINT(volumeDFPlayer);
DBG_PRINTLN(F("%"));
menu_opcoes();
}

Expand All @@ -115,7 +125,7 @@ namespace
void delayWithYield(const unsigned long durationMs)
{
const unsigned long startMs = millis();
while ((millis() - startMs) < durationMs)
while (!millisIntervalElapsed(millis(), startMs, durationMs))
{
delay(10);
yield();
Expand All @@ -138,6 +148,7 @@ void setupDFPlayer()
DBG_PRINTLN(F("DFPlayer Mini not detected or not responding."));
DBG_PRINTLN(F("Check wiring, power, SD card, and file names."));
isDFPlayerDetected = false;
setSetupError(SETUP_ERROR_DFPLAYER);
return;
}

Expand All @@ -156,7 +167,7 @@ void setupDFPlayer()
DBG_PRINTLN(F("Warning: unusual DFPlayer state. Possible clone/module variant, continuing test."));
}

dfPlayer.volume(volumeDFPlayer);
setVolume(volumeDFPlayer);
delayWithYield(300);

numberFilesDF = dfPlayer.readFileCounts();
Expand All @@ -166,25 +177,24 @@ void setupDFPlayer()
if (numberFilesDF <= 0)
{
DBG_PRINTLN(F("Warning: no audio files detected. Use FAT32 SD card and files like 0001.mp3, 0002.mp3."));
setSetupError(SETUP_ERROR_DFPLAYER_FILES);
}

DBG_PRINTLN(F("DFPlayer startup test: playing track 1."));
dfPlayer.play(1);
delayWithYield(3000); // Give enough time to hear output without starving the scheduler/WDT.

displayDFPlayerStats();
menu_opcoes();
// Do not play a startup track or run slow diagnostic queries during setup.
// The device remains available even if optional audio hardware is missing.
DBG_PRINTLN(F("DFPlayer initialized without blocking startup playback."));
}

void setVolume(int oneToThirty)
void setVolume(int oneToHundred)
{
if (oneToThirty < 1) oneToThirty = 1;
if (oneToThirty > 30) oneToThirty = 30;
if (oneToHundred < MIN_VOLUME_PERCENT) oneToHundred = MIN_VOLUME_PERCENT;
if (oneToHundred > MAX_VOLUME_PERCENT) oneToHundred = MAX_VOLUME_PERCENT;

volumeDFPlayer = oneToThirty;
volumeDFPlayer = oneToHundred;
const int dfpVolume = map(volumeDFPlayer, MIN_VOLUME_PERCENT, MAX_VOLUME_PERCENT, MIN_DFPLAYER_VOLUME, MAX_DFPLAYER_VOLUME);
if (isDFPlayerDetected)
{
dfPlayer.volume(volumeDFPlayer);
dfPlayer.volume(dfpVolume);
}
}

Expand Down Expand Up @@ -318,20 +328,20 @@ void playNotBusy()
}
}

void playNotBusyLevel(int level)
bool playNotBusyLevel(int level)
{
if (!isDFPlayerDetected) return;
if (!isDFPlayerDetected) return false;

if (currentlyMuted)
{
DBG_PRINTLN(F("Muted: skipping DFPlayer playback."));
return;
return false;
}

if (level <= 0)
if (level <= 0)
{
DBG_PRINTLN(F("Silent level: skipping DFPlayer playback."));
return;
return false;
}

DBG_PRINTLN(F("playNotBusyLevel"));
Expand All @@ -343,15 +353,17 @@ void playNotBusyLevel(int level)
else
{
DBG_PRINTLN(F("DFPlayer is still busy/playing."));
return false;
}

if (dfPlayer.available())
{
printDetail(dfPlayer.readType(), dfPlayer.read());
}

if (!isDFPlayerDetected) return;
if (!isDFPlayerDetected) return false;

return true;
}

bool playAlarmLevel(int alarmNumberToPlay)
Expand All @@ -367,7 +379,7 @@ bool playAlarmLevel(int alarmNumberToPlay)
static unsigned long timer = 0;
const unsigned long delayPlayLevel = 100;

if (millis() - timer <= delayPlayLevel)
if (!millisIntervalElapsed(millis(), timer, delayPlayLevel + 1))
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions Firmware/GPAD_API/GPAD_API/DFPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void displayDFPlayerStats();

bool playAlarmLevel(int alarmNumberToPlay);
void playNotBusy();
void playNotBusyLevel(int level);
bool playNotBusyLevel(int level);
void dfPlayerUpdate(void);

void printDetail(uint8_t type, int value);
Expand All @@ -21,7 +21,7 @@ void checkSerial(void);
void menu_opcoes();
void serialSplashDFP();

void setVolume(int oneToThirty);
void setVolume(int oneToHundred);

extern int volumeDFPlayer;
extern int numberFilesDF;
Expand Down
Loading