Skip to content

Commit 2fabf82

Browse files
arendsthawa-lc4
authored andcommitted
Add Support for compile time hostname with #define WIFI_DEFAULT_HOSTNAME (arendst#21236)
1 parent 4510006 commit 2fabf82

File tree

5 files changed

+23
-26
lines changed

5 files changed

+23
-26
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ All notable changes to this project will be documented in this file.
88
- ESP32 esp32_partition_app3904k_fs3392k partition scheme for 8MB ESP32S3 (#21241)
99
- TCP Serial bridge GPIO type `TCP Tx En` (#21269)
1010
- Berry `webserver.content_close()` (#21276)
11+
- ESP32 Compile option disabling PSRam check to avoid "blinking" of GPIO 16/17 at startup (#21282)
1112
- HASPmota demo of Renaissance Watch for 480x480 displays (#21290)
1213
- PlatformIO target reset (#21292)
1314
- Support for AHT30 Temperature and Humidity Sensor (#19922)
1415
- Berry wave file recorder (#21315)
1516
- Command ``Publish3`` to send binary data encoded as Hex, disabled in safeboot (21329)
17+
- Support for compile time hostname with `#define WIFI_DEFAULT_HOSTNAME` (#21236)
1618

1719
### Breaking Changed
1820
- ESP32-C3 OTA binary name from `tasmota32c3cdc.bin` to `tasmota32c3.bin` with USB HWCDC and fallback to serial (#21212)
@@ -46,7 +48,6 @@ All notable changes to this project will be documented in this file.
4648
### Removed
4749
- LVGL disabled vector graphics (#21242)
4850
- ESP32 IDF 4.4 based I2S code (#21188)
49-
- ESP32 PSRam check to avoid "blinking" of GPIO 16/17 at startup (#21282)
5051
- Crash recorder from safeboot (#21332)
5152

5253
## [13.4.1.1] 20240418

RELEASENOTES.md

+10-20
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,10 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
116116

117117
## Changelog v13.4.1.2
118118
### Added
119-
- PlatformIO target reset (#21292)
120-
119+
- PlatformIO target reset [#21292](https://github.com/arendst/Tasmota/issues/21292)
121120
- Command ``Wifi 6`` to enable 11ax on ESP32
122121
- Command ``PowerLock`` to disable power control of selected outputs [#21081](https://github.com/arendst/Tasmota/issues/21081)
123-
124-
- Command ``Publish3`` to send binary data encoded as Hex, disabled in safeboot (21329)
125-
122+
- Command ``Publish3`` to send binary data encoded as Hex, disabled in safeboot [#21329](https://github.com/arendst/Tasmota/issues/21329)
126123
- Support for calculated heat index if temperature and humidity is available with ``#define USE_HEAT_INDEX`` [#4771](https://github.com/arendst/Tasmota/issues/4771)
127124
- Support for LoRa and single channel EU863-870 LoRaWanBridge [#17790](https://github.com/arendst/Tasmota/issues/17790)
128125
- Support for AMS5915/AMS6915 temperature and pressure sensors [#20814](https://github.com/arendst/Tasmota/issues/20814)
@@ -134,37 +131,31 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
134131
- Support for Domoticz non-persistent ``DzIdx5`` to ``DzIdx32`` and disabling DOMOTICZ_OUT_TOPIC subscribe using command ``DzIdx0 0`` [#21019](https://github.com/arendst/Tasmota/issues/21019)
135132
- Support SPI GPIO configuration for Universal Touch Screen [#21025](https://github.com/arendst/Tasmota/issues/21025)
136133
- Support for SPL06_007 pressure and temperature sensor [#21185](https://github.com/arendst/Tasmota/issues/21185)
137-
138-
- Support for AHT30 Temperature and Humidity Sensor (#19922)
139-
134+
- Support for AHT30 Temperature and Humidity Sensor [#19922](https://github.com/arendst/Tasmota/issues/19922)
135+
- Support for compile time hostname with `#define WIFI_DEFAULT_HOSTNAME` (#21236)[#21236](https://github.com/arendst/Tasmota/issues/21236)
140136
- Zigbee support for attributes of type `uint48` used by energy monitoring [#20992](https://github.com/arendst/Tasmota/issues/20992)
141137
- QMC5883l check for overflow and scale reading [#20643](https://github.com/arendst/Tasmota/issues/20643)
142-
143-
- TCP Serial bridge GPIO type `TCP Tx En` (#21269)
144-
- ESP32 esp32_partition_app3904k_fs3392k partition scheme for 8MB ESP32S3 (#21241)
145-
138+
- TCP Serial bridge GPIO type `TCP Tx En` [#21269](https://github.com/arendst/Tasmota/issues/21269)
139+
- ESP32 esp32_partition_app3904k_fs3392k partition scheme for 8MB ESP32S3 [#21241](https://github.com/arendst/Tasmota/issues/21241)
140+
- ESP32 Compile option disabling PSRam check to avoid "blinking" of GPIO 16/17 at startup [#21282](https://github.com/arendst/Tasmota/issues/21282)
146141
- Berry explicit error log when memory allocation fails [#20807](https://github.com/arendst/Tasmota/issues/20807)
147142
- Berry `path.rename()` [#20840](https://github.com/arendst/Tasmota/issues/20840)
148143
- Berry `string.startswith`, `string.endswith` and `%q` format [#20909](https://github.com/arendst/Tasmota/issues/20909)
149144
- Berry `close()` to class `serial` [#21042](https://github.com/arendst/Tasmota/issues/21042)
150145
- Berry `flash.current_ota` [#21097](https://github.com/arendst/Tasmota/issues/21097)
151-
152-
- Berry `webserver.content_close()` (#21276)
153-
- Berry wave file recorder (#21315)
154-
146+
- Berry `webserver.content_close()` [#21276](https://github.com/arendst/Tasmota/issues/21276)
147+
- Berry wave file recorder [#21315](https://github.com/arendst/Tasmota/issues/21315)
155148
- LVGL and HASPmota typicons font [#20742](https://github.com/arendst/Tasmota/issues/20742)
156149
- LVGL `lv.draw_label_dsc` and `lv_bar.get_indic_area` [#20936](https://github.com/arendst/Tasmota/issues/20936)
157150
- HASPmota `p<x>b<y>.delete` to delete an object [#20735](https://github.com/arendst/Tasmota/issues/20735)
158151
- HASPmota improve arc and img [#20894](https://github.com/arendst/Tasmota/issues/20894)
159152
- HASPmota support for scale, percentages [#20974](https://github.com/arendst/Tasmota/issues/20974)
160153
- HASPmota `dropdown_list` and fixes [#21208](https://github.com/arendst/Tasmota/issues/21208)
161-
162-
- HASPmota demo of Renaissance Watch for 480x480 displays (#21290)
154+
- HASPmota demo of Renaissance Watch for 480x480 displays [#21290](https://github.com/arendst/Tasmota/issues/21290)
163155

164156
### Breaking Changed
165157
- Drop support for old (insecure) fingerprint format [#20842](https://github.com/arendst/Tasmota/issues/20842)
166158
- Removed dedicated touch drivers in favour of Universal Touch driver [#21146](https://github.com/arendst/Tasmota/issues/21146)
167-
- ESP32 Ethernet Phy Type number for DM9051 from 4 to 10 (#21204)[#21204](https://github.com/arendst/Tasmota/issues/21204)
168159
- ESP32-C3 OTA binary name from `tasmota32c3cdc.bin` to `tasmota32c3.bin` with USB HWCDC and fallback to serial [#21212](https://github.com/arendst/Tasmota/issues/21212)
169160
- ESP32-C6 OTA binary name from `tasmota32c6cdc.bin` to `tasmota32c6.bin` with USB HWCDC and fallback to serial [#21212](https://github.com/arendst/Tasmota/issues/21212)
170161
- ESP32-S3 OTA binary name from `tasmota32s3cdc.bin` to `tasmota32s3.bin` with USB HWCDC and fallback to serial [#21212](https://github.com/arendst/Tasmota/issues/21212)
@@ -243,7 +234,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
243234
- SSD1351 driver replaced with uDisplay [#21184](https://github.com/arendst/Tasmota/issues/21184)
244235
- ST7789 driver replaced with uDisplay [#21184](https://github.com/arendst/Tasmota/issues/21184)
245236
- ESP32 IDF 4.4 based I2S code [#21188](https://github.com/arendst/Tasmota/issues/21188)
246-
- ESP32 PSRam check to avoid "blinking" of GPIO 16/17 at startup [#21282](https://github.com/arendst/Tasmota/issues/21282)
247237
- Crash recorder from safeboot [#21332](https://github.com/arendst/Tasmota/issues/21332)
248238
- Berry `print "a"` syntax no longer supported [#21048](https://github.com/arendst/Tasmota/issues/21048)
249239
- LVGL disabled vector graphics [#21242](https://github.com/arendst/Tasmota/issues/21242)

tasmota/include/tasmota.h

-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ const uint8_t MAX_ROTARIES = 2; // Max number of Rotary Encoders
146146

147147
const char MQTT_TOKEN_PREFIX[] PROGMEM = "%prefix%"; // To be substituted by mqtt_prefix[x]
148148
const char MQTT_TOKEN_TOPIC[] PROGMEM = "%topic%"; // To be substituted by mqtt_topic, mqtt_grptopic, mqtt_buttontopic, mqtt_switchtopic
149-
const char WIFI_HOSTNAME[] = "%s-%04d"; // Expands to <MQTT_TOPIC>-<last 4 decimal chars of MAC address>
150149

151150
const uint8_t CONFIG_FILE_SIGN = 0xA5; // Configuration file signature
152151
const uint8_t CONFIG_FILE_XOR = 0x5A; // Configuration file xor (0 = No Xor)

tasmota/include/tasmota_globals.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ String EthernetMacAddress(void);
6969

7070
#include "include/tasmota_configurations.h" // Preconfigured configurations
7171

72+
/*********************************************************************************************\
73+
* Finale overrides
74+
\*********************************************************************************************/
75+
76+
const char WIFI_HOSTNAME[] = WIFI_DEFAULT_HOSTNAME; // Override by user_config_override.h
77+
7278
/*-------------------------------------------------------------------------------------------*\
7379
* ESP8266 and ESP32 build time definitions
7480
\*-------------------------------------------------------------------------------------------*/
@@ -79,7 +85,7 @@ String EthernetMacAddress(void);
7985
#elif (CONFIG_TASMOTA_FLASHMODE_QIO)
8086
#define D_TASMOTA_FLASHMODE "QIO"
8187
#elif defined(CONFIG_TASMOTA_FLASHMODE_QOUT)
82-
#define D_TASMOTA_FLASHMODE "QOUT"
88+
#define D_TASMOTA_FLASHMODE "QOUT"
8389
#elif defined(CONFIG_TASMOTA_FLASHMODE_DIO)
8490
#define D_TASMOTA_FLASHMODE "DIO"
8591
#elif defined(CONFIG_TASMOTA_FLASHMODE_DOUT)

tasmota/my_user_config.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
#define WIFI_SCAN_AT_RESTART false // [SetOption56] Scan Wi-Fi network at restart for configured AP's
8585
#define WIFI_SCAN_REGULARLY true // [SetOption57] Scan Wi-Fi network every 44 minutes for configured AP's
8686
#define WIFI_NO_SLEEP false // [SetOption127] Sets Wifi in no-sleep mode which improves responsiveness on some routers
87+
#define WIFI_DEFAULT_HOSTNAME "%s-%04d" // [Hostname] Expands to <MQTT_TOPIC>-<last 4 decimal chars of MAC address>
8788

8889
// -- Syslog --------------------------------------
8990
#define SYS_LOG_HOST "" // [LogHost] (Linux) syslog host
@@ -1140,15 +1141,15 @@ An online tool to calculate TLS fingerprints is available here at:\n\
11401141

11411142
//#define USE_ETHERNET // Add support for ethernet (+20k code)
11421143
// #define USE_WT32_ETH01 // Add support for Wireless-Tag WT32-ETH01
1143-
// #define ETH_TYPE 0 // [EthType] 0 = LAN8720, 1 = TLK110/IP101, 2 = RTL8201, 3 = DP83848, 4 = RFU, 5 = KSZ8081, 6 = KSZ8041, 7 = JL1101, 8 = W5500, 9 = KSZ8851, 10 = DM9051
1144+
// #define ETH_TYPE 0 // [EthType] 0 = LAN8720, 1 = TLK110/IP101, 2 = RTL8201, 3 = DP83848, 4 = DM9051, 5 = KSZ8081, 6 = KSZ8041, 7 = JL1101, 8 = W5500, 9 = KSZ8851
11441145
// #define ETH_ADDRESS 1 // [EthAddress] 0 = PHY0 .. 31 = PHY31
11451146
// #define ETH_CLKMODE 0 // [EthClockMode] 0 = ETH_CLOCK_GPIO0_IN, 1 = ETH_CLOCK_GPIO0_OUT, 2 = ETH_CLOCK_GPIO16_OUT, 3 = ETH_CLOCK_GPIO17_OUT
11461147
// Olimex ESP32-PoE
1147-
#define ETH_TYPE 0 // [EthType] 0 = LAN8720, 1 = TLK110/IP101, 2 = RTL8201, 3 = DP83848, 4 = RFU, 5 = KSZ8081, 6 = KSZ8041, 7 = JL1101, 8 = W5500, 9 = KSZ8851, 10 = DM9051
1148+
#define ETH_TYPE 0 // [EthType] 0 = LAN8720, 1 = TLK110/IP101, 2 = RTL8201, 3 = DP83848, 4 = DM9051, 5 = KSZ8081, 6 = KSZ8041, 7 = JL1101, 8 = W5500, 9 = KSZ8851
11481149
#define ETH_ADDRESS 0 // [EthAddress] 0 = PHY0 .. 31 = PHY31
11491150
#define ETH_CLKMODE 3 // [EthClockMode] 0 = ETH_CLOCK_GPIO0_IN, 1 = ETH_CLOCK_GPIO0_OUT, 2 = ETH_CLOCK_GPIO16_OUT, 3 = ETH_CLOCK_GPIO17_OUT
11501151
// wESP32-PoE
1151-
// #define ETH_TYPE 0 // [EthType] 0 = LAN8720, 1 = TLK110/IP101, 2 = RTL8201, 3 = DP83848, 4 = RFU, 5 = KSZ8081, 6 = KSZ8041, 7 = JL1101, 8 = W5500, 9 = KSZ8851, 10 = DM9051
1152+
// #define ETH_TYPE 0 // [EthType] 0 = LAN8720, 1 = TLK110/IP101, 2 = RTL8201, 3 = DP83848, 4 = DM9051, 5 = KSZ8081, 6 = KSZ8041, 7 = JL1101, 8 = W5500, 9 = KSZ8851
11521153
// #define ETH_ADDRESS 0 // [EthAddress] 0 = PHY0 .. 31 = PHY31
11531154
// #define ETH_CLKMODE 0 // [EthClockMode] 0 = ETH_CLOCK_GPIO0_IN, 1 = ETH_CLOCK_GPIO0_OUT, 2 = ETH_CLOCK_GPIO16_OUT, 3 = ETH_CLOCK_GPIO17_OUT
11541155

0 commit comments

Comments
 (0)