Compare commits

...
153 Commits
Author SHA1 Message Date
Jason2866andGitHub 60e1018fbf Update ldf_cache.py 2025-08-07 21:09:27 +02:00
Jason2866andGitHub fb816f3738 Create ldf_cache.py 2025-06-17 17:10:13 +02:00
Jason2866andGitHub a5b02ceb20 Update platformio.ini 2025-06-17 17:09:00 +02:00
Theo Arends 67d428cd3d Update changelogs 2025-06-17 15:50:08 +02:00
Jason2866andGitHub 384edd22a7 fix lib names (#23560) 2025-06-16 17:46:00 +02:00
Christian BaarsandGitHub fb44d42426 BLE updates for esp-nimble-cpp v2.x (#23553) 2025-06-15 18:24:54 +02:00
Christian BaarsandGitHub f378e68b3d i2s additions (#23543) 2025-06-14 16:32:54 +02:00
s-hadingerandGitHub e30ad61e00 Berry report from upstream !BE_USE_PRECOMPILED_OBJECT (#23549) 2025-06-14 16:07:31 +02:00
Theo Arends 9392ac7d55 Bump version v15.0.1.1 2025-06-14 14:31:34 +02:00
Theo Arends 76d4651163 Update changelogs 2025-06-14 12:16:08 +02:00
UBWHandGitHub ea4e399b18 Create DDS75L.be (#23545)
LoRaWAN Decoder File for Dragino DDS75-LB/LS

An Ultrasonic distance sensor

https://www.dragino.com/products/distance-level-sensor/item/271-dds75-lb-ls.html
2025-06-14 11:10:46 +02:00
s-hadingerandGitHub d4d6a2c779 LVGL HASPmora fix regression introduced with LVGL 9.3.0 (#23547) 2025-06-14 11:03:55 +02:00
s-hadingerandGitHub 390927c190 Berry fix realline (#23546) 2025-06-14 10:37:04 +02:00
s-hadingerandGitHub b5d6e95164 LVGL regression missing 'lv.ANIM_OFF' and 'lv.ANIM_ON' (#23544) 2025-06-13 22:31:12 +02:00
Theo Arends 79024cdd23 Bump version v15.0.0.1 2025-06-13 15:01:51 +02:00
Theo Arends f7d4b0e726 Update changelogs 2025-06-13 12:33:53 +02:00
Jason2866andGitHub 0687520c93 add CMakeLists.txt to gitignore 2025-06-13 11:13:31 +02:00
s-hadingerandGitHub 64d6231111 LVGL Tasmota logo splash screen (#23538) 2025-06-12 07:53:41 +02:00
s-hadingerandGitHub ea99e4724f Autoconf failing when last line has no trailing LF (#23537) 2025-06-11 23:10:20 +02:00
gemuandGitHub 004f1ec36a fix compile error when globvars not used (#23535) 2025-06-11 09:16:15 +02:00
Theo Arends 742b7338fd Update rsyslog msgid 2025-06-10 23:40:38 +02:00
s-hadingerandGitHub 84059199d4 Berry 'tasmota.is_network_up()' (#23532) 2025-06-10 20:56:50 +02:00
Theo Arends 4002344227 Fix syslog message id 2025-06-10 16:23:42 +02:00
Theo Arends bba5ba008e Format syslog messages according to RFC5424 adding local log time (#23509) 2025-06-09 17:42:58 +02:00
s-hadingerandGitHub 7c2eabcd94 Zigbee improved message when coordinator failed to start (#23525)
* Zigbee improved message when coordinator failed to start

* Faster fail
2025-06-08 19:04:17 +02:00
Theo Arends 76a39f7597 LoRaWan berry fix initial last seen 2025-06-07 14:25:55 +02:00
Theo Arends 17cc37b889 Update changelogs 2025-06-07 13:52:45 +02:00
s-hadingerandGitHub 8da8c97d4f ESP32 LVGL library from v9.2.2 to v9.3.0 (#23518) 2025-06-06 23:54:17 +02:00
Theo Arends 5522f3f6ba LoRaWan berry decoders add last seen to interrupt sensor 2025-06-06 16:09:13 +02:00
Theo Arends f3d4b5275d LoRaWan berry decoders fix invalid last seen 2025-06-05 15:08:21 +02:00
Theo Arends 26613aacb2 Add Berry mqtt publish rule processing 2025-06-05 14:04:03 +02:00
Theo Arends 4be87d41ef Fix LoRaWan decoder LHT52 battery calculation 2025-06-05 11:27:06 +02:00
Theo Arends 55c7dc0654 LoRaWan fix initial last_seen uninitialized 2025-06-04 18:38:23 +02:00
Theo Arends 93a22628e5 LoraWan change to confirmed command downlink 2025-06-04 18:13:43 +02:00
Theo Arends 263d84315f Add support for LoraWanSend and LoraWanNode 2025-06-03 17:58:35 +02:00
Theo Arends 81465a8506 Update changelogs 2025-06-03 11:15:00 +02:00
s-hadingerandGitHub bafcfcd227 Berry increase web hooks from 16 to 32 (#23507) 2025-06-02 23:12:55 +02:00
sfromisandGitHub e7f9f51e27 Update xsns_102_ld2402.ino, command table broken (#23504)
Command pointer table broken after refactoring https://github.com/arendst/Tasmota/commit/3a28938b9153d01e7ccef0a03d981251ced56123

The error with a comma before an entry instead of after, to match the other pointers, looks very obvious to me. Hence, I'm submitting this PR without having the hardware, and thus not able to do a runtime test.
2025-06-02 21:53:08 +02:00
s-hadingerandGitHub d94d7c8972 Berry change number parser for json to reuse same parser as lexer (#23505) 2025-06-02 21:42:44 +02:00
Theo Arends de0d88514a Fix button size 2025-06-01 15:50:42 +02:00
Theo Arends 601ddc564d Update changelogs 2025-06-01 14:07:25 +02:00
s-hadingerandGitHub ea9a24e76d Berry fix potential pointer underflow with string.endswith (#23496) 2025-05-31 20:02:40 +02:00
s-hadingerandGitHub 1cd4e27123 Berry fix integer and real parser to handle overflows (#23495) 2025-05-31 15:03:54 +02:00
s-hadingerandGitHub fcf4706914 Berry avoid json parsing for unmatched commands (#23494) 2025-05-30 22:34:56 +02:00
Theo Arends 692cf547cb Add Support for AP33772S USB PD Sink Controller as used in CentyLab RotoPD 2025-05-30 15:51:50 +02:00
Theo Arends 04302414c8 Berryfy code 2025-05-30 11:13:57 +02:00
Theo Arends b90ef3b400 Fix compilation 2025-05-29 17:53:55 +02:00
Theo Arends 2eb56b77a2 Change LoRaWan GUI sensor representation 2025-05-29 17:31:21 +02:00
gemuandGitHub 2914554f5e fix regression (#23483) 2025-05-28 08:13:08 +02:00
Theo Arends b822a37a7c Add command trace code to be enabled with define DEBUG_COMMAND_HANG (#23481) 2025-05-27 11:31:15 +02:00
gemuandGitHub 6aca98673d fix upd[x] chg[x] (#23477) 2025-05-26 08:05:41 +02:00
Theo Arends 429537ce4c Fix Dragino LHT65 lorawan decoder 2025-05-25 17:20:47 +02:00
Theo Arends fe596c680d Fix LoraWan config change detection 2025-05-25 16:39:30 +02:00
Jason2866andGitHub 559209ee14 Update GH Actions (#23472) 2025-05-24 14:23:47 +02:00
s-hadingerandGitHub 6a4f09c888 Berry fix vulnerability in solidify code
Found by Claude.ai
2025-05-24 09:48:42 +02:00
s-hadingerandGitHub d7f9142833 Berry fix POOL32 pointer comparison (#23468) 2025-05-23 22:45:04 +02:00
Fabrizio AmodioandGitHub 553ee44b02 Berry: 'webserver.content_status_sticker' attribute parameter added (#23466)
* Berry: 'webserver.content_status_sticker' attribute parameter added

* fix optional parameter in comment
2025-05-23 22:42:59 +02:00
Theo Arends 6853e88116 Update i18n.h 2025-05-23 16:38:25 +02:00
Theo Arends f6bf4351f5 Increase number of supported LoRaWan nodes from 4 to 16 2025-05-23 13:40:30 +02:00
sfromisandGitHub b684486570 Command lookup table in support_command.ino broken for ESP32 (#23461)
I observed that the definition of command names became mangled with commit https://github.com/arendst/Tasmota/commit/2bc5f682b04ab8fb0a7975763c1a4c2f4a8d54b5 due to vertical bar not being placed where it should. With no bar after `D_CMND_CPU_FREQUENCY`, the command name became concatenated with the next `D_CMND_SETSENSOR` with the "funny" effect that command name `CpuFrequencySetSensor` got matched with `&CmndSetSensor`

The reason for it not being matched with `&CmndCpuFrequency` is that there is a bar too many before the `Info` command name, as previous command name lines all finish with `"|"`. Hence an extra command table entry was created, meaning that the mismatch "only" affected command names `Info`, `TouchCal`, `TouchThres`, `CpuFrequency` and `SetSensor`.

Issue is only for ESP32, as both mishaps happened in a block conditional on `#ifdef ESP32`.

Arguably, it could make sense to have all the lines with command names start with `"|"` as a consistent way of formatting the lines without the special case of ending `"|"` to be omitted for the very last command name line, but I wanted to only make minimal changes
2025-05-22 22:13:52 +02:00
Theo Arends 4f4bf7c61b Add GUI support to LoRaWan decoders 2025-05-22 17:32:16 +02:00
Theo Arends 92f14dd0c0 Update changelogs 2025-05-22 10:47:30 +02:00
s-hadingerandGitHub 67d223dc78 Fix Berry solidification regression introduced in #23451 2025-05-22 08:27:41 +02:00
s-hadingerandGitHub c10686e366 Berry 'compile' and 'tasmota.compile' option to compile in local context (#23457)
* Berry 'compile' and 'tasmota.compile' option to compile in local context

* remove unwanted changes
2025-05-21 23:46:36 +02:00
Jason2866andGitHub c8d6f723c1 Beautify console log output (#23456) 2025-05-21 22:15:23 +02:00
Theo Arends 36a2d253e5 Update changelogs 2025-05-21 10:01:25 +02:00
s-hadingerandGitHub 40bc108ba1 Berry 'webserver.remove_route' to revert 'webserver.on' (#23452) 2025-05-20 23:07:05 +02:00
s-hadingerandGitHub 7ce3ba376c Berry 'introspect.module' option to not cache module entry (#23451) 2025-05-20 22:39:42 +02:00
Theo Arends 6a27899241 Update changelogs 2025-05-20 17:14:59 +02:00
Damian WrobelandGitHub a6ab85f3cd Fix version for IniFile-Tasmota (#23449)
Fixes the version string in lib/lib_ssl/IniFile-Tasmota/library.properties
file to be semver compliant to avoid build error:
  ValueError: Invalid version string: '0.0.0+modified by Tasmota, based on 1.3.0':

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2025-05-19 23:44:18 +02:00
Jason2866andGitHub 08e1ff548b Platform 2025.05.00 esp8266 Arduino core 2.7.8 (#23448)
- no changes in Arduino Core to previous Platform!
- Platform don't use Platformio registry any more
2025-05-19 20:13:12 +02:00
s-hadingerandGitHub e2d30dd64d Berry fix keys conflict (#23444) 2025-05-19 10:42:17 +02:00
Theo Arends 02ce050727 Update changelogs 2025-05-19 10:30:16 +02:00
s-hadingerandGitHub 78787f693e Berry support for 'sortedmap' (#23441)
* Berry support for 'sortedmap'

* Add keys()
2025-05-18 19:29:50 +02:00
NeuDLiandGitHub 3327f4a5ca Update IRac.cpp (#23438)
Fix the Coolix fan-only mode in IRac class.

(https://github.com/crankyoldgit/IRremoteESP8266/commit/9785cb910d2b8c81785afb58d76090cb57c5b2df)
2025-05-18 17:52:16 +02:00
Jason2866andGitHub 17210d1aca port VSC: take care of WSL use (#23440) 2025-05-18 16:30:43 +02:00
Jason2866andGitHub 54a9a117fc make new VSC port pio script more failsafe (#23439)
* no crash when VSC database is not found
* don't stop when unknown OS is detected
2025-05-18 15:41:10 +02:00
Theo Arends 2b460aa112 Update changelogs 2025-05-18 14:42:47 +02:00
Jason2866andGitHub a088c8791f provide serial upoload port from VSC to PIO (#23436) 2025-05-17 19:59:14 +02:00
s-hadingerandgithub-actions[bot] f5fe75c9b0 Solidified Code updated 2025-05-17 08:14:50 +00:00
s-hadingerandGitHub 65b1c9668f Berry remove global 'b' (#23433) 2025-05-17 10:13:15 +02:00
s-hadingerandGitHub 1ee3d8c079 Fix solidification of float on macos (#23432) 2025-05-17 09:54:32 +02:00
s-hadingerandGitHub 1306f7a8c7 Berry remove imports from globals (#23429) 2025-05-17 09:37:53 +02:00
s-hadingerandGitHub e86af24056 DNS setting with 'IPAddress4/5' not persisted (#23426) 2025-05-15 23:25:32 +02:00
s-hadingerandGitHub aff2157356 HASPmota auto-dimming when no touch (#23425) 2025-05-15 19:05:43 +02:00
NorbertandGitHub fc492bb6b2 Change the log level from INFO to Debug (#23423)
https://discord.com/channels/479389167382691863/790187952416358460/1372526416855437322
2025-05-15 15:30:12 +02:00
Theo Arends c61462a8ea Add timestamp decode to LHTxx 2025-05-15 15:17:58 +02:00
Theo Arends f90be50d2d Cleanup LoRaWan berry decoding 2025-05-15 14:27:56 +02:00
Theo Arends 0abe70816b Fix LoRaWan Decoding when SO147 is enabled 2025-05-15 13:38:19 +02:00
Theo Arends 28f4a07fd6 Add LoRaWan Decoder MerryIoT DW10 2025-05-15 11:13:55 +02:00
Theo Arends 7fb8654c6c Add Support for LoRaWan Rx1 and Rx2 profiles (#23394) 2025-05-13 16:53:02 +02:00
08e8f0b64d LoRaWan Decode Files (#23412)
* Add LoraWanDecoders

Documentation to follow in separate PR.

See https://github.com/arendst/Tasmota/discussions/23394

* Create README.md

Quick Guide

* Update README.md

Typo

---------

Co-authored-by: UBWH <clark@ubwh.com.au>
2025-05-13 08:53:07 +02:00
Jason2866andGitHub ca9df09d6a add sdkconfig.defaults to .gitignore 2025-05-12 15:25:55 +02:00
s-hadingerandGitHub 9f764ac414 TCP bridge more logging (#23410) 2025-05-11 18:41:20 +02:00
Theo Arends f660ba7e04 Add function SleepSkip(<millis> to handle imminent interrupt outside interrupt handler 2025-05-11 17:32:55 +02:00
Theo Arends 8471832b3a Update changelogs 2025-05-11 11:53:11 +02:00
Jason2866andGitHub eef115f2c5 Platform 20250530 Arduino core 3.1.3.250504 based on IDF 5.3.3.250501 (#23404)
* Platform 2025.05.30

* ESP32 CORE V.3.1.3.250504
2025-05-11 11:37:07 +02:00
s-hadingerandGitHub 56ce7b3f93 Allow temporary change of DisplayDimmer (#23406) 2025-05-11 10:43:11 +02:00
s-hadingerandGitHub b29ef3dfbc Fix 'haspmota.parse()' page parsing (#23403)
* Fix 'haspmota.parse()' page parsing

* take into account current page as default
2025-05-10 19:21:35 +02:00
Jason2866andGitHub 8ea150328d Solo1 safeboot size shrink 2025-05-10 15:35:30 +02:00
Theo Arends 3d11cc4fee Add command LoRaWanDecoder (#23394) 2025-05-10 14:44:18 +02:00
Theo Arends 42a1aee832 Bump version v14.6.0.2 2025-05-10 13:28:32 +02:00
Jason2866andGitHub 98c6b0730f Merge 54 (#487) (#23397)
* IDF 55

* Arduino based on IDF 55

* Update platformio_tasmota32.ini

* Update Tasmota_build_devel.yml

* Create platformio_override.ini

* Update platformio_tasmota32.ini

* Update Tasmota_build_devel.yml

* Update platformio_override.ini

* Update Tasmota_build_devel.yml

* Delete platformio_override.ini

* Update esp32c2.json

* Update esp32c2_2M.json

* Update platformio_tasmota32.ini

* Update PULL_REQUEST_TEMPLATE.md
2025-05-10 12:45:36 +02:00
s-hadingerandGitHub 66013fcf04 HASPmota add 'antiburn()' (#23400) 2025-05-10 11:33:14 +02:00
Theo Arends 1e74d6fd4d Fix LoRa(Wan) response after config change 2025-05-08 15:48:55 +02:00
gemuandGitHub 2d16798263 fixes (#23391) 2025-05-08 08:56:57 +02:00
Theo Arends c25b9827e8 Add support for multi channel AU915-928 LoRaWanBridge by Rob Clark (#23372) 2025-05-07 16:36:41 +02:00
Theo Arends 5475fcc8f3 Fix setting illegal LoRaWan frequencies (#23388) 2025-05-07 12:26:45 +02:00
Theo Arends 502cdfb9ea Fix inconsistent LoRaConfig 42 results (#23387) 2025-05-07 10:32:32 +02:00
Christian BaarsandGitHub 75b109c893 use smaller poly1305-donna and remove other poly1305_auth code (#23386) 2025-05-06 22:01:22 +02:00
Theo Arends b5ae6bc035 Add support for AU915 (#23372) 2025-05-06 18:30:24 +02:00
Theo Arends 5d8b90d83b Add Region to i18 2025-05-06 16:20:35 +02:00
Christian BaarsandGitHub 9329dbc52b add SSH demo driver to berry examples (#23378) 2025-05-06 10:48:50 +02:00
SteWersandGitHub c148c8e84d Set syslog severity level (#23377) 2025-05-06 10:37:20 +02:00
Theo Arends 38802ab5b7 Update changelogs 2025-05-06 10:23:48 +02:00
s-hadingerandGitHub f83b5a8c80 Berry introspect.module() failed to load modules in files (#23376) 2025-05-05 22:33:52 +02:00
Jason2866andGitHub 2ab84dd3a4 piotool python scripts refactor (#23375) 2025-05-05 13:12:30 +02:00
Theo Arends faf12234f6 Update changelogs 2025-05-04 12:30:27 +02:00
SteWersandGitHub 7624016efb Use Alias in MI32/TRV (#23368)
- Display Alias in MI32/TRV instead of type, when present
- Show device MAC in BLE log messages
2025-05-04 11:52:02 +02:00
s-hadingerandGitHub 9ed833ec5f Matter and mDNS can be enabled at the same time (#23373) 2025-05-04 10:15:07 +02:00
SteWersandGitHub d7073b3bdf Add SSID to Wifi strength indicator (#23369)
Display SSID at Wifi strength indicator to see which is the connected access point
2025-05-03 23:45:49 +02:00
Theo Arends 195fd7c6a3 GPIOViewer from v1.6.2 to v1.6.3 (No functional change) 2025-05-03 18:09:49 +02:00
Theo Arends ddf3e38ef8 Update changelogs 2025-05-02 15:16:01 +02:00
Christian BaarsandGitHub e2eae10db6 Fix log_level definition conflict (#23366) 2025-05-02 15:10:02 +02:00
Theo Arends a52f3450b8 Update changelogs 2025-05-01 14:52:26 +02:00
s-hadingerandGitHub a4ce9efd2c Berry 'display.touch_update' wrongly applies resistive calibration (#23363) 2025-04-30 22:45:19 +02:00
s-hadingerandGitHub f72a989976 WebUI status line Berry tapp for Wifi and Free Heap (#23358) 2025-04-30 10:06:48 +02:00
s-hadingerandGitHub 736d4d6576 WebUI heap status (#23356) 2025-04-30 10:01:59 +02:00
SteWersandGitHub 060f47678d Use language files for MQTT stickers (#23355) 2025-04-30 08:39:59 +02:00
Theo Arends 2e251468f9 Update RELEASENOTES.md 2025-04-29 14:48:25 +02:00
s-hadingerandGitHub ce5fae934b Fix WG bug introduced in latest PR 2025-04-29 14:14:26 +02:00
s-hadingerandGitHub 70bf5daff9 Update CHANGELOG.md 2025-04-29 14:05:30 +02:00
s-hadingerandGitHub 6cd19c0e59 WebUI status line left and renamed events 'FUNC_WEB_STATUS_left' and 'FUNC_WEB_STATUS_RIGHT' (#23354) 2025-04-29 14:04:29 +02:00
s-hadingerandGitHub 326fa9ca10 Optional Wifi strength indicator in WebUI status line (#23352) 2025-04-28 22:46:20 +02:00
s-hadingerandGitHub d95200939a Unishox show compressed size (#23351) 2025-04-28 19:37:51 +02:00
s-hadingerandGitHub 7e7f237292 Wireguard default values (#23349) 2025-04-27 23:12:18 +02:00
s-hadingerandGitHub 2c2f7f1149 Group "MQTT TLS" in a single sticker (#23348) 2025-04-27 22:31:42 +02:00
s-hadingerandGitHub 402c9e8e8d Update CHANGELOG.md 2025-04-27 21:17:25 +02:00
s-hadingerandGitHub 94652ad6ed Added Wireguard VPN (#23347) 2025-04-27 20:54:01 +02:00
Christian BaarsandGitHub 723684bb06 Berry: add crypto modules ED25519 and Chacha20-Poly1305 (#23338)
* add crypto modules for Berry

* remove Berry examples from PR
2025-04-25 00:11:47 +02:00
Theo Arends 115cefc557 Fix XModem for SecureCRT telnet client 2025-04-24 15:48:19 +02:00
s-hadingerandGitHub 0ad8696dfc WebUI status line for MQTT and TLS, added 'FUNC_WEB_STATUS' event (#23326)
* WebUI status line for MQTT and TLS, added 'FUNC_WEB_STATUS' event

* add Berry support
2025-04-21 11:32:32 +02:00
Theo Arends 6344c46d08 Lower minimum WebRefresh from 1000 to 400 2025-04-20 14:43:20 +02:00
Theo Arends ed6203e114 - Allow command WebRefresh minimum from 1000 to 400 mSec
- Fix command JsonPP <command> when showing log buffer data like in GUI console and ESP8266 Telnet.
2025-04-20 14:36:22 +02:00
Theo Arends 015fa1da89 Add command JsonPP <command>|backlog <command>;... to enable JSON PP only once 2025-04-19 16:56:15 +02:00
Theo Arends a11e269ca0 Fix Xmodem send over serial 2025-04-19 12:54:53 +02:00
Theo Arends 2831bbfd18 Update changelogs 2025-04-18 10:36:42 +02:00
bovirusandGitHub 92b3f7d37c Italian language update (#23309) 2025-04-18 10:26:10 +02:00
s-hadingerandGitHub a2d1915692 Base64 split implementation in separate file (#23313) 2025-04-17 22:38:04 +02:00
s-hadingerandGitHub 082170374c Berry string literals containing NULL are truncated (#23312) 2025-04-17 22:12:35 +02:00
s-hadingerandGitHub c2628c95f3 Berry 'bytes().asstring()' now truncates a string if buffer contains NULL (#23311) 2025-04-17 21:51:03 +02:00
Theo Arends 2bc5f682b0 Add command JsonPP 0..7 to enable (>0) JSON Pretty Print on user interfaces and set number of indents 2025-04-17 15:55:05 +02:00
Theo Arends cea46bb660 Bump version v14.6.0.1 2025-04-16 14:02:56 +02:00
1194 changed files with 180538 additions and 35274 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
- [ ] Only relevant files were touched
- [ ] Only one feature/fix was added per PR and the code change compiles without warnings
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8
- [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250411
- [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250504
- [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla).
_NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_
+18 -6
View File
@@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Make Berry and Solidify code
run: |
@@ -61,7 +61,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- uses: actions/download-artifact@v4
with:
pattern: berry
@@ -105,7 +105,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -117,6 +117,9 @@ jobs:
SHA=${COMMIT_SHA_LONG::7}
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
#- name: Use esp32-solo1 safeboot for esp32 too
#run: |
@@ -152,7 +155,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -163,6 +166,9 @@ jobs:
SHA=${COMMIT_SHA_LONG::7}
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: actions/upload-artifact@v4
@@ -200,7 +206,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -221,6 +227,9 @@ jobs:
SHA=${COMMIT_SHA_LONG::7}
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: actions/upload-artifact@v4
@@ -244,7 +253,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -265,6 +274,9 @@ jobs:
SHA=${COMMIT_SHA_LONG::7}
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
- name: Upload language firmware artifacts
uses: actions/upload-artifact@v4
+16 -4
View File
@@ -39,7 +39,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -49,6 +49,9 @@ jobs:
run: |
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- name: Upload safeboot firmware artifacts
uses: actions/upload-artifact@v4
@@ -80,7 +83,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -90,6 +93,9 @@ jobs:
run: |
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: actions/upload-artifact@v4
@@ -127,7 +133,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -146,6 +152,9 @@ jobs:
run: |
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: actions/upload-artifact@v4
@@ -169,7 +178,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
@@ -188,6 +197,9 @@ jobs:
run: |
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
- name: Upload language firmware artifacts
uses: actions/upload-artifact@v4
+16 -16
View File
@@ -31,15 +31,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- uses: actions/upload-artifact@v4
with:
@@ -59,15 +59,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- uses: actions/upload-artifact@v4
with:
@@ -117,16 +117,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
cp ./platformio_override_sample.ini ./platformio_override.ini
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}
- uses: actions/upload-artifact@v4
with:
@@ -146,15 +146,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
- name: Run PlatformIO
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: '1'
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
- uses: actions/upload-artifact@v4
with:
+2
View File
@@ -19,6 +19,8 @@ managed_components
.cache
.dummy
sdkconfig.*
sdkconfig.defaults
CMakeLists.txt
data
unpacked_fs
unpacked_boards
+92 -6
View File
@@ -3,7 +3,98 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
## [14.5.0.3]
## [15.0.1.1]
### Added
- I2S additions (#23543)
### Breaking Changed
### Changed
- BLE updates for esp-nimble-cpp v2.x (#23553)
- Library names (#23560)
### Fixed
### Removed
## [Released]
## [15.0.1] 20250614
- Release Sharon
## [15.0.0.1] 20250614
### Fixed
- LVGL regression missing `lv.ANIM_OFF` and `lv.ANIM_ON` (#23544)
- Berry fix `realline` (#23546)
- LVGL HASPmota fix regression introduced with LVGL 9.3.0 (#23547)
## [15.0.0] 20250613
- Release Sharon
## [14.6.0.2] 20250613
### Added
- Allow temporary change of DisplayDimmer (#23406)
- Support for LoRaWan Rx1 and Rx2 profiles (#23394)
- HASPmota auto-dimming when no touch (#23425)
- Provide serial upload port from VSC to PIO (#23436)
- Berry support for `sortedmap` (#23441)
- Berry `introspect.module` option to not cache module entry (#23451)
- Berry `webserver.remove_route` to revert `webserver.on` (#23452)
- Berry `compile` and `tasmota.compile` option to compile in local context (#23457)
- Support for AP33772S USB PD Sink Controller as used in CentyLab RotoPD
- Berry mqtt publish rule processing
- Berry `tasmota.is_network_up()` (#23532)
### Changed
- ESP32 Platform from 2025.04.30 to 2025.05.40, Framework (Arduino Core) from v3.1.3.250411 to v3.2.0.250504 and IDF from v5.3.2.250403 to v5.4.1.250501 (#23397)
- ESP32 Platform from 2025.05.40 to 2025.05.30, Framework (Arduino Core) from v3.2.0.250504 to v3.1.3.250504 and IDF from v5.4.1.250501 to v5.3.3.250501 (#23404)
- ESP8266 platform update from 2024.09.00 to 2025.05.00 (#23448)
- Increase number of supported LoRaWan nodes from 4 to 16
- Berry change number parser for json to reuse same parser as lexer (#23505)
- Berry increase web hooks from 16 to 32 (#23507)
- ESP32 LVGL library from v9.2.2 to v9.3.0 (#23518)
- Zigbee improved message when coordinator failed to start (#23525)
- Format syslog messages according to RFC5424 adding local log time (#23509)
### Fixed
- Haspmota `haspmota.parse()` page parsing (#23403)
- ESP32-S3 display stability regression from #23397 (#23404)
- DNS setting with `IPAddress4/5` not persisted (#23426)
- Berry avoid json parsing for unmatched commands (#23494)
- Berry integer and real parser to handle overflows (#23495)
- Berry potential pointer underflow with `string.endswith` (#23496)
- Autoconf failing when last line has no trailing LF (#23537)
- LVGL Tasmota logo splash screen (#23538)
## [14.6.0.1] 20250510
### Added
- Command `JsonPP 0..7` to enable (>0) JSON Pretty Print on user interfaces and set number of indents
- Command `JsonPP <command>|backlog <command>;...` to enable JSON PP only once
- WebUI status line for MQTT and TLS, added `FUNC_WEB_STATUS` event (#23326)
- Wireguard VPN (#23347)
- Optional Wifi strength indicator in WebUI status line (#23352)
- WebUI status line left and renamed events `FUNC_WEB_STATUS_LEFT` and `FUNC_WEB_STATUS_RIGHT` (#23354)
- WebUI heap status (#23356)
- Support for multi channel AU915-928 LoRaWanBridge by Rob Clark (#23372)
- HASPmota `antiburn()` (#23400)
### Changed
- Allow command `WebRefresh` minimum from 1000 to 400 mSec
- GPIOViewer from v1.6.2 to v1.6.3 (No functional change)
### Fixed
- Berry `bytes().asstring()` now truncates a string if buffer contains NULL (#23311)
- Berry string literals containing NULL are truncated (#23312)
- Berry `display.touch_update` wrongly applies resistive calibration (#23363)
- NimBLE log_level definition conflict (#23366)
- Matter and mDNS can be enabled at the same time (#23373)
- Berry `introspect.module()` failed to load modules in files (#23376)
## [14.6.0] 20250416
- Release Ryan
## [14.5.0.3] 20250416
### Added
- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go
- Berry `bytes.add()` now accepts 3-bytes values (#23200)
@@ -29,9 +120,6 @@ All notable changes to this project will be documented in this file.
- TLS increase timeout and fix crash (#23249)
- Berry `readline` when a line is exactly 98 characters (#23276)
### Removed
## [14.5.0.2] 20250325
### Added
- Berry load `.tapp` files in `/.extensions/` then in `/` (#23113)
@@ -77,8 +165,6 @@ All notable changes to this project will be documented in this file.
### Fixed
- Too many zeros in RCSwitch received data regression from v14.4.1.4 (#23050)
## [Released]
## [14.5.0] 20250219
- Release Ruth
+3 -2
View File
@@ -91,7 +91,7 @@ In addition to @arendst the following code is mainly owned by:
| xdrv_77_wizmote | @arendst
| xdrv_78_telnet | @arendst
| xdrv_79_esp32_ble | @staars, @btsimonh
| xdrv_80 |
| xdrv_80_wireguard_client | @s-hadinger
| xdrv_81_esp32_webcam | @gemu, @philrich
| xdrv_82_esp32_ethernet | @arendst
| xdrv_83_esp32_watch | @gemu
@@ -101,11 +101,12 @@ In addition to @arendst the following code is mainly owned by:
| xdrv_88_esp32_shelly_pro | @arendst
| xdrv_89_ |
| xdrv_90_esp32_dingtian_relay | @barbudor
| xdrv_91_ |
| xdrv_91_esp32_twai | @arendst
| xdrv_92_ |
| xdrv_93_ |
| xdrv_94_ |
| |
| xdrv_119_i2c_ap33772s | @arendst
| xdrv_120_xyzmodem | @arendst
| xdrv_121_gpioviewer | @arendst
| xdrv_122_file_settings_demo | @arendst
+1 -1
View File
@@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/CHANGELOG
## Development
[![Dev Version](https://img.shields.io/badge/development%20version-v14.5.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Dev Version](https://img.shields.io/badge/development%20version-v15.0.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/)
[![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
[![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
+1
View File
@@ -130,5 +130,6 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER
91 | USE_MS5837 | xsns_116 | MS5837 | 0x76 | | Pressure and temperature sensor
92 | USE_PCF85063 | xdrv_56 | PCF85063 | 0x51 | | PCF85063 Real time clock
93 | USE_AS33772S | xdrv_119 | AS33772S | 0x52 | Yes | AS33772S USB PD Sink Controller
NOTE: Bus2 supported on ESP32 only.
+1 -1
View File
@@ -31,7 +31,7 @@ Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/
## Development
[![Dev Version](https://img.shields.io/badge/development%20version-v14.5.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Dev Version](https://img.shields.io/badge/development%20version-v15.0.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/)
[![Tasmota CI](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
[![Build_development](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml)
+9 -51
View File
@@ -36,9 +36,9 @@ While fallback or downgrading is common practice it was never supported due to S
This release will be supported from ESP8266/Arduino library Core version **2.7.8** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
This release will be supported from ESP32/Arduino library Core version **v3.1.1.250203**.
This release will be supported from ESP32/Arduino library Core version **v3.1.3.250504**.
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.1.250203 have been removed.
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.3.250504 have been removed.
## Support of TLS
@@ -75,12 +75,12 @@ Latest released binaries can be downloaded from
- http://ota.tasmota.com/tasmota/release
Historical binaries can be downloaded from
- http://ota.tasmota.com/tasmota/release-14.5.0
- http://ota.tasmota.com/tasmota/release-15.0.1
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz``
### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.1.250203**.
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.3.250504**.
- **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY**
- **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash.
@@ -104,7 +104,7 @@ Latest released binaries can be downloaded from
- https://ota.tasmota.com/tasmota32/release
Historical binaries can be downloaded from
- https://ota.tasmota.com/tasmota32/release-14.5.0
- https://ota.tasmota.com/tasmota32/release-15.0.1
The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin``
@@ -114,58 +114,16 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
[Complete list](BUILDS.md) of available feature and sensors.
## Changelog v14.5.0.3
## Changelog v15.0.1.1
### Added
- Filesystem command ``UfsList[2]``
- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go
- Support Vango Technologies V924x ultralow power, single-phase, power measurement [#23127](https://github.com/arendst/Tasmota/issues/23127)
- Support for HLK-LD2402 24GHz smart wave motion sensor [#23133](https://github.com/arendst/Tasmota/issues/23133)
- Support for Telnet server using command `Telnet <0|1|port>[,<IP filter>]` if enabled with `#define USE_TELNET`
- Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM`
- PZEM_AC device address in JSON and GUI [#23268](https://github.com/arendst/Tasmota/issues/23268)
- Allow acl in mqtt when client certificate is in use with `#define USE_MQTT_CLIENT_CERT` [#22998](https://github.com/arendst/Tasmota/issues/22998)
- AlpineJS 2.8.2 - optional for now [#23259](https://github.com/arendst/Tasmota/issues/23259)
- ESP32 show network interface priority in `Status 5` debug logging [#23302](https://github.com/arendst/Tasmota/issues/23302)
- Berry experimental driver for AXP2101 for M5Core2v1.1 [#23039](https://github.com/arendst/Tasmota/issues/23039)
- Berry `tasmota.when_network_up()` and simplified Matter using it [#23057](https://github.com/arendst/Tasmota/issues/23057)
- Berry `introspect.solidified()` to know if a Berry object is solidified or in RAM [#23063](https://github.com/arendst/Tasmota/issues/23063)
- Berry `global.undef()` to undefine a global variable [#23073](https://github.com/arendst/Tasmota/issues/23073)
- Berry load `.tapp` files in `/.extensions/` then in `/` [#23113](https://github.com/arendst/Tasmota/issues/23113)
- Berry `re.dump()` [#23162](https://github.com/arendst/Tasmota/issues/23162)
- Berry `bytes.add()` now accepts 3-bytes values [#23200](https://github.com/arendst/Tasmota/issues/23200)
- Berry expose `esp_http_server` for websockets [#23206](https://github.com/arendst/Tasmota/issues/23206)
- Matter prepare for ICD cluster [#23158](https://github.com/arendst/Tasmota/issues/23158)
- LVGL experimental mirroring of display on Web UI [#23041](https://github.com/arendst/Tasmota/issues/23041)
- HASPmota autostart when `pages.jsonl` exists [#23181](https://github.com/arendst/Tasmota/issues/23181)
- I2S additions [#23543](https://github.com/arendst/Tasmota/issues/23543)
### Breaking Changed
- Berry remove `Leds.create_matrix` from the standard library waiting for reimplementation [#23114](https://github.com/arendst/Tasmota/issues/23114)
- HASPmota added `y2_min` and `y2_max` to control the second series of `chart` [#23287](https://github.com/arendst/Tasmota/issues/23287)
- HASPmota default theme is now Tasmota-style [#23288](https://github.com/arendst/Tasmota/issues/23288)
### Changed
- ESP32 Platform from 2025.02.30 to 2025.04.30, Framework (Arduino Core) from v3.1.1.250203 to v3.1.3.250411 and IDF from v5.3.2.250120 to 5.3.2.250403 [#23280](https://github.com/arendst/Tasmota/issues/23280)
- Output of commands `GPIO` and `GPIOs` swapped
- Smoothen light gamma curve when using `Fade` [#23230](https://github.com/arendst/Tasmota/issues/23230)
- RCSwitch `RCSWITCH_SEPARATION_LIMIT` from 4100 to 3600
- GPIOViewer from v1.6.1 to v1.6.2 (No functional change)
- HLK-LD2402 updates for firmware 3.3.5+ [#23281](https://github.com/arendst/Tasmota/issues/23281)
- ESP8266 enable FTP for >= 4MB variants [#23120](https://github.com/arendst/Tasmota/issues/23120)
- ESP32 enable webcam version 2 [#18732](https://github.com/arendst/Tasmota/issues/18732)
- Berry update flasher for Sonoff ZBBridge Pro [#23136](https://github.com/arendst/Tasmota/issues/23136)
- Berry `re` now accepts `bytes()` as precompiled patterns, added `re.compilebytes()` [#23149](https://github.com/arendst/Tasmota/issues/23149)
- LVGL, prepare for HASPmota theme, change: no-grow when clicked, DPI set to 160 [#23040](https://github.com/arendst/Tasmota/issues/23040)
- LVGL Mirroring add checkbox to enable/disable the feature (in the iterim for a better solution) [#23047](https://github.com/arendst/Tasmota/issues/23047)
- Leds Panel add checkbox to enable/disable the feature (in the iterim for a better solution) [#23048](https://github.com/arendst/Tasmota/issues/23048)
- BLE updates for esp-nimble-cpp v2.x [#23553](https://github.com/arendst/Tasmota/issues/23553)
- Library names [#23560](https://github.com/arendst/Tasmota/issues/23560)
### Fixed
- Too many zeros in RCSwitch received data regression from v14.4.1.4 [#23050](https://github.com/arendst/Tasmota/issues/23050)
- INA226 driver fixes [#23197](https://github.com/arendst/Tasmota/issues/23197)
- TLS increase timeout and fix crash [#23249](https://github.com/arendst/Tasmota/issues/23249)
- ESP32 receive incomplete serial data over 128 bytes [#23156](https://github.com/arendst/Tasmota/issues/23156)
- ESP32 intermittent exception on WiFi AP cannot be reached [#23115](https://github.com/arendst/Tasmota/issues/23115)
- ESP32-C3 WiFi sleep [#23096](https://github.com/arendst/Tasmota/issues/23096)
- Berry prevent `import` from hiding a solidified class [#23112](https://github.com/arendst/Tasmota/issues/23112)
- Berry `readline` when a line is exactly 98 characters [#23276](https://github.com/arendst/Tasmota/issues/23276)
### Removed
+2 -3
View File
@@ -5,7 +5,7 @@
# Templates
Find below the available templates as of April 2025. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates)
Find below the available templates as of June 2025. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates)
## Adapter Board
```
@@ -403,7 +403,6 @@ Shelly Vintage 4W 260lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
SmartDGM 9W 806lm {"NAME":"L-WB9W1","GPIO":[0,0,0,0,0,416,0,0,160,0,0,0,0,0],"FLAG":0,"BASE":18}
Smitch 10W 6500K {"NAME":"Smitch Ambience SB-0110","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
Smitch 10W 6500K {"NAME":"Smitch 10W 6500K Dimmable Bulb (SB0110 - E27)","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":1}
TCP Smart 806lm Warm White {"NAME":"TCP Smart Clas","GPIO":[0,0,0,0,0,0,0,0,0,416,0,0,0,0],"FLAG":0,"BASE":1}
TCP Smart 810lm Filament {"NAME":"TCP Filament","GPIO":[0,0,0,0,0,0,0,0,0,0,448,0,0,0],"FLAG":0,"BASE":18}
@@ -464,7 +463,7 @@ QS-WiFi-D01-TRIAC 150W {"NAME":"QS-WiFi-D01-TRIAC","GPIO":[0,3200,0,3232,0
RJWF-02A {"NAME":"RJWF-02A","GPIO":[32,2272,0,2304,0,0,0,0,0,0,288,0,0,0],"FLAG":0,"BASE":54}
Shelly Dimmer {"NAME":"Shelly Dimmer 1","GPIO":[0,3200,0,3232,5568,5600,0,0,192,0,193,288,0,4736],"FLAG":0,"BASE":18}
Shelly Dimmer 2 {"NAME":"Shelly Dimmer 2","GPIO":[0,3200,0,3232,5568,5600,0,0,193,0,192,0,320,4736],"FLAG":0,"BASE":18}
Shelly Plus 0-10V Dimmer {"NAME":"Shelly Plus 0-10V Dimmer","GPIO":[288,0,0,0,192,0,0,0,0,0,0,0,0,0,193,1,0,0,0,0,0,32,416,0,0,0,0,0,4736,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
Shelly Plus 0-10V Dimmer {"NAME":"Shelly Plus 0-10V Dimmer","GPIO":[288,0,0,0,192,0,0,0,0,0,0,0,0,0,193,1,0,0,0,0,0,32,448,0,0,0,0,0,4736,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
Sonoff D1 {"NAME":"Sonoff D1","GPIO":[1,3200,0,3232,0,0,0,0,0,320,0,0,0,0],"FLAG":0,"BASE":74}
```
+5
View File
@@ -41,6 +41,11 @@
"download": {
"speed": 230400
},
"espidf": {
"custom_sdkconfig": [
"CONFIG_FREERTOS_UNICORE=y"
]
},
"url": "https://www.espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf",
"vendor": "Espressif"
}
+1 -1
View File
@@ -39,6 +39,6 @@
"download": {
"speed": 230400
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
"vendor": "Espressif"
}
+1 -1
View File
@@ -39,6 +39,6 @@
"download": {
"speed": 230400
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
"vendor": "Espressif"
}
@@ -1,8 +1,8 @@
name=Unishox Compressor Decompressor highly customized and optimized for ESP8266 and Tasmota
name=Unishox (De)Compressor
version=1.0
author=Arundale Ramanathan, Stephan Hadinger
maintainer=Arun <arun@siara.cc>, Stephan <stephan.hadinger@gmail.com>
sentence=Unishox compression for Tasmota Rules
paragraph=It is based on Unishox hybrid encoding technique. This version has specific Unicode code removed for size.
paragraph=It is based on Unishox hybrid encoding technique. This Tasmota version has specific Unicode code removed for size.
url=https://github.com/siara-cc/Unishox
architectures=esp8266,esp32
+51 -27
View File
@@ -27,8 +27,8 @@ enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_D
#ifdef USE_IPV6
ip_addr_t dns_save4[DNS_MAX_SERVERS] = {}; // IPv4 DNS servers
ip_addr_t dns_save6[DNS_MAX_SERVERS] = {}; // IPv6 DNS servers
ip_addr_t dns_save4[2] = {}; // IPv4 DNS servers
ip_addr_t dns_save6[2] = {}; // IPv6 DNS servers
#endif // USE_IPV6
#include "tasmota_options.h"
@@ -76,48 +76,72 @@ extern bool WifiHasIPv6(void);
extern bool EthernetHasIPv6(void);
void WiFiHelper::scrubDNS(void) {
// AddLog(LOG_LEVEL_DEBUG, "IP>1: dns_save4 %s %s dns_save6 %s %s",
// IPAddress(&dns_save4[0]).toString().c_str(),IPAddress(&dns_save4[1]).toString().c_str(),
// IPAddress(&dns_save6[0]).toString().c_str(),IPAddress(&dns_save6[1]).toString().c_str());
// String dns_entry0 = IPAddress(dns_getserver(0)).toString();
// String dns_entry1 = IPAddress(dns_getserver(1)).toString();
// scan DNS entries
bool has_v4 = WifiHasIPv4() || EthernetHasIPv4();
bool has_v6 = false;
#ifdef USE_IPV6
has_v6 = WifiHasIPv6() || EthernetHasIPv6();
#endif
// AddLog(LOG_LEVEL_DEBUG, "IP>1: DNS: (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), has_v4, has_v6);
// First pass, save values
for (uint32_t i=0; i<DNS_MAX_SERVERS; i++) {
#ifdef USE_IPV6
// First pass, save values
for (uint32_t i=0; i<2; i++) {
const IPAddress ip_dns = IPAddress(dns_getserver(i));
// Step 1. save valid values from DNS
if (!ip_addr_isany_val((const ip_addr_t &)ip_dns)) {
if (ip_dns.type() == IPv4 && has_v4) {
ip_dns.to_ip_addr_t(&dns_save4[i]);
// dns_save4[i] = (ip_addr_t) ip_dns; // dns entry is populated, save it in v4 slot
if (ip_dns.type() == IPv4 && (has_v4 || !has_v6)) {
ip_dns.to_ip_addr_t(&dns_save4[i]); // dns entry is populated, save it in v4 slot
} else if (has_v6) {
ip_dns.to_ip_addr_t(&dns_save6[i]);
// dns_save6[i] = (ip_addr_t) ip_dns; // dns entry is populated, save it in v6 slot
ip_dns.to_ip_addr_t(&dns_save6[i]); // dns entry is populated, save it in v6 slot
}
}
// Step 2. scrub addresses not supported
if (!has_v4) { dns_save4[i] = *IP4_ADDR_ANY; }
if (!has_v6) { dns_save6[i] = *IP_ADDR_ANY; }
// Step 3. restore saved value
if (has_v4 && has_v6) { // if both IPv4 and IPv6 are active, prefer IPv4
if (!ip_addr_isany_val(dns_save4[i])) { dns_setserver(i, &dns_save4[i]); }
else { dns_setserver(i, &dns_save6[i]); }
} else if (has_v4) {
dns_setserver(i, &dns_save4[i]);
} else if (has_v6) {
dns_setserver(i, &dns_save6[i]);
} else {
dns_setserver(i, IP4_ADDR_ANY);
}
#endif // USE_IPV6
}
// AddLog(LOG_LEVEL_DEBUG, "IP>: DNS: from(%s %s) to (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString().c_str(), has_v4, has_v6);
// Step 2. scrub addresses not supported
if (!has_v4 && has_v6) { // v6 only
dns_save4[0] = *IP4_ADDR_ANY;
dns_save4[1] = *IP4_ADDR_ANY;
}
if (!has_v6) {
dns_save6[0] = *IP_ADDR_ANY;
dns_save6[1] = *IP_ADDR_ANY;
}
// Step 3. restore saved value
if (has_v4 && has_v6) { // if both IPv4 and IPv6 are active, prefer IPv4 for first and IPv6 for second
if (!ip_addr_isany_val(dns_save4[0])) {
// First DNS IPv4
dns_setserver(0, &dns_save4[0]);
if (!ip_addr_isany_val(dns_save6[0])) {
dns_setserver(1, &dns_save6[0]); // take first IPv6 as second DNS
} else {
dns_setserver(1, &dns_save4[1]); // or revert to second IPv4
}
} else {
// If no DNS IPv4, use IPv6
dns_setserver(0, &dns_save6[0]);
dns_setserver(1, &dns_save6[1]);
}
} else if (has_v6) { // v6 and no v4
dns_setserver(0, &dns_save6[0]);
dns_setserver(1, &dns_save6[1]);
} else { // no v6, we use v4 even if not connected
dns_setserver(0, &dns_save4[0]);
dns_setserver(1, &dns_save4[1]);
}
#endif // USE_IPV6
// AddLog(LOG_LEVEL_DEBUG, "IP>2: DNS: from(%s %s) to (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString().c_str(), has_v4, has_v6);
// AddLog(LOG_LEVEL_DEBUG, "IP>2: dns_save4 %s %s dns_save6 %s %s",
// IPAddress(&dns_save4[0]).toString().c_str(),IPAddress(&dns_save4[1]).toString().c_str(),
// IPAddress(&dns_save6[0]).toString().c_str(),IPAddress(&dns_save6[1]).toString().c_str());
}
+128
View File
@@ -0,0 +1,128 @@
/**
* Base64 encoding and decoding of strings. Uses '+' for 62, '/' for 63, '=' for padding
*/
#include "base64.hpp"
unsigned char binary_to_base64(unsigned char v) {
// Capital letters - 'A' is ascii 65 and base64 0
if(v < 26) return v + 'A';
// Lowercase letters - 'a' is ascii 97 and base64 26
if(v < 52) return v + 71;
// Digits - '0' is ascii 48 and base64 52
if(v < 62) return v - 4;
// '+' is ascii 43 and base64 62
if(v == 62) return '+';
// '/' is ascii 47 and base64 63
if(v == 63) return '/';
return 64;
}
unsigned char base64_to_binary(unsigned char c) {
// Capital letters - 'A' is ascii 65 and base64 0
if('A' <= c && c <= 'Z') return c - 'A';
// Lowercase letters - 'a' is ascii 97 and base64 26
if('a' <= c && c <= 'z') return c - 71;
// Digits - '0' is ascii 48 and base64 52
if('0' <= c && c <= '9') return c + 4;
// '+' is ascii 43 and base64 62
if(c == '+') return 62;
// '/' is ascii 47 and base64 63
if(c == '/') return 63;
return 255;
}
unsigned int encode_base64_length(unsigned int input_length) {
return (input_length + 2)/3*4;
}
unsigned int decode_base64_length(unsigned char input[]) {
unsigned char *start = input;
while(base64_to_binary(input[0]) < 64) {
++input;
}
unsigned int input_length = input - start;
unsigned int output_length = input_length/4*3;
switch(input_length % 4) {
default: return output_length;
case 2: return output_length + 1;
case 3: return output_length + 2;
}
}
unsigned int encode_base64(unsigned char input[], unsigned int input_length, unsigned char output[]) {
unsigned int full_sets = input_length/3;
// While there are still full sets of 24 bits...
for(unsigned int i = 0; i < full_sets; ++i) {
output[0] = binary_to_base64( input[0] >> 2);
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6);
output[3] = binary_to_base64( input[2] & 0x3F);
input += 3;
output += 4;
}
switch(input_length % 3) {
case 0:
output[0] = '\0';
break;
case 1:
output[0] = binary_to_base64( input[0] >> 2);
output[1] = binary_to_base64((input[0] & 0x03) << 4);
output[2] = '=';
output[3] = '=';
output[4] = '\0';
break;
case 2:
output[0] = binary_to_base64( input[0] >> 2);
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
output[2] = binary_to_base64((input[1] & 0x0F) << 2);
output[3] = '=';
output[4] = '\0';
break;
}
return encode_base64_length(input_length);
}
unsigned int decode_base64(unsigned char input[], unsigned char output[]) {
unsigned int output_length = decode_base64_length(input);
// While there are still full sets of 24 bits...
for(unsigned int i = 2; i < output_length; i += 3) {
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]);
input += 4;
output += 3;
}
switch(output_length % 3) {
case 1:
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
break;
case 2:
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
break;
}
return output_length;
}
-123
View File
@@ -69,127 +69,4 @@ unsigned int encode_base64(unsigned char input[], unsigned int input_length, uns
*/
unsigned int decode_base64(unsigned char input[], unsigned char output[]);
unsigned char binary_to_base64(unsigned char v) {
// Capital letters - 'A' is ascii 65 and base64 0
if(v < 26) return v + 'A';
// Lowercase letters - 'a' is ascii 97 and base64 26
if(v < 52) return v + 71;
// Digits - '0' is ascii 48 and base64 52
if(v < 62) return v - 4;
// '+' is ascii 43 and base64 62
if(v == 62) return '+';
// '/' is ascii 47 and base64 63
if(v == 63) return '/';
return 64;
}
unsigned char base64_to_binary(unsigned char c) {
// Capital letters - 'A' is ascii 65 and base64 0
if('A' <= c && c <= 'Z') return c - 'A';
// Lowercase letters - 'a' is ascii 97 and base64 26
if('a' <= c && c <= 'z') return c - 71;
// Digits - '0' is ascii 48 and base64 52
if('0' <= c && c <= '9') return c + 4;
// '+' is ascii 43 and base64 62
if(c == '+') return 62;
// '/' is ascii 47 and base64 63
if(c == '/') return 63;
return 255;
}
unsigned int encode_base64_length(unsigned int input_length) {
return (input_length + 2)/3*4;
}
unsigned int decode_base64_length(unsigned char input[]) {
unsigned char *start = input;
while(base64_to_binary(input[0]) < 64) {
++input;
}
unsigned int input_length = input - start;
unsigned int output_length = input_length/4*3;
switch(input_length % 4) {
default: return output_length;
case 2: return output_length + 1;
case 3: return output_length + 2;
}
}
unsigned int encode_base64(unsigned char input[], unsigned int input_length, unsigned char output[]) {
unsigned int full_sets = input_length/3;
// While there are still full sets of 24 bits...
for(unsigned int i = 0; i < full_sets; ++i) {
output[0] = binary_to_base64( input[0] >> 2);
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6);
output[3] = binary_to_base64( input[2] & 0x3F);
input += 3;
output += 4;
}
switch(input_length % 3) {
case 0:
output[0] = '\0';
break;
case 1:
output[0] = binary_to_base64( input[0] >> 2);
output[1] = binary_to_base64((input[0] & 0x03) << 4);
output[2] = '=';
output[3] = '=';
output[4] = '\0';
break;
case 2:
output[0] = binary_to_base64( input[0] >> 2);
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
output[2] = binary_to_base64((input[1] & 0x0F) << 2);
output[3] = '=';
output[4] = '\0';
break;
}
return encode_base64_length(input_length);
}
unsigned int decode_base64(unsigned char input[], unsigned char output[]) {
unsigned int output_length = decode_base64_length(input);
// While there are still full sets of 24 bits...
for(unsigned int i = 2; i < output_length; i += 3) {
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]);
input += 4;
output += 3;
}
switch(output_length % 3) {
case 1:
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
break;
case 2:
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
break;
}
return output_length;
}
#endif // ifndef
@@ -25,9 +25,6 @@
#include <stdlib.h>
#include <Arduino.h>
// #define strcmp_P(x, y) strcmp(x,y)
// #define strcasecmp_P(x,y) strcasecmp(x,y)
// #define pgm_read_byte(x) (*(uint8_t*)(x))
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
@@ -402,8 +402,10 @@ void IRac::airton(IRAirtonAc *ac,
const int16_t sleep) {
ac->begin();
ac->setPower(on);
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees);
// Mode needs to be set after temp as Fan-only uses a special temp.
ac->setMode(ac->convertMode(mode));
// Fan needs to be set after mode, as setMode can change the fan speed.
ac->setFan(ac->convertFan(fan));
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
// No Quiet setting available.
+504
View File
@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
(This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.)
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
{signature of Ty Coon}, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+101
View File
@@ -0,0 +1,101 @@
# IniFile
IniFile is an Arduino library for reading ini files. The format is
similar to that seen in Microsoft `.ini` files but the implementation
is completely independent. IniFile is designed to use minimal memory
requirements, and the only buffer used is one supplied by the user,
thus the user remains in charge of memory usage.
The ini file is separated into sections, where the section names are
written inside square brackets. If you don't wish to use sections then
pass a `NULL` pointer for the section name. Under each section are a
set of key-value pairs, separated by an equals sign (`=`). Spaces
around keys and values are ignored, but extra spaces inside the key
are significant. Whitespace inside the value string is preserved; if
leading or trailing whitespace is important you must quote the value
string inside the ini file, and you must strip out the quotes
yourself. If multiple entries for the same key exist inside the
selected section (if using) then only the first value is returned. If
a section is defined more than once only the first is used. The .ini
file can contain comments, which begin with a semicolon (`;`) or hash
(`#`). The user-supplied buffer must be large enough to accomodate the
longest line in the file.
## Example file format
; Semi-colon comment
[network]
mac = 01:23:45:67:89:AB
# hash comment, leading spaces below
gateway = 192.168.1.1
# extraneous spaces before and after key and value
ip = 192.168.1.2
hosts allow = example.com
# A similarly-named section
[network2]
mac = ee:ee:ee:ee:ee:ee
subnet mask=255.255.255.0
; Extra whitespace around the key and value is permitted
; (and ignored)
hosts allow = sloppy.example.com
[misc]
string = 123456789012345678901234567890123456789001234567890
string2 = a string with spaces in it
; This section is a repeat of en existing section and will be ignored.
[network]
mac = 01:23:45:67:89:ab
ip = 192.168.1.2
gateway = 192.168.1.1
## Write support
Write support is a feature that has been requested on several
occasions but as I am no longer using the IniFile library I will not
add this feature. For anyone planning to add such support the
information below may be useful.
One goal of the `IniFile` implementation was to limit the amount of
memory required. For use in embedded systems `malloc` and `new` are
deliberately not used. Another goal was that tasks which take a longer
duration were broken down into smaller chunks of work, eg
`IniFile::getValue(const char* section, const char* key, char* buffer,
int len, IniFileState &state)`. This was because I wanted my `WwwServer`
library, which uses `IniFile`, to avoid interfering with time-critical
code.
I don't think that write support can meet the time-critical goal but
that doesn't prevent its inclusion. I think the way I would choose to
implement write support is to use `IniFile::findKey()` to find where the
desired key is located in the file. I'd then copy everything up to
that point to a temporary file, insert a line for the value and new
key, skip the current line in the existing file (using
`IniFile::readline()`) and then write out the reminder of the existing
file into the temporary file. I'd like to move or rename the temporary
file over the existing file but the Arduino SD library doesn't provide
this functionality; I'd probably just copy the temporary file over the
old one and then delete the temporary one.
The code has been written under a standard Linux environment, using a
compatibility header file to mimic the SD library. This was far more
convenient than doing everything on the Arduino and enabled me to use
`gdb` to debug the code and core dumps. You'll find `arduino_compat.h`
inside the test directory, along with a `Makefile` which can be used for
regression testing. Any proposed changes must pass the regression
tests.
## Contributors
* [Steve Marple](https://github.com/stevemarple)
* [per1234](https://github.com/per1234)
* [OscarVanL](https://github.com/OscarVanL)
* [MikuX2](https://github.com/toybox01)
* [kaixxx](https://github.com/kaixxx)
@@ -0,0 +1,135 @@
#include <SD.h>
#include <SPI.h>
#include <IPAddress.h>
#include <IniFile.h>
// The select pin used for the SD card
#define SD_SELECT 10
//#define ETHERNET_SELECT 10
void printErrorMessage(uint8_t e, bool eol = true)
{
switch (e) {
case IniFile::errorNoError:
Serial.print("no error");
break;
case IniFile::errorFileNotFound:
Serial.print("file not found");
break;
case IniFile::errorFileNotOpen:
Serial.print("file not open");
break;
case IniFile::errorBufferTooSmall:
Serial.print("buffer too small");
break;
case IniFile::errorSeekError:
Serial.print("seek error");
break;
case IniFile::errorSectionNotFound:
Serial.print("section not found");
break;
case IniFile::errorKeyNotFound:
Serial.print("key not found");
break;
case IniFile::errorEndOfFile:
Serial.print("end of file");
break;
case IniFile::errorUnknownError:
Serial.print("unknown error");
break;
default:
Serial.print("unknown error value");
break;
}
if (eol)
Serial.println();
}
void setup()
{
// Configure all of the SPI select pins as outputs and make SPI
// devices inactive, otherwise the earlier init routines may fail
// for devices which have not yet been configured.
pinMode(SD_SELECT, OUTPUT);
digitalWrite(SD_SELECT, HIGH); // disable SD card
// pinMode(ETHERNET_SELECT, OUTPUT);
// digitalWrite(ETHERNET_SELECT, HIGH); // disable Ethernet
const size_t bufferLen = 80;
char buffer[bufferLen];
const char *filename = "/lunch.ini";
Serial.begin(9600);
SPI.begin();
if (!SD.begin(SD_SELECT))
while (1)
Serial.println("SD.begin() failed");
IniFile ini(filename);
if (!ini.open()) {
Serial.print("Ini file ");
Serial.print(filename);
Serial.println(" does not exist");
// Cannot do anything else
while (1)
;
}
Serial.println("Ini file exists");
// Check the file is valid. This can be used to warn if any lines
// are longer than the buffer.
if (!ini.validate(buffer, bufferLen)) {
Serial.print("ini file ");
Serial.print(ini.getFilename());
Serial.print(" not valid: ");
printErrorMessage(ini.getError());
// Cannot do anything else
while (1)
;
}
// Browse through all sections and print contents:
IniFileState state;
char sectName[bufferLen];
Serial.println();
while (ini.browseSections(sectName, bufferLen, state)) {
Serial.print("> ");
Serial.print(sectName);
if (ini.getValue(sectName, "meal", buffer, bufferLen)) {
Serial.print(" eats ");
Serial.print(buffer);
} else
Serial.print(" eats nothing");
if (ini.getValue(sectName, "drinks", buffer, bufferLen)) {
Serial.print(", drinks ");
Serial.print(buffer);
} else
Serial.print(", drinks nothing");
if (ini.getValue(sectName, "dessert", buffer, bufferLen)) {
Serial.print(" and has ");
Serial.print(buffer);
Serial.println(" for dessert.");
} else
Serial.println(" and has no dessert.");
}
// finished!
Serial.println();
printErrorMessage(ini.getError());
// Cannot do anything else
while (1)
;
}
void loop()
{
}
@@ -0,0 +1,35 @@
# IniFile browsing example
Shows how to browse through an ini file with an unknown number of sections
which all contain the same elements. This can be useful to store different
profiles which are selectable on your device.
## Instructions for use
* Copy the `lunch.ini` file to the root directory of your (micro)SD card.
* Modify the `IniBrowseExample.ino` file so that `SD_SELECT` defines
the correct pin number.
* Compile and upload the sketch.
## Expected output
It may take a few seconds from the sketch starting before anything is
printed to the serial port, be patient. If the sketch runs correctly
the output should appear as below:
Ini file exists
> Karen eats burger, drinks beer and has chocolate for dessert.
> Peter eats falafel, drinks tea without milk and has vegan icecream for dessert.
> Noel eats sushi, drinks water and has no dessert.
> Jessica eats sandwich, drinks nothing and has muffin for dessert.
end of file
If the SD card is missing or cannot be read the sketch will print:
SD.begin() failed
@@ -0,0 +1,22 @@
; A list of settings/profiles stored as sections.
; Each profile has the same elements.
[Karen]
meal = burger
drinks = beer
dessert = chocolate
[Peter]
meal = falafel
drinks = tea without milk
dessert = vegan icecream
[Noel]
meal = sushi
drinks = water
; note: dessert is missing here
[Jessica]
meal = sandwich
; no drinks
dessert = muffin
@@ -0,0 +1,143 @@
#include <SD.h>
#include <SPI.h>
#include <IPAddress.h>
#include <IniFile.h>
// The select pin used for the SD card
//#define SD_SELECT 4
#define SD_SELECT 22
#define ETHERNET_SELECT 10
void printErrorMessage(uint8_t e, bool eol = true)
{
switch (e) {
case IniFile::errorNoError:
Serial.print("no error");
break;
case IniFile::errorFileNotFound:
Serial.print("file not found");
break;
case IniFile::errorFileNotOpen:
Serial.print("file not open");
break;
case IniFile::errorBufferTooSmall:
Serial.print("buffer too small");
break;
case IniFile::errorSeekError:
Serial.print("seek error");
break;
case IniFile::errorSectionNotFound:
Serial.print("section not found");
break;
case IniFile::errorKeyNotFound:
Serial.print("key not found");
break;
case IniFile::errorEndOfFile:
Serial.print("end of file");
break;
case IniFile::errorUnknownError:
Serial.print("unknown error");
break;
default:
Serial.print("unknown error value");
break;
}
if (eol)
Serial.println();
}
void setup()
{
// Configure all of the SPI select pins as outputs and make SPI
// devices inactive, otherwise the earlier init routines may fail
// for devices which have not yet been configured.
pinMode(SD_SELECT, OUTPUT);
digitalWrite(SD_SELECT, HIGH); // disable SD card
pinMode(ETHERNET_SELECT, OUTPUT);
digitalWrite(ETHERNET_SELECT, HIGH); // disable Ethernet
const size_t bufferLen = 80;
char buffer[bufferLen];
const char *filename = "/net.ini";
Serial.begin(9600);
SPI.begin();
if (!SD.begin(SD_SELECT))
while (1)
Serial.println("SD.begin() failed");
IniFile ini(filename);
if (!ini.open()) {
Serial.print("Ini file ");
Serial.print(filename);
Serial.println(" does not exist");
// Cannot do anything else
while (1)
;
}
Serial.println("Ini file exists");
// Check the file is valid. This can be used to warn if any lines
// are longer than the buffer.
if (!ini.validate(buffer, bufferLen)) {
Serial.print("ini file ");
Serial.print(ini.getFilename());
Serial.print(" not valid: ");
printErrorMessage(ini.getError());
// Cannot do anything else
while (1)
;
}
// Fetch a value from a key which is present
if (ini.getValue("network", "mac", buffer, bufferLen)) {
Serial.print("section 'network' has an entry 'mac' with value ");
Serial.println(buffer);
}
else {
Serial.print("Could not read 'mac' from section 'network', error was ");
printErrorMessage(ini.getError());
}
// Try fetching a value from a missing key (but section is present)
if (ini.getValue("network", "nosuchkey", buffer, bufferLen)) {
Serial.print("section 'network' has an entry 'nosuchkey' with value ");
Serial.println(buffer);
}
else {
Serial.print("Could not read 'nosuchkey' from section 'network', error was ");
printErrorMessage(ini.getError());
}
// Try fetching a key from a section which is not present
if (ini.getValue("nosuchsection", "nosuchkey", buffer, bufferLen)) {
Serial.print("section 'nosuchsection' has an entry 'nosuchkey' with value ");
Serial.println(buffer);
}
else {
Serial.print("Could not read 'nosuchkey' from section 'nosuchsection', error was ");
printErrorMessage(ini.getError());
}
// Fetch a boolean value
bool allowPut; // variable where result will be stored
bool found = ini.getValue("/upload", "allow put", buffer, bufferLen, allowPut);
if (found) {
Serial.print("The value of 'allow put' in section '/upload' is ");
// Print value, converting boolean to a string
Serial.println(allowPut ? "TRUE" : "FALSE");
}
else {
Serial.print("Could not get the value of 'allow put' in section '/upload': ");
printErrorMessage(ini.getError());
}
}
void loop()
{
}
@@ -0,0 +1,29 @@
# IniFile example
## Instructions for use
* Copy the `net.ini` file to the root directory of your (micro)SD card.
* Modify the `IniFileExample.ino` file so that `SD_SELECT` defines
the correct pin number.
* Compile and upload the sketch.
## Expected output
It may take a few seconds from the sketch starting before anything is
printed to the serial port, be patient. If the sketch runs correctly
the output should appear as below:
Ini file exists
section 'network' has an entry 'mac' with value 01:23:45:67:89:AB
Could not read 'nosuchkey' from section 'network', error was key not found
Could not read 'nosuchkey' from section 'nosuchsection', error was section not found
The value of 'allow put' in section '/upload' is TRUE
If the SD card is missing or cannot be read the sketch will print:
SD.begin() failed
@@ -0,0 +1,68 @@
; Semi-colon comment
[network]
mac = 01:23:45:67:89:AB
# hash comment, leading spaces below
gateway = 192.168.1.1
# extraneous spaces before and after key and value
ip = 192.168.1.2
hosts allow = example.com
# A similarly-named section
[network2]
mac = ee:ee:ee:ee:ee:ee
subnet mask=255.255.255.0
; Test extra whitespace in keys and value
hosts allow = sloppy.example.com
[misc]
string = 123456789012345678901234567890123456789001234567890
string2 = a string with spaces in it
; ini file for WwwServerExample
[mime types]
default = text/plain
htm = text/html
bin = application/octet-stream
pdf = application/pdf
[/]
; no access to root of SD filesystem
handler = default
error document 403 = /errordoc/403.htm
[/www.ini]
handler = default
[/data]
handler = default
[/data/private]
; Block access to this directory
handler = prohibit
error document 403 = /data/private/403.htm
[/data/noaccess.txt]
; Block access to this file
handler = prohibit
[/status]
; built-in status handler
handler = status
[/cgi]
; User-defined handler
handler = cgi
[/src]
; A redirect
handler = temporary redirect
location = http://github.com/stevemarple/WwwServer
[/upload]
allow put = true
@@ -0,0 +1,9 @@
name=IniFile
version=1.3.0+tasmota
author=Steve Marple <stevemarple@googlemail.com>, Stephan Hadiger
maintainer=Steve Marple <stevemarple@googlemail.com>, Stephan Hadiger
sentence=Library to read and parse .ini files, adapted for Tasmota
paragraph=IniFile is a library to read and parse .ini files as used by Microsoft Windows. IniFile is designed to use minimal memory requirements, and the only buffer used is one supplied by the user, thus the user remains in charge of memory usage. GNU LGPL v2.1.
category=Other
url=https://github.com/stevemarple/IniFile
architectures=*
+498
View File
@@ -0,0 +1,498 @@
#include "IniFile.h"
#include <Arduino.h>
#include "base64.hpp"
//**************************************************************************************************************
// enable AddLog support within a C++ library
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE};
//**************************************************************************************************************
extern FS *ffsp;
IniFile::IniFile(File &file)
{
_file = file;
}
IniFile::~IniFile()
{
//if (_file)
// _file.close();
}
IniFile::error_t IniFile::getError(void)
{
return _error;
}
void IniFile::clearError(void)
{
_error = errorNoError;
}
bool IniFile::getValue(const char* section, const char* key, IniFileState &state)
{
char *cp = nullptr;
char *bufptr = buffer;
bool done = false;
if (!_file) {
_error = errorFileNotOpen;
return true;
}
switch (state.getValueState) {
case IniFileState::funcUnset:
state.getValueState = (section == NULL ? IniFileState::funcFindKey
: IniFileState::funcFindSection);
state.readLinePosition = 0;
break;
case IniFileState::funcFindSection:
if (findSection(section, state)) {
if (_error != errorNoError)
return true;
state.getValueState = IniFileState::funcFindKey;
}
break;
case IniFileState::funcFindKey:
if (findKey(section, key, &cp, state)) {
if (_error != errorNoError)
return true;
// Found key line in correct section
cp = skipWhiteSpace(cp);
removeTrailingWhiteSpace(cp);
// Copy from cp to buffer, but the strings overlap so strcpy is out
while (*cp != '\0')
*bufptr++ = *cp++;
*bufptr = '\0';
return true;
}
break;
default:
// How did this happen?
_error = errorUnknownError;
done = true;
break;
}
return done;
}
bool IniFile::getValue(const char* section, const char* key)
{
IniFileState state;
while (!getValue(section, key, state))
;
return _error == errorNoError;
}
bool IniFile::getValueStr(const char* section, const char* key, char *value, size_t vlen)
{
if (!getValue(section, key)) return false; // error
if (strlen(buffer) >= vlen) return false;
strcpy(value, buffer);
return true;
}
bool IniFile::getValueString(const char* section, const char* key, String &value)
{
if (!getValue(section, key)) return false; // error
value = buffer;
return true;
}
// For true accept: true, yes, 1
// For false accept: false, no, 0
bool IniFile::getValueBool(const char* section, const char* key, bool& val)
{
if (!getValue(section, key))
return false; // error
if (strcasecmp_P(buffer, PSTR("true")) == 0 ||
strcasecmp_P(buffer, PSTR("yes")) == 0 ||
strcasecmp_P(buffer, PSTR("1")) == 0) {
val = true;
return true;
}
if (strcasecmp_P(buffer, PSTR("false")) == 0 ||
strcasecmp_P(buffer, PSTR("no")) == 0 ||
strcasecmp_P(buffer, PSTR("0")) == 0) {
val = false;
return true;
}
return false; // does not match any known strings
}
bool IniFile::getValueInt(const char* section, const char* key, int32_t& val)
{
if (!getValue(section, key)) return false; // error
val = atoi(buffer);
return true;
}
bool IniFile::getValueUInt16(const char* section, const char* key, uint16_t& val)
{
int32_t val32;
if (!getValue(section, key)) return false; // error
val32 = atoi(buffer);
if (val32 < 0 || val32 > 65535) return false;
val = (uint16_t) val32;
return true;
}
bool IniFile::getValueFloat(const char* section, const char* key, float & val)
{
if (!getValue(section, key))
return false; // error
char *endptr;
float tmp = strtod(buffer, &endptr);
if (endptr == buffer)
return false; // no conversion
if (*endptr == '\0') {
val = tmp;
return true; // valid conversion
}
// buffer has trailing non-numeric characters, and since the buffer
// already had whitespace removed discard the entire results
return false;
}
bool IniFile::getIPAddress(const char* section, const char* key, ip_addr_t *ip)
{
if (!getValue(section, key)) return false; // error
IPAddress ipaddr;
if (!ipaddr.fromString(buffer)) { return false; }
#ifdef ESP32
ipaddr.to_ip_addr_t(ip);
#else
*ip = ipaddr;
#endif
return true;
}
bool IniFile::getMACAddress(const char* section, const char* key,
uint8_t mac[6])
{
// Need 18 chars: 6 * 2 hex digits, 5 : or - and a null char
if (bufferLen < 18)
return false;
if (!getValue(section, key))
return false; // error
int i = 0;
char* cp = buffer;
memset(mac, 0, 6);
while (*cp != '\0' && i < 6) {
if (*cp == ':' || *cp == '-') {
++i;
++cp;
continue;
}
if (isdigit(*cp)) {
mac[i] *= 16; // working in hex!
mac[i] += (*cp - '0');
}
else {
if (isxdigit(*cp)) {
mac[i] *= 16; // working in hex!
mac[i] += (toupper(*cp) - 55); // convert A to 0xA, F to 0xF
}
else {
memset(mac, 0, 6);
return false;
}
}
++cp;
}
return true;
}
bool IniFile::getValueBase64(const char* section, const char* key, uint8_t *value, size_t vlen)
{
if (!getValue(section, key)) return false; // error
size_t len = decode_base64_length((unsigned char*)buffer);
if (len != vlen) return false;
len = decode_base64((unsigned char*)buffer, value);
return true;
}
bool IniFile::parseCIDR(String& cidr, ip_addr_t *ip, ip_addr_t *mask)
{
int32_t slash = cidr.indexOf('/');
if (slash < 0) { return false; }
IPAddress ipaddr;
if (!ipaddr.fromString(cidr.substring(0, slash))) { return false; }
#ifdef ESP32
ipaddr.to_ip_addr_t(ip);
#else
*ip = ipaddr;
#endif
int32_t prefixLen = cidr.substring(slash + 1).toInt();
if (prefixLen < 0 || prefixLen > 32) { return false; }
IPAddress maskaddr((prefixLen <= 0) ? 0 : (0xFFFFFFFF >> (32 - prefixLen)));
#ifdef ESP32
maskaddr.to_ip_addr_t(mask);
#else
*mask = maskaddr;
#endif
return true;
}
bool IniFile::getCIDR(const char* section, const char* key, ip_addr_t *ip, ip_addr_t *mask)
{
String cidr;
if (!getValueString(section, key, cidr)) return false; // error
return parseCIDR(cidr, ip, mask);
}
bool IniFile::getDomainPort(const char* section, const char* key, String &domain, uint16_t &port, uint16_t default_port)
{
if (!getValueString(section, key, domain)) return false; // error
int32_t colon = domain.indexOf(':');
if (colon == 0) { return false; } // having an empty domain is wrong
if (colon > 0) {
port = domain.substring(colon + 1).toInt();
domain = domain.substring(0, colon);
} else {
port = default_port;
}
return true;
}
// From the file location saved in 'state' look for the next section and read its name.
// The name will be in the buffer. Returns false if no section found.
bool IniFile::browseSections(IniFileState &state)
{
error_t err = errorNoError;
char *bufptr = &buffer[0];
do {
err = IniFile::readLine(_file, state.readLinePosition);
if (err != errorNoError) {
// end of file or other error
_error = err;
return false;
} else {
char *cp = skipWhiteSpace(buffer);
if (*cp == '[') {
// Found a section, read the name
++cp;
cp = skipWhiteSpace(cp);
char *ep = strchr(cp, ']');
if (ep != NULL) {
*ep = '\0'; // make ] be end of string
removeTrailingWhiteSpace(cp);
// Copy from cp to buffer, but the strings overlap so strcpy is out
while (*cp != '\0')
*bufptr++ = *cp++;
*bufptr = '\0';
_error = errorNoError;
return true;
}
}
}
// continue searching
} while (err == errorNoError);
// we should never get here...
_error = err;
return false;
}
IniFile::error_t IniFile::readLine(File &file, uint32_t &pos)
{
if (!file)
return errorFileNotOpen;
if (bufferLen < 3)
return errorBufferTooSmall;
if (!file.seek(pos))
return errorSeekError;
size_t bytesRead = file.readBytes(buffer, bufferLen);
if (!bytesRead) {
buffer[0] = '\0';
//return 1; // done
return errorEndOfFile;
}
for (size_t i = 0; i < bytesRead && i < bufferLen-1; ++i) {
// Test for '\n' with optional '\r' too
// if (endOfLineTest(i, '\n', '\r')
if (buffer[i] == '\n' || buffer[i] == '\r') {
char match = buffer[i];
char otherNewline = (match == '\n' ? '\r' : '\n');
// end of line, discard any trailing character of the other sort
// of newline
buffer[i] = '\0';
if (buffer[i+1] == otherNewline)
++i;
pos += (i + 1); // skip past newline(s)
//return (i+1 == bytesRead && !file.available());
return errorNoError;
}
}
if (!file.available()) {
// end of file without a newline
buffer[bytesRead] = '\0';
// return 1; //done
return errorEndOfFile;
}
buffer[bufferLen-1] = '\0'; // terminate the string
return errorBufferTooSmall;
}
bool IniFile::isCommentChar(char c)
{
return (c == ';' || c == '#');
}
char* IniFile::skipWhiteSpace(char* str)
{
char *cp = str;
if (cp)
while (isspace(*cp))
++cp;
return cp;
}
void IniFile::removeTrailingWhiteSpace(char* str)
{
if (str == nullptr)
return;
char *cp = str + strlen(str) - 1;
while (cp >= str && isspace(*cp))
*cp-- = '\0';
}
bool IniFile::findSection(const char* section, IniFileState &state)
{
if (section == NULL) {
_error = errorSectionNotFound;
return true;
}
error_t err = IniFile::readLine(_file, state.readLinePosition);
if (err != errorNoError && err != errorEndOfFile) {
// Signal to caller to stop looking and any error value
_error = err;
return true;
}
char *cp = skipWhiteSpace(buffer);
//if (isCommentChar(*cp))
//return (done ? errorSectionNotFound : 0);
if (isCommentChar(*cp)) {
// return (err == errorEndOfFile ? errorSectionNotFound : errorNoError);
if (err == errorEndOfFile) {
_error = errorSectionNotFound;
return true;
}
else
return false; // Continue searching
}
if (*cp == '[') {
// Start of section
++cp;
cp = skipWhiteSpace(cp);
char *ep = strchr(cp, ']');
if (ep != NULL) {
*ep = '\0'; // make ] be end of string
removeTrailingWhiteSpace(cp);
if (strcmp(cp, section) == 0) {
_error = errorNoError;
return true;
}
}
}
// Not a valid section line
//return (done ? errorSectionNotFound : 0);
if (err == errorEndOfFile) {
_error = errorSectionNotFound;
return true;
}
return false;
}
// From the current file location look for the matching key. If
// section is non-NULL don't look in the next section
bool IniFile::findKey(const char* section, const char* key,
char** keyptr,
IniFileState &state)
{
if (key == NULL || *key == '\0') {
_error = errorKeyNotFound;
return true;
}
error_t err = IniFile::readLine(_file, state.readLinePosition);
if (err != errorNoError && err != errorEndOfFile) {
_error = err;
return true;
}
char *cp = skipWhiteSpace(buffer);
// if (isCommentChar(*cp))
// return (done ? errorKeyNotFound : 0);
if (isCommentChar(*cp)) {
if (err == errorEndOfFile) {
_error = errorKeyNotFound;
return true;
}
else
return false; // Continue searching
}
if (section && *cp == '[') {
// Start of a new section
_error = errorKeyNotFound;
return true;
}
// Find '='
char *ep = strchr(cp, '=');
if (ep != NULL) {
*ep = '\0'; // make = be the end of string
removeTrailingWhiteSpace(cp);
if (strcmp(cp, key) == 0) {
*keyptr = ep + 1;
_error = errorNoError;
return true;
}
}
// Not the valid key line
if (err == errorEndOfFile) {
_error = errorKeyNotFound;
return true;
}
return false;
}
IniFileState::IniFileState()
{
readLinePosition = 0;
getValueState = funcUnset;
}
+117
View File
@@ -0,0 +1,117 @@
#ifndef _INIFILE_H
#define _INIFILE_H
#include <stdint.h>
#include <FS.h>
#include "IPAddress.h"
#define INIFILE_VERSION "1.3.0"
class IniFileState;
class IniFile {
public:
enum error_t {
errorNoError = 0,
errorFileNotFound,
errorFileNotOpen,
errorBufferTooSmall,
errorSeekError,
errorSectionNotFound,
errorKeyNotFound,
errorEndOfFile,
errorUnknownError,
};
// Create an IniFile object. It isn't opened until open() is called on it.
IniFile(File &file);
~IniFile();
error_t getError(void);
void clearError(void);
// Get value from the file, but split into many short tasks. Return
// value: false means continue, true means stop. Call getError() to
// find out if any error
bool getValue(const char* section, const char* key, IniFileState &state);
// Get value, as one big task. Return = true means value is present
// in buffer
bool getValue(const char* section, const char* key);
// Get the value as a string, storing the result in a new buffer
// (not the working buffer)
bool getValueStr(const char* section, const char* key, char *value, size_t vlen);
bool getValueString(const char* section, const char* key, String &value);
// Get a boolean value
bool getValueBool(const char* section, const char* key, bool& b);
// Get an integer value
bool getValueInt(const char* section, const char* key, int32_t& val);
// Get an uint16_t value
bool getValueUInt16(const char* section, const char* key, uint16_t& val);
// Get a float value
bool getValueFloat(const char* section, const char* key, float& val);
bool getIPAddress(const char* section, const char* key, ip_addr_t *ip);
bool getMACAddress(const char* section, const char* key,uint8_t mac[6]);
bool getValueBase64(const char* section, const char* key, uint8_t *value, size_t vlen);
static bool parseCIDR(String& str, ip_addr_t *ip, ip_addr_t *mask);
bool getCIDR(const char* section, const char* key, ip_addr_t *ip, ip_addr_t *mask);
bool getDomainPort(const char* section, const char* key, String &domain, uint16_t &port, uint16_t default_port);
// From the file location saved in 'state' look for the next section and read its name.
// The name will be in the buffer. Returns false if no section found.
bool browseSections(IniFileState &state);
// Utility function to read a line from a file, make available to all
//static int8_t readLine(File &file, char *buffer, size_t len, uint32_t &pos);
error_t readLine(File &file, uint32_t &pos);
static bool isCommentChar(char c);
static char* skipWhiteSpace(char* str);
static void removeTrailingWhiteSpace(char* str);
protected:
// True means stop looking, false means not yet found
bool findSection(const char* section, IniFileState &state);
bool findKey(const char* section, const char* key, char** keyptr, IniFileState &state);
private:
String _filename;
error_t _error;
File _file;
static constexpr size_t bufferLen = 80;
char buffer[bufferLen];
};
class IniFileState {
public:
IniFileState();
private:
enum {funcUnset = 0,
funcFindSection,
funcFindKey,
};
uint32_t readLinePosition;
uint8_t getValueState;
friend class IniFile;
};
#endif
+32
View File
@@ -0,0 +1,32 @@
Copyright (c) 2021 Kenta Ida (fuga@fugafuga.org)
Copyright (c) 2022 Tomoyuki Sakurai (y@trombik.org)
Copyright (c) 2023-2024 Simone Rossetto (simros85@gmail.com)
The original license is below:
Copyright (c) 2021 Daniel Hope (www.floorsense.nz)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of "Floorsense Ltd", "Agile Workspace Ltd" nor the names of
its contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Author: Daniel Hope <daniel.hope@smartalock.com>

Some files were not shown because too many files have changed in this diff Show More