Commit Graph
632 Commits
Author SHA1 Message Date
Theo Arends 846490ece4 Add logging for Hosted MCU SDIO connection (#24864) 2026-07-01 16:19:26 +02:00
Theo Arends 8b4828807b Add default BSSID on initial config 2026-06-22 17:31:50 +02:00
Theo Arends 5ba66d80c3 Add command BSSid[1|2] [0|1|11:22:33:44:55:66] to select fixed WiFi Access Point disabling SetOption56 and SetOption57 (#24394) 2026-06-21 17:43:52 +02:00
joluxerandGitHub a2c38a9b76 build: copy firmware artifacts with ELF-extracted build timestamp (opt-in) (#24794)
New post-build script pio-tools/timestamp-firmware.py copies firmware
artifacts to timestamped filenames when append_timestamp = 1 is set in
the [tasmota] section of platformio_override.ini. Default off; standard
builds unaffected.

The timestamp is extracted from the ELF symbol table via nm: named PROGMEM
symbols mdate_P and mtime_P in GetBuildDateAndTime() carry __DATE__ and
__TIME__ respectively. Reading them from the ELF guarantees the filename
timestamp matches exactly the one the firmware reports at boot. No -g flag required.

Artifacts written with timestamp suffix (e.g. tasmota-4M-2026-05-01T19-02-06):
  .bin, .bin.gz, .factory.bin (ESP32)  ->  build_output/firmware/
  .elf                                 ->  build_output/firmware/
  .map.gz                              ->  build_output/map/

support_rtc.ino: mtime_P introduced as a named PROGMEM variable so nm can
locate __TIME__ by symbol name on all platforms, including ESP32 where
PSTR() is a no-op. Flash impact: +4 B; all other memory unchanged.
2026-06-13 12:23:56 +02:00
s-hadingerandGitHub 78f5526d29 Code hardening replacing strcat and strcpy with safer alternatives (#24832) 2026-06-11 14:22:26 +02:00
s-hadingerandGitHub 9afaef377e Serial console support for Backspace when enabling #define USE_SERIAL_BACKSPACE (#24830) 2026-06-10 07:55:59 +02:00
Theo Arends 01d044cedc Changed SCD30 library FrogmoreScd30 to Sensirion arduino-i2c-scd30 v1.1.1 2026-06-05 15:31:11 +02:00
Theo Arends 6300b542ee Add define USE_ESP8266_DEBUG_HEAP to control (#24777) 2026-05-25 17:27:32 +02:00
joluxerandGitHub ba88358ed6 ESP8266: fix heap metric functions and add OOM diagnostics (#24777)
* ESP8266: fix ESP_getMaxAllocHeap() and ESP_getHeapFragmentation()

Both functions returned wrong values: ESP_getMaxAllocHeap() returned
ESP.getFreeHeap() (total free, not largest contiguous block);
ESP_getHeapFragmentation() read ummHeapInfo.maxFreeContiguousBlocks,
which is only valid immediately after a umm_info() heap walk.

Fix: cache the result of umm_max_block_size() in ESP_UpdateHeapMetrics().
The cache is refreshed once per second when SetOption130 is active, and
on demand in CmndStatus() before Status 4 is output. Both getter functions
read the cached value; the call site overhead is a single integer read.

umm_max_block_size() is unconditionally available (UMM_INFO is hardcoded
in the Arduino ESP8266 umm_malloc_cfg.h), so no build flags are required.

Status 4 (StatusMEM) gains two ESP8266-specific fields: MaxFreeBlock (KB)
and Frag (%).

* ESP8266: add heap OOM diagnostics, Status 4 fields, Status 44 dump

OOM event monitoring (requires UMM_INLINE_METRICS or UMM_STATS_FULL):
- ESP_HeapOomCheck(): called once per second; logs the OOM counter delta
  when the counter changes ("OOM: count N (+M)")
- ESP_HeapOomTest(): logs current OOM count on demand

Status 4 (StatusMEM) gains additional ESP8266-specific fields when the
corresponding build flags are active:
- OomCount: cumulative out-of-memory events (UMM_INLINE_METRICS or
  UMM_STATS_FULL)
- HeapLwm (KB): heap low-watermark since boot (UMM_STATS_FULL)
- MaxAllocSz (bytes): peak single allocation size (UMM_STATS_FULL)

Status 44 (ESP8266-only diagnostic command):
- Triggers umm_info(nullptr, true) to print a full heap block map to
  the serial console
- Calls ESP_HeapOomTest() to log the current OOM count
- Returns {"Status44":{"HeapDump":"serial"}}
- Status 44 is accepted regardless of MAX_STATUS

Build flags UMM_STATS_FULL and UMM_INLINE_METRICS can be enabled via
platformio_override.ini build_flags; documented in
platformio_override_sample.ini.
2026-05-25 17:25:04 +02:00
Theo Arends bbd10227af Fix setting DISABLE_REFERER_CHK 2026-05-19 11:38:16 +02:00
Theo Arends f4aa8ed67f Increase security by inverting state of define DISABLE_REFERER_CHK, command SetOption128 controlling HTTP access which is now default off 2026-05-17 15:46:32 +02:00
91a33aa39f Add support for multi-byte chars like emojis (💡) in light device toggle buttons (#24482)
* Add support for multi-byte characters like emojis (💡) in WebButton labels for light device toggle buttons

- Remove the 3-character buffer truncation of light device toggle button labels allowing multi-byte characters like emojis
- Rely on CSS to handle truncation and add `max-width:0` to the td so it respects the provided percentage width instead of expanding to fit content
- Wrap button content in a span with overflow handling to prevent layout breakage

* Use localized `D_BUTTON_TOGGLE` for light device button default text

* Improve UTF-8 support in light device WebButton text

- Add `Utf8Truncate` function in `support.ino` to truncate UTF-8 strings to a max chars limit or max visual width limit
- Truncate light device button text to max 4 chars or max width of 4 before passing to button HTML template
- cache calls to GetWebButton so only called once and update bool var from `set_button` to `has_web_button`.

* Small tweaks to improve clarity in Utf8Truncate on codepoint limits and visual width handling

* Correctness fixes

---------

Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
2026-05-16 14:28:22 +02:00
SteWersandGitHub e8a7a209b5 Fix PulseTime Remaining (#24690)
`PulseTime` `Remaining` sometimes returns a non zero value, when no pulsetime remains. It is caused by a rollover of `millis()`.
2026-04-30 16:21:49 +02:00
Theo Arends aa4037051d Add command SetOption [0..2] to display SetOption values 2026-04-29 12:27:51 +02:00
Theo Arends dd58b80d53 Add Commands SetOption, SetOption 1 and SetOption 2 for display all SetOption values
Finally!
2026-04-28 15:31:17 +02:00
Theo Arends 518f839694 Revert "Add Commands SetOption, SetOption 1 and SetOption 2 for display all SetOption values"
This reverts commit 06b5042e17.
2026-04-28 15:10:30 +02:00
Theo Arends 06b5042e17 Add Commands SetOption, SetOption 1 and SetOption 2 for display all SetOption values
Better late than never.
2026-04-28 15:04:33 +02:00
Theo Arends 59c4d772c5 ESP8266 Remove unused I2C slave support 2026-03-26 18:00:21 +01:00
Theo Arends 84d456dbfc Remove obsolete sntp_stop() calls (#24593) 2026-03-26 10:53:32 +01:00
the-way-of-A-WildandGitHub 86bc033c86 Neutralize lwIP SNTP client to prevent heap drain on WiFi reconnects (#24593)
The ESP8266 SDK automatically invokes sntp_init() via
netif_sta_status_callback on every WiFi reconnect. This results in repeated
allocations of UDP PCBs (udp_new()), leading to heap exhaustion and
potential lwIP timeout list corruption due to unmatched sntp_stop() calls.

Tasmota does not use the lwIP SNTP client and relies solely on WifiGetNtp()
for time synchronization. To avoid unnecessary resource usage, wrap and
neutralize sntp_init() and sntp_stop() with no-op implementations.

This prevents UDP PCB allocations and avoids issues caused by repeated
initialization during reconnect cycles.

Additionally, a PlatformIO post-build script has been added to validate
that the linker wraps are correctly applied. The script runs after ELF
generation and uses xtensa-lx106-elf-nm to inspect symbols, ensuring that
the __wrap_sntp_init and __wrap_sntp_stop functions are present in the
final firmware. If the wrappers are missing, the build fails.

Confirmed via firmware disassembly:
- Single call site in netif_sta_status_callback
- Requires linker wraps: --wrap=sntp_init,--wrap=sntp_stop

Fixes: #24566
2026-03-26 10:42:02 +01:00
Theo Arends 3f38fe289e Refactor use of MAX_I2C 2026-03-21 22:08:51 +01:00
Theo Arends 7246748ffb Stop sntp every minute (#24566) 2026-03-19 16:39:33 +01:00
Theo Arends 17b1a64bee Fix I2cSetClock() 2026-03-16 17:11:42 +01:00
Theo Arends 72111857ce Fix ESP8266 heap drain and exception 29 when DHCP provides NTP server (#24515) 2026-03-16 12:14:35 +01:00
Jason2866andGitHub c446b9a87e Picolib (#24558) 2026-03-16 00:23:12 +01:00
Theo Arends 60f91ffc06 Disable Core sntp using DHCP NTP server (#24515) 2026-03-15 21:40:26 +01:00
s-hadingerandGitHub 1c90d59bbf Crash when shutting down Wifi with 'Wifi 0' (#24536) 2026-03-09 08:28:55 +01:00
Theo Arends fd68b946a9 ESP8266 redesigned I2C Wire driver to support second I2C bus
- Version v15.3.0.2
- MCP23xxx driver now supports bus2
2026-03-08 14:38:08 +01:00
Theo Arends 87a12718ae Add Support for JSON value pair "ARCH" in template being either ESP8266, ESP32, ESP32C2, ESP32C3, ESP32C5, ESP32C6, ESP32H2, ESP32H4, ESP32P4, ESP32S2 or ESP32S3 2026-03-05 15:52:14 +01:00
s-hadingerandGitHub 0529618f9b MDNS survive a Wifi restart (#24514) 2026-03-03 09:34:04 +01:00
s-hadingerandGitHub 1eb6c0ffe0 Revert "Fix ESP32 reset during WiFi reconnect when mDNS is active (#24358)" (#24507)
This reverts commit 518dbee78b.
2026-02-27 17:33:38 +01:00
utesselandGitHub 518dbee78b Fix ESP32 reset during WiFi reconnect when mDNS is active (#24358)
* Fix ESP32 reset during WiFi reconnect when mDNS is active

Explicitly call MDNS.end() before WiFi.disconnect() in support_wifi.ino.
This prevents a race condition or crash where the mDNS service attempts
to query or use the network interface while it is being torn down.

* Fix: removed lines added again.
2026-02-25 10:39:01 +01:00
Theo Arends 2f3e221738 Clean up SHT1x driver 2026-02-23 17:22:18 +01:00
Theo Arends 189dd2dd30 Add support for Sensirion STCC4 CO2 sensor
- Change SHT1x software reset I2C bus after initial (un)detection
2026-02-23 16:16:54 +01:00
Theo Arends ba0d5a9493 Change Sen6x invalid values to null 2026-02-19 13:46:56 +01:00
Theo Arends dceabb7e25 Enhance SEN6x driver with CO2 light control (SO18) 2026-02-19 09:50:26 +01:00
Theo Arends 2f240d6deb Add support for Sensirion SEN6x indoor air quality sensor (#24386) 2026-02-16 14:32:11 +01:00
Theo Arends 2eba536fc8 Update change logs 2026-02-16 10:40:59 +01:00
Theo Arends df6e26534c Add support for Sensirion SEN66 indoor air quality sensor (#24386)
Bump version v15.2.0.6
2026-02-14 15:42:49 +01:00
Theo Arends 314c2c460a Add support SPI bus2 for Ethernet and SDCard (#24433) 2026-02-13 16:50:28 +01:00
Theo Arends 04fa0d0955 Add Improv USB CDC connected devices 2026-01-29 17:45:38 +01:00
Theo Arends baf2d18eed Bump version v15.2.0.4
- Add Dingtian `SetOption81 1` to invert input and `SetOption133 1` to invert output (#24364)
- Change Dingtian define `DINGTIAN_INPUTS_INVERTED` replaced by `SetOption81` (#24364)
- Change all memmove_P to memmove (#24378)
2026-01-24 14:58:25 +01:00
a70b32b53d some display fixes (#24368)
* update udisplay

* display select JPEG decoder, adapt to 32 bit pushpixels

* new_jpeg

* backpanel mode

* Update uDisplay.cpp

---------

Co-authored-by: Gerhard Mutz <gerhardmutz1@imac.local>
2026-01-19 11:00:47 +01:00
GiulianoandGitHub 6c7f9d5565 Save some ram in esp8266 (#24340)
* Save some ram in esp8266

This will exclude the mutex variable not used by esp8266, saving some ram bytes.

Also removed a double initializzation variable is initialized ad the beginning of the function but it's also reinitialized inside if and else branches

* as suggested
2026-01-13 15:05:12 +01:00
Theo Arends 5680069768 Add ESP32 setPhyMode in WiFi Init and force HT20 2026-01-07 14:47:54 +01:00
Theo Arends 5bffce9297 Fix WiFi phy modes due to recent IDF update 2026-01-07 12:39:12 +01:00
Theo Arends 2c9d7b1176 Fix syslog format (#14689) 2025-12-10 21:18:49 +01:00
Theo Arends f084cbecb0 Update meta 2025-12-09 10:14:40 +01:00
Theo Arends 07a1a982cd Update change logs 2025-11-25 12:09:56 +01:00
Jason2866andGitHub d27c0b36be Fix p4 safeboot compile (#24119) 2025-11-14 20:26:09 +01:00