Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 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
fafd624
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
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
52 changes: 52 additions & 0 deletions .github/workflows/gpad-firmware-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Increment GPAD firmware version

on:
pull_request_target:
branches: ["main"]
types: [closed]

permissions:
contents: write

jobs:
increment-version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout latest main branch
uses: actions/checkout@v4
with:
ref: main
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 merged PR
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
for attempt in 1 2 3 4 5; do
git fetch origin main
git checkout -B main origin/main
if git log --fixed-strings --grep="Bump GPAD firmware version for PR #$PR_NUMBER" --format=%H -- Firmware/GPAD_API/FIRMWARE_VERSION | grep -q .; then
echo "Version commit for PR #$PR_NUMBER already exists; nothing to commit."
exit 0
fi
python3 scripts/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 "Bump GPAD firmware version for PR #$PR_NUMBER"
if git push origin HEAD:main; then
exit 0
fi
echo "main advanced while versioning; retrying from latest main ($attempt/5)."
done
echo "Unable to push GPAD firmware version after 5 attempts." >&2
exit 1
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.0
48 changes: 29 additions & 19 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 @@ -367,7 +377,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
2 changes: 1 addition & 1 deletion Firmware/GPAD_API/GPAD_API/DFPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading