Skip to content

Commit 652ffda

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents b3f0911 + 9932150 commit 652ffda

17 files changed

+527
-235
lines changed

CheatSheet.pdf

504 Bytes
Binary file not shown.

README.md

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ Firmware features include
2424
- Automatic refill timer, automatic alarm mute timer (both optional)
2525
- support for door switches for playing sounds when opening/closing the car doors
2626
- [wireless communication](#bttf-network-bttfn) with [Time Circuits Display](https://tcd.out-a-ti.me); used for synchronized time travels, alarm, night mode, fake power and remote control through TCD keypad
27-
- [music player](#the-music-player): Play mp3 files located on an SD card [requires TCD connected wirelessly for control]
27+
- [music player](#the-music-player): Play mp3 files located on an SD card [requires TCD connected wirelessly or HA/MQTT for control]
2828
- [SD card](#sd-card) support for custom audio files for effects, and music for the Music Player
2929
- advanced network-accessible [Config Portal](#the-config-portal) for setup (http://gauges.local, hostname configurable)
3030
- [Home Assistant](#home-assistant--mqtt) (MQTT 3.1.1) support
3131
- built-in OTA installer for firmware updates and audio files
3232

3333
## Firmware Installation
3434

35-
If a previous version of the Dash Gauges firmware is installed on your device's ESP32, you can update easily using the pre-compiled binary. Enter the [Config Portal](#the-config-portal), click on "Update" and select the pre-compiled binary file provided in this repository ([install/dashgauges-A10001986.ino.nodemcu-32s.bin](https://github.com/realA10001986/Dash-Gauges/blob/main/install/dashgauges-A10001986.ino.nodemcu-32s.bin)).
35+
If a previous version of the Dash Gauges firmware is installed on your device's ESP32, you can update easily using the pre-compiled binary. Enter the [Config Portal](#the-config-portal), click on "Update" and select the pre-compiled binary file provided in this repository ([install/dashgauges-A10001986.ino.nodemcu-32s.bin](https://github.com/realA10001986/Dash-Gauges/blob/main/install/dashgauges-A10001986.ino.nodemcu-32s.bin)) in the top file selector.
3636

3737
If you are using a fresh ESP32 board, please see [dashgauges-A10001986.ino](https://github.com/realA10001986/Dash-Gauges/blob/main/dashgauges-A10001986/dashgauges-A10001986.ino) for detailed build and upload information, or, if you don't want to deal with source code, compilers and all that nerd stuff, go [here](https://install.out-a-ti.me) and follow the instructions.
3838

@@ -42,7 +42,7 @@ If you are using a fresh ESP32 board, please see [dashgauges-A10001986.ino](http
4242

4343
The firmware comes with a sound-pack which needs to be installed separately. The sound-pack is not updated as often as the firmware itself. If you have previously installed the latest version of the sound-pack, you normally don't have to re-install it when you update the firmware. Only if the "Empty" LED signals "SOS" (three short blinks, three long blinks, three short blinks) during boot, a re-installation/update is needed.
4444

45-
The first step is to download "install/sound-pack-xxxxxxxx.zip" and extract it. It contains one file named "DGA.bin".
45+
The first step is to download "install/sound-pack-dgXX.zip" and extract it. It contains one file named "DGA.bin".
4646

4747
Then there are two alternative ways to proceed. Note that both methods *require an SD card*.
4848

@@ -176,16 +176,10 @@ As mentioned, the Dash Gauges are an add-on for a Time Circuits Display. Their b
176176

177177
There is little to play with when the Dash Gauges aren't connected to a TCD:
178178
- To quickly trigger the "empty" sequence, flip the side switch of your Dash Gauges. To "refill", flip that switch again.
179-
- Press the time travel button to trigger a simple "surge" sequence.
179+
- Press the time travel button to trigger a simple "surge" sequence. The time travel button is located behind the "Primary" gauge on the rear of the Control Board, next to the SD card reader; you can also connect an [external button](Hardware.md#connecting-a-time-travel-button).
180180

181181
The Dash Gauges are way more fun when other props (TCD, FC, SID) are present as well. The TCD is of special importance: When connected through BTTFN, the TCD can act as a remote control for the Dash Gauges.
182182

183-
## Time travel
184-
185-
To trigger a "time travel" stand-alone, you need to install a "Time Travel" button. Pressing that button briefly will let the Dash Gauges play their time travel sequence. Please see [here](hardware/#connecting-a-time-travel-button) for how to wire that button.
186-
187-
Other ways of triggering a time travel are available if a [Time Circuits Display](#connecting-a-time-circuits-display) is connected.
188-
189183
## SD card
190184

191185
Preface note on SD cards: For unknown reasons, some SD cards simply do not work with this device. For instance, I had no luck with Sandisk Ultra 32GB and "Intenso" cards. If your SD card is not recognized, check if it is formatted in FAT32 format (not exFAT!). Also, the size must not exceed 32GB (as larger cards cannot be formatted with FAT32). Transcend, Sandisk Industrial, Verbatim Premium and Samsung Pro Endurance SDHC cards work fine in my experience.
@@ -209,17 +203,17 @@ Your replacements need to be put in the root (top-most) directory of the SD card
209203

210204
The firmware supports some additional user-provided sound effects, which it will load from the SD card. If the respective file is present, it will be used. If that file is absent, no sound will be played.
211205

212-
- "key1.mp3", "key3.mp3", "key4.mp3", "key6.mp3", "key7.mp3", "key9.mp3": Will be played when you type 900x (x being 1, 3, 4, 6, 7 or 9) on the TCD (connected through BTTFN).
206+
- "key1.mp3" - "key9.mp3": Will be played when you type 900x (x being 1, 3, 4, 6, 7 or 9) or 950x (1-9) on the TCD (connected through BTTFN).
213207

214-
> The seemingly odd numbering is because of synchronicity with other props, especially the TCD and its keymap where the Music Player occupies keys 2, 5, 8.
208+
> The seemingly odd numbering for the 900x range is because of synchronicity with other props, especially the TCD and its keymap where the Music Player occupies keys 2, 5, 8. Likewise, 9002, 9005 and 9008 control the Dash Gauges' Music Player (prev, play/stop, next).
215209
216210
Those files are not provided here. You can use any mp3, with a bitrate of 128kpbs or less.
217211

218212
### Installing Custom & Replacement Audio Files
219213

220214
Replacements and custom sounds can either be copied to the SD card using a computer, or uploaded through the Config Portal.
221215

222-
Uploading through the Config Portal works exactly like [installing the default audio files](#sound-pack-installation); on the main menu, click "UPDATE". Afterwards choose one or more mp3 files to upload using the bottom file selector, and click "UPLOAD". The firmware will store the uploaded mp3 files on the SD card.
216+
Uploading through the Config Portal works exactly like [installing the sound-pack](#sound-pack-installation); on the main menu, click "UPDATE". Afterwards choose one or more mp3 files to upload using the bottom file selector, and click "UPLOAD". The firmware will store the uploaded mp3 files on the SD card.
223217

224218
In order to delete a file from the SD card, upload a file whose name is prefixed with "delete-". For example: To delete "key3.mp3" from the SD card, upload a file named "delete-key3.mp3"; the file's contents does not matter, so it's easiest to use a newly created empty file. The firmware detects the "delete-" part and, instead of storing the uploaded file, it throws it away and deletes "key3.mp3" from the SD card.
225219

@@ -243,7 +237,7 @@ By default, the songs are played in order, starting at 000.mp3, followed by 001.
243237

244238
Entering 9888 followed by OK re-starts the player at song 000, and 9888xxx (xxx = three-digit number) jumps to song #xxx.
245239

246-
See [here](#remote-control-reference) for a list of controls of the music player.
240+
See [here](#tcd-remote-command-reference) for a list of controls of the music player.
247241

248242
While the music player is playing music, other sound effects are disabled/muted. Initiating a time travel stops the music player. The TCD-triggered alarm will, if so configured, sound and stop the music player.
249243

@@ -287,7 +281,7 @@ You can use BTTF-Network and MQTT at the same time, see [below](#home-assistant-
287281
</tr>
288282
<tr><td>Function</td><td>Code on TCD</td></tr>
289283
<tr>
290-
<td align="left">"Refill"</td>
284+
<td align="left">"Refill"<sup>1</sup></td>
291285
<td>009&#9166;</td>
292286
</tr>
293287
<tr>
@@ -352,38 +346,49 @@ You can use BTTF-Network and MQTT at the same time, see [below](#home-assistant-
352346
</tr>
353347
<tr>
354348
<td align="left">Play "<a href="#additional-custom-sounds">key1.mp3</a>"</td>
355-
<td align="left">9001&#9166;</td>
349+
<td align="left">9001&#9166; / 9501&#9166;</td>
350+
</tr>
351+
<tr>
352+
<td align="left">Play "<a href="#additional-custom-sounds">key2.mp3</a>"</td>
353+
<td align="left">9502&#9166;</td>
356354
</tr>
357355
<tr>
358356
<td align="left">Play "<a href="#additional-custom-sounds">key3.mp3</a>"</td>
359-
<td align="left">9003&#9166;</td>
357+
<td align="left">9003&#9166; / 9503&#9166;</td>
360358
</tr>
361359
<tr>
362360
<td align="left">Play "<a href="#additional-custom-sounds">key4.mp3</a>"</td>
363-
<td align="left">9004&#9166;</td>
361+
<td align="left">9004&#9166; / 9504&#9166;</td>
362+
</tr>
363+
<tr>
364+
<td align="left">Play "<a href="#additional-custom-sounds">key5.mp3</a>"</td>
365+
<td align="left">9505&#9166;</td>
364366
</tr>
365367
<tr>
366368
<td align="left">Play "<a href="#additional-custom-sounds">key6.mp3</a>"</td>
367-
<td align="left">9006&#9166;</td>
369+
<td align="left">9006&#9166; / 9506&#9166;</td>
368370
</tr>
369371
<tr>
370372
<td align="left">Play "<a href="#additional-custom-sounds">key7.mp3</a>"</td>
371-
<td align="left">9007&#9166;</td>
373+
<td align="left">9007&#9166; / 9507&#9166;</td>
374+
</tr>
375+
<td align="left">Play "<a href="#additional-custom-sounds">key8.mp3</a>"</td>
376+
<td align="left">9508&#9166;</td>
372377
</tr>
373378
<tr>
374379
<td align="left">Play "<a href="#additional-custom-sounds">key9.mp3</a>"</td>
375-
<td align="left">9009&#9166;</td>
380+
<td align="left">9009&#9166; / 9509&#9166;</td>
376381
</tr>
377382
<tr>
378383
<td align="left">Say current IP address</td>
379384
<td align="left">9090&#9166;</td>
380385
</tr>
381386
<tr>
382-
<td align="left">Reboot the device</td>
387+
<td align="left">Reboot the device<sup>1</sup></td>
383388
<td align="left">9064738&#9166;</td>
384389
</tr>
385390
<tr>
386-
<td align="left">Delete static IP address<br>and WiFi-AP password</td>
391+
<td align="left">Delete static IP address<br>and WiFi-AP password<sup>1</sup></td>
387392
<td align="left">9123456&#9166;</td>
388393
</tr>
389394
<tr>
@@ -392,13 +397,15 @@ You can use BTTF-Network and MQTT at the same time, see [below](#home-assistant-
392397
</tr>
393398
</table>
394399

400+
1: Not supported through HA/MQTT [_INJECT_](#the-inject_x-command) command
401+
395402
[Here](https://github.com/realA10001986/Dash-Gauges/blob/main/CheatSheet.pdf) is a cheat sheet for printing or screen-use. (Note that MacOS' preview application has a bug that scrambles the links in the document. Acrobat Reader does it correctly.)
396403

397404
### Connecting a TCD by wire
398405

399406
>Note that a wired connection only allows for synchronized time travel sequences, no other communication takes place, and there is no way to remote-control the Gauges through the TCD by wire. A wireless connection over BTTFN/WiFi is much more powerful and therefore recommended over a wired connection.
400407
401-
For wiring information, please see [here](hardware/#connecting-a-tcd-to-the-dash-gauges-by-wire).
408+
For wiring information, please see [here](Hardware.md#connecting-a-tcd-to-the-dash-gauges-by-wire).
402409

403410
With the wiring in place, head to the Config Portal and set the option **_TCD connected by wire_**. On the TCD, the option "Control props connected by wire" must be set.
404411

@@ -415,8 +422,8 @@ The Dash Gauges support the MQTT protocol version 3.1.1 for the following featur
415422

416423
### Control the Dash Gauges via MQTT
417424

418-
The Dash Gauges can - to some extent - be controlled through messages sent to topic **bttf/dg/cmd**. Supported commands are
419-
- TIMETRAVEL: Start a [time travel](#time-travel)
425+
The Dash Gauges can be controlled through messages sent to topic **bttf/dg/cmd**. Supported commands are
426+
- TIMETRAVEL: Start a time travel
420427
- EMPTY: "Drain" Plutonium and trigger alarm
421428
- REFILL: Refill the Plutonium chamber
422429
- PLAY_DOOR_OPEN, PLAY_DOOR_CLOSED: Play respective door sounds; these commands are only executed if the option **_Play door sounds_** in the Config Portal is unchecked.
@@ -427,6 +434,21 @@ The Dash Gauges can - to some extent - be controlled through messages sent to to
427434
- MP_SHUFFLE_ON: Enables shuffle mode in [Music Player](#the-music-player)
428435
- MP_SHUFFLE_OFF: Disables shuffle mode in [Music Player](#the-music-player)
429436
- MP_FOLDER_x: x being 0-9, set folder number for [Music Player](#the-music-player)
437+
- PLAYKEY_x: Play keyX.mp3 (from SD card), X being in the range from 1 to 9.
438+
- STOPKEY: Stop playback of keyX file. Does nothing if no keyX file is currently played back.
439+
- INJECT_x: See immediately below.
440+
441+
#### The INJECT_x command
442+
443+
This command allows remote control of the Dash Gauges through HA/MQTT in the same way as through the TCD keypad by injecting commands in the Dash Gauges command queue (hence the name). Commands are listed [here](#tcd-remote-command-reference); nearly all with a leading "9" are supported, but are to be entered _minus 9000_. For example:
444+
445+
To set "full" percentage of "Percent Power" gauge to 50% (9450), issue the following command: **INJECT_450**
446+
447+
To play "key2.mp3" (9502), issue **INJECT_502**
448+
449+
To select the 'music1' folder (9051), issue **INJECT_51**
450+
451+
_The Refill (009) command is not supported through INJECT; use the REFILL MQTT-command instead._
430452

431453
### Receive commands from Time Circuits Display
432454

@@ -712,9 +734,9 @@ If this option is checked, and your TCD goes into night mode, the Dash Gauges wi
712734

713735
If this option is checked, and your TCD is equipped with a fake power switch, the Dash Gauges will also fake-power up/down. If fake power is off, no LED is active and the Dash Gauges will ignore all input.
714736

715-
##### &#9193; TT button trigger BTTFN-wide TT
737+
##### &#9193; TT button triggers BTTFN-wide TT
716738

717-
If the dash gauges are connected to a TCD through BTTFN, this option allows to trigger a synchronized time travel on all BTTFN-connected devices when pressing the Time Travel button, just as if the Time Travel was triggered by the TCD. If this option is unchecked, pressing the Time Travel button only triggers a Time Travel sequence on the dash gauges.
739+
If the dash gauges are connected to a TCD through BTTFN, this option allows to trigger a synchronized time travel on all BTTFN-connected devices when pressing the Time Travel button, just as if the Time Travel was triggered by the TCD. If this option is unchecked, pressing the Time Travel button only triggers a Time Travel sequence on the Dash Gauges.
718740

719741
#### <ins>Home Assistant / MQTT settings</ins>
720742

install/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This folder holds all files necessary for immediate installation on your Dash Ga
44

55
## Firmware Installation
66

7-
If a previous version of the Dash Gauges firmware is installed on your device's ESP32, you can update easily using the pre-compiled binary. Enter the Config Portal, click on "Update" and select the pre-compiled binary file provided in this repository ([install/dashgauges-A10001986.ino.nodemcu-32s.bin](https://github.com/realA10001986/Dash-Gauges/blob/main/install/dashgauges-A10001986.ino.nodemcu-32s.bin)).
7+
If a previous version of the Dash Gauges firmware is installed on your device's ESP32, you can update easily using the pre-compiled binary. Enter the Config Portal, click on "Update" and select the pre-compiled binary file provided in this repository ([install/dashgauges-A10001986.ino.nodemcu-32s.bin](https://github.com/realA10001986/Dash-Gauges/blob/main/install/dashgauges-A10001986.ino.nodemcu-32s.bin)) in the top file selector and click *Update*.
88

99
If you are using a fresh ESP32 board, please see [dashgauges-A10001986.ino](https://github.com/realA10001986/Dash-Gauges/blob/main/dashgauges-A10001986/dashgauges-A10001986.ino) for detailed build and upload information, or, if you don't want to deal with source code, compilers and all that nerd stuff, go [here](https://install.out-a-ti.me) and follow the instructions.
1010

@@ -14,11 +14,11 @@ If you are using a fresh ESP32 board, please see [dashgauges-A10001986.ino](http
1414

1515
The sound-pack is not updated as often as the firmware itself. If you have previously installed the latest version of the sound-pack, you normally don't have to re-install it when you update the firmware. Only if the "Empty" LED signals "SOS" (three short blinks, three long blinks, three short blicks) during boot, a re-installation/update is needed.
1616

17-
The first step is to download "install/sound-pack-xxxxxxxx.zip" and extract it. It contains one file named "DGA.bin".
17+
The first step is to download "install/sound-pack-dgXX.zip" and extract it. It contains one file named "DGA.bin".
1818

1919
Then there are two alternative ways to proceed. Note that both methods *require an SD card*.
2020

21-
1) Through the Config Portal. Click on *Update*, select the "DGA.bin" file in the bottom file selector and click on *Upload*.
21+
1) Through the Config Portal. Click on *Update*, select the "DGA.bin" file in the bottom file selector and click *Upload*.
2222

2323
2) Via SD card:
2424
- Copy "DGA.bin" to the root directory of of a FAT32 formatted SD card;
96 Bytes
Binary file not shown.

src/dashgauges-A10001986.ino

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@
115115

116116
/* Changelog
117117
*
118+
* 2025/11/05 (A10001986) [1.26]
119+
* - Add MQTT command "INJECT_"
120+
* 2025/11/04 (A10001986)
121+
* - Add MQTT commands PLAYKEY_x and STOPKEY (X=1-9)
122+
* - Add commands 9501-9509 to play keyX (X=1-9) (Old short-hands 900x for
123+
* a subset of keyX playback remain as well.)
124+
* - Eliminate historical limitation of not having "key8.mp3". Can be played
125+
* through HA/MQTT and TCD-commands.
126+
* - Put MQTT commands in command queue instead of executing them directly.
127+
* 2025/11/02 (A10001986)
128+
* - WM: Generate HTML for checkboxes on-the-fly.
129+
* 2025/10/30 (A10001986)
130+
* - Fix deleting a bad .bin file after upload
118131
* 2025/10/26 (A10001986) [1.25.1]
119132
* - BTTFN: Fix hostname length issues; code optimizations; minor fix for mc
120133
* notifications. Breaks support for TCD firmwares < 3.2.

src/dg_audio.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ bool playingDoor = false;
117117

118118
static char append_audio_file[256];
119119
static float append_vol;
120-
static uint16_t append_flags;
120+
static uint32_t append_flags;
121121
static bool appendFile = false;
122122

123123
static char keySnd[] = "/key3.mp3"; // not const
@@ -191,7 +191,6 @@ void audio_setup()
191191

192192
// Check for keyX sounds to avoid unsuccessful file-lookups every time
193193
for(int i = 1; i < 10; i++) {
194-
if(i == 8) continue;
195194
keySnd[4] = '0' + i;
196195
haveKeySnd[i] = check_file_SD(keySnd);
197196
}
@@ -275,7 +274,7 @@ static int findWAVdata(char *buf)
275274
return 0;
276275
}
277276

278-
void append_file(const char *audio_file, uint16_t flags, float volumeFactor)
277+
void append_file(const char *audio_file, uint32_t flags, float volumeFactor)
279278
{
280279
strcpy(append_audio_file, audio_file);
281280
append_flags = flags;
@@ -287,7 +286,7 @@ void append_file(const char *audio_file, uint16_t flags, float volumeFactor)
287286
#endif
288287
}
289288

290-
void play_file(const char *audio_file, uint16_t flags, float volumeFactor)
289+
void play_file(const char *audio_file, uint32_t flags, float volumeFactor)
291290
{
292291
char buf[64];
293292
int32_t curSeek = 0;
@@ -320,7 +319,7 @@ void play_file(const char *audio_file, uint16_t flags, float volumeFactor)
320319
playingEmpty = (flags & PA_ISEMPTY) ? true : false;
321320
playingEmptyEnds = false;
322321
playingDoor = (flags & PA_DOOR) ? true : false;
323-
key_playing = flags & 0xff00;
322+
key_playing = flags & 0x1ff00;
324323

325324
out->SetGain(getVolume());
326325

@@ -404,7 +403,7 @@ void remove_appended_empty()
404403

405404
void play_key(int k, bool stopOnly)
406405
{
407-
uint16_t pa_key = (k == 9) ? 0x8000 : (1 << (7+k));
406+
uint16_t pa_key = (1 << (7+k));
408407

409408
if(!haveKeySnd[k]) return;
410409

@@ -559,6 +558,17 @@ void stopAudioAtLoopEnd()
559558
playingEmptyEnds = true;
560559
}
561560

561+
bool stop_key()
562+
{
563+
if(key_playing) {
564+
mp3->stop();
565+
key_playing = 0;
566+
audioplaystart = 0;
567+
return true;
568+
}
569+
return false;
570+
}
571+
562572
bool append_pending()
563573
{
564574
return appendFile;

0 commit comments

Comments
 (0)