Skip to content

Commit 73decd7

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents c93ac60 + 468e342 commit 73decd7

File tree

14 files changed

+973
-446
lines changed

14 files changed

+973
-446
lines changed

README.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Firmware features include
2727
- [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)
30-
- [Home Assistant](#home-assistant--mqtt) (MQTT 3.1.1) support
30+
- [Home Assistant](#home-assistant--mqtt) (MQTT) support
3131
- built-in OTA installer for firmware updates and audio files
3232

3333
## Firmware Installation
@@ -44,17 +44,17 @@ The firmware comes with a sound-pack which needs to be installed separately. The
4444

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

47-
Then there are two alternative ways to proceed. Note that both methods *require an SD card*.
47+
Next, head to the [Config Portal](#the-config-portal), click on *Update*, select the "DGA.bin" file in the bottom file selector and click on *Upload*.
4848

49-
1) Through the [Config Portal](#the-config-portal). Click on *Update*, select the "DGA.bin" file in the bottom file selector and click on *Upload*.
49+
<details>
50+
<summary>More...</summary>
5051

51-
2) Via SD card:
52-
- Copy "DGA.bin" to the root directory of a FAT32 formatted SD card;
52+
Alternatively, you can install the sound-pack the following way:
53+
- Using a computer, copy "DGA.bin" to the root directory of a FAT32 formatted SD card;
5354
- power down the Dash Gauges,
5455
- insert this SD card into the slot and
5556
- power up the Dash Gauges; the sound-pack will be installed automatically.
56-
57-
After installation, the SD card can be re-used for [other purposes](#sd-card).
57+
</details>
5858

5959
## Initial Configuration
6060

@@ -407,7 +407,7 @@ You can use BTTF-Network and MQTT at the [same time](#receive-commands-from-time
407407
408408
For wiring information, please see [here](Hardware.md#connecting-a-tcd-to-the-dash-gauges-by-wire).
409409

410-
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.
410+
With the wiring in place, head to the Config Portal and set the option **_TCD connected by wire_**. On the TCD, the option [TT-OUT] _"signals Time Travel"_ must be checked.
411411

412412
<details>
413413
<summary>More...</summary>
@@ -418,7 +418,7 @@ With the wiring in place, head to the Config Portal and set the option **_TCD co
418418

419419
## Home Assistant / MQTT
420420

421-
The Dash Gauges support the MQTT protocol version 3.1.1 for the following features:
421+
The Dash Gauges support MQTT protocol versions 3.1.1 and 5.0 for the following features:
422422

423423
### Control the Dash Gauges via MQTT
424424

@@ -452,9 +452,9 @@ _The Refill (009) command is not supported through INJECT; use the REFILL MQTT-c
452452

453453
### Receive commands from Time Circuits Display
454454

455-
If both TCD and Dash Gauges are connected to the same broker, and the option **_Send time travel/alarm event notifications_** is checked on the TCD's side, the Dash Gauges will receive information on time travel and alarm and play their sequences in sync with the TCD. Unlike BTTFN, however, no other communication takes place.
455+
If both TCD and Dash Gauges are connected to the same broker, and the option **_Publish time travel and alarm events_** is checked on the TCD's side, the Dash Gauges will receive information on time travel and alarm and play their sequences in sync with the TCD. Unlike BTTFN, however, no other communication takes place.
456456

457-
MQTT and BTTFN can co-exist. However, the TCD only sends out time travel and alarm notifications through either MQTT or BTTFN, never both. If you have other MQTT-aware devices listening to the TCD's public topic (bttf/tcd/pub) in order to react to time travel or alarm messages, use MQTT (ie check **_Send time travel/alarm event notifications_**). If only BTTFN-aware devices are to be used, uncheck this option to use BTTFN as it has less latency.
457+
MQTT and BTTFN can co-exist. However, the TCD only sends out time travel and alarm notifications through either MQTT or BTTFN, never both. If you have other MQTT-aware devices listening to the TCD's public topic (bttf/tcd/pub) in order to react to time travel or alarm messages, use MQTT (ie check **_Publish time travel and alarm events_**). If only BTTFN-aware devices are to be used, uncheck this option to use BTTFN as it has less latency.
458458

459459
### Setup
460460

@@ -464,9 +464,11 @@ MQTT requires a "broker" (such as [mosquitto](https://mosquitto.org/), [EMQ X](h
464464

465465
The broker's address needs to be configured in the Config Portal. It can be specified either by domain or IP (IP preferred, spares us a DNS call). The default port is 1883. If a different port is to be used, append a ":" followed by the port number to the domain/IP, such as "192.168.1.5:1884".
466466

467+
If your broker supports protocol version 3.1.1, stick with 3.1.1. Version 5.0 has no advantages, but more overhead.
468+
467469
If your broker does not allow anonymous logins, a username and password can be specified.
468470

469-
Limitations: MQTT Protocol version 3.1.1; TLS/SSL not supported; ".local" domains (MDNS) not supported; server/broker must respond to PING (ICMP) echo requests. For proper operation with low latency, it is recommended that the broker is on your local network. MQTT is disabled when the Dash Gauges are operated in AP-mode or when connected to the TCD run in AP-Mode (TCD-AP).
471+
Limitations: TLS/SSL not supported; ".local" domains (MDNS) not supported; server/broker must respond to PING (ICMP) echo requests. For proper operation with low latency, it is recommended that the broker is on your local network. MQTT is disabled when the Dash Gauges are operated in AP-mode or when connected to the TCD run in AP-Mode (TCD-AP).
470472

471473
## Car setup
472474

@@ -530,6 +532,10 @@ This leads to the [WiFi configuration page](#wifi-configuration)
530532

531533
This leads to the [Settings page](#settings).
532534

535+
##### &#9193; HA/MQTT Settings
536+
537+
This leads to the [HomeAssistant/MQTT Settings page](#hamqtt-settings).
538+
533539
##### &#9193; Update
534540

535541
This leads to the firmware and audio upload page.
@@ -738,20 +744,6 @@ If this option is checked, and your TCD is equipped with a fake power switch, th
738744

739745
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.
740746

741-
#### <ins> Assistant / MQTT settings</ins>
742-
743-
##### &#9193; Use Assistant (MQTT 3.1.1)
744-
745-
If checked, the Dash Gauges will connect to the broker (if configured) and send and receive messages via [MQTT](#home-assistant--mqtt).
746-
747-
##### &#9193; Broker IP[:port] or domain[:port]
748-
749-
The broker server address. Can be a domain (eg. "my.me") or an IP address (eg "192.168.1.5"). The default port is 1883. If different port is to be used, it can be specified after the domain/IP and a colon ":", for example: "192.168.1.5:1884". Specifying the IP address is preferred over a domain since the DNS call adds to the network overhead. Note that ".local" (MDNS) domains are not supported.
750-
751-
##### &#9193; User[:Password]
752-
753-
The username (and optionally the password) to be used when connecting to the broker. Can be left empty if the broker accepts anonymous logins.
754-
755747
#### <ins>Settings for wired connections</ins>
756748

757749
##### &#9193; TCD connected by wire
@@ -812,6 +804,24 @@ This selects the type of gauge hardware and the way of connection. In order to p
812804

813805
then reload the page in your browser.
814806

807+
### HA/MQTT Settings
808+
809+
##### &#9193; Home Assistant support (MQTT)
810+
811+
If checked, the Dash Gauges will connect to the broker (if configured) and send and receive messages via [MQTT](#home-assistant--mqtt).
812+
813+
##### &#9193; Broker IP[:port] or domain[:port]
814+
815+
The broker server address. Can be a domain (eg. "my.me") or an IP address (eg "192.168.1.5"). The default port is 1883. If different port is to be used, it can be specified after the domain/IP and a colon ":", for example: "192.168.1.5:1884". Specifying the IP address is preferred over a domain since the DNS call adds to the network overhead. Note that ".local" (MDNS) domains are not supported.
816+
817+
##### &#9193; Protocol version
818+
819+
The firmware supports MQTT 3.1.1 and 5.0. There is no difference in features, so there is no advantage in selecting 5.0. This was implemented only for brokers that do not support 3.1.1.
820+
821+
##### &#9193; User[:Password]
822+
823+
The username (and optionally the password) to be used when connecting to the broker. Can be left empty if the broker accepts anonymous logins.
824+
815825
---
816826
_Text & images: (C) Thomas Winischhofer ("A10001986"). See LICENSE._ Source: https://dg.out-a-ti.me
817827
_Other props: [Time Circuits Display](https://tcd.out-a-ti.me) ... [Flux Capacitor](https://fc.out-a-ti.me) ... [SID](https://sid.out-a-ti.me) ... [VSR](https://vsr.out-a-ti.me) ... [Remote Control](https://remote.out-a-ti.me) ... [TFC](https://tfc.out-a-ti.me)_
2.8 KB
Binary file not shown.

src/dashgauges-A10001986.ino

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

116116
/* Changelog
117117
*
118+
* 2025/11/26 (A10001986) [1.28]
119+
* - Prevent P1-speed from becoming the reason to switch to adapting to
120+
* TCD-provided speed in speedo-less time-travel sequences
121+
* 2025/11/22 (A10001986)
122+
* - Sync'd TT: Handle abort in P0
123+
* 2025/11/21 (A10001986)
124+
* - WM: Minor HTML tweaks; make page width dynamic for better display
125+
* on handheld devices
126+
* 2025/11/19 (A10001986)
127+
* - Add support for MQTT v5.0 (tested with mosquitto only). Has no
128+
* advantages over 3.1.1 (but more overhead), only there to use brokers
129+
* that lack support for 3.1.1.
130+
* - Move HA/MQTT settings to separate page
131+
* - Add MQTT connection state info on HA/MQTT Settings page
132+
* 2025/11/16 (A10001986)
133+
* - WM: Require HTTP_POST for params save pages. Also, check if request
134+
* has parameter, do not overwrite current value with null (protects from
135+
* overwriting settings by errorneous page reloads)
118136
* 2025/11/14 (A10001986) [1.27]
119137
* - Remove BTTFN_MC conditional
120138
* 2025/11/13 (A10001986)

src/dg_global.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*** Version Strings ***
1616
*************************************************************************/
1717

18-
#define DG_VERSION "V1.27"
19-
#define DG_VERSION_EXTRA "NOV142025"
18+
#define DG_VERSION "V1.28"
19+
#define DG_VERSION_EXTRA "NOV262025"
2020

2121
//#define DG_DBG // debug output on Serial
2222

src/dg_main.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,15 @@ void main_loop()
933933

934934
// Nothing.
935935

936+
} else if(networkAbort) {
937+
938+
// If we are aborted in P0,
939+
// the entire TT is over for us.
940+
TTP0 = false;
941+
TTrunning = false;
942+
isTTKeyPressed = false;
943+
ssRestartTimer();
944+
936945
} else {
937946

938947
TTP0 = false;
@@ -981,17 +990,21 @@ void main_loop()
981990

982991
TTP1 = false;
983992
TTP2 = true;
993+
994+
// P1 ends with empty; even if we were aborted in P1.
995+
// There is no "half empty".
984996
gauges.setValuePercent(0, left_gauge_empty);
985997
gauges.setValuePercent(1, center_gauge_empty);
986998
gauges.setValuePercent(2, right_gauge_empty);
987999
gauges.UpdateAll();
1000+
9881001
TTstart = now;
9891002

9901003
}
9911004
}
9921005
if(TTP2) { // Reentry - up to us
9931006

994-
if(now - TTstart > P2_ALARM_DELAY) {
1007+
if(networkAbort || (now - TTstart > P2_ALARM_DELAY)) {
9951008

9961009
// At very end:
9971010
checkGauges();
@@ -2146,15 +2159,22 @@ static void handle_tcd_notification(uint8_t *buf)
21462159
case BTTFN_NOT_SPD:
21472160
seqCnt = GET32(buf, 12);
21482161
if(seqCnt > bttfnTCDSeqCnt || seqCnt == 1) {
2149-
gpsSpeed = (int16_t)(buf[6] | (buf[7] << 8));
2150-
if(gpsSpeed > 88) gpsSpeed = 88;
21512162
switch(buf[8] | (buf[9] << 8)) {
21522163
case BTTFN_SSRC_GPS:
21532164
spdIsRotEnc = false;
21542165
break;
2166+
case BTTFN_SSRC_P1:
2167+
// If packets come out-of-order, we might
2168+
// get this one before TTrunning, and we
2169+
// don't want a switch to usingGPSS only
2170+
// because of P1 speed
2171+
if(!TTrunning) return;
2172+
// fall through
21552173
default:
21562174
spdIsRotEnc = true;
21572175
}
2176+
gpsSpeed = (int16_t)(buf[6] | (buf[7] << 8));
2177+
if(gpsSpeed > 88) gpsSpeed = 88;
21582178
} else {
21592179
#ifdef DG_DBG
21602180
Serial.printf("Out-of-sequence packet received from TCD %d %d\n", seqCnt, bttfnTCDSeqCnt);

src/dg_settings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ static bool read_settings(File configFile, int cfgReadCount)
507507
#ifdef DG_HAVEMQTT
508508
wd |= CopyCheckValidNumParm(json["useMQTT"], settings.useMQTT, sizeof(settings.useMQTT), 0, 1, 0);
509509
wd |= CopyTextParm(json["mqttServer"], settings.mqttServer, sizeof(settings.mqttServer));
510+
wd |= CopyCheckValidNumParm(json["mqttV"], settings.mqttVers, sizeof(settings.mqttVers), 0, 1, 0);
510511
wd |= CopyTextParm(json["mqttUser"], settings.mqttUser, sizeof(settings.mqttUser));
511512
#endif
512513

@@ -594,6 +595,7 @@ void write_settings()
594595
#ifdef DG_HAVEMQTT
595596
json["useMQTT"] = (const char *)settings.useMQTT;
596597
json["mqttServer"] = (const char *)settings.mqttServer;
598+
json["mqttV"] = (const char *)settings.mqttVers;
597599
json["mqttUser"] = (const char *)settings.mqttUser;
598600
#endif
599601

src/dg_settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct Settings {
147147

148148
#ifdef DG_HAVEMQTT
149149
char useMQTT[4] = "0";
150+
char mqttVers[4] = "0"; // 0 = 3.1.1, 1 = 5.0
150151
char mqttServer[80] = ""; // ip or domain [:port]
151152
char mqttUser[128] = ""; // user[:pass] (UTF8)
152153
#endif

0 commit comments

Comments
 (0)