Commit Graph

2136 Commits

Author SHA1 Message Date
helgeerbe
b8fcdf3998 build: add manual lib dependency that ESPSoftwareSerial 8.0.1 can compile
Add lib dependency
https://github.com/dok-net/ghostl @ ^1.0.1
manually. ESPSoftwareSerial 8.0.1 has incorrect debendency configuration.
2024-01-16 12:55:38 +01:00
Fribur
e136e096f4
Merge branch 'development' into development 2024-01-08 11:00:59 -05:00
Bernhard Kirchen
a012d81427
avoid too frequent SmartShunt data copies (#596)
currently the whole SmartShunt data structure is copied to the
BatteryStats instance in every loop, even though the data cannot
possibly have changed. this is quite an expensive task to do in every
loop. this change tracks the last update timestamp and only does the
copy operation if an actual updated data structure was received from
the smart shunt.
2024-01-07 18:30:02 +01:00
helgeerbe
2806b6db86 set dependency for plerup/EspSoftwareSerial to 8.0.1
8.2.0 has unresolvable dependencys
2024-01-07 18:00:57 +01:00
helgeerbe
642f38ce51 Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2024-01-07 11:01:30 +01:00
helgeerbe
44d207a5f5 add webapp 2024-01-07 10:31:22 +01:00
helgeerbe
dd5d5ce9fd Prevent empty HASS auto discovery topics if memory allocation fails (onBattery) 2024-01-07 10:31:06 +01:00
helgeerbe
d0e1da7b1d Prevent config corruption by checking whether memory allocation was successfull. (onBattery) 2024-01-07 10:30:12 +01:00
helgeerbe
d6d274f078 Prevent empty HASS auto discovery topics if memory allocation fails (onBattery) 2024-01-06 22:51:35 +01:00
helgeerbe
ec93004724 Better handling of out of memory situations in live data websocket (onBattery) 2024-01-06 22:42:34 +01:00
helgeerbe
210fce67ce Use auto keyword and references more often (onBattery) 2024-01-06 22:10:07 +01:00
Fribur
92de3e9f87 fixed a bug where under one condition DNS was not tried for resolving host IP 2024-01-05 20:54:53 -05:00
helgeerbe
67e2134f7e add webapp 2024-01-05 23:03:09 +01:00
helgeerbe
d5155a07be Remove F macro from onBattery extensions 2024-01-05 23:02:26 +01:00
Thomas Basler
bfcce16bc9 webapp: update dependencies 2024-01-05 22:04:54 +01:00
Thomas Basler
6573c51052 Use auto keyword and references more often 2024-01-05 22:04:54 +01:00
Thomas Basler
24c8a40fad Use Utils::checkJsonAlloc in ConfigurationClass 2024-01-05 21:56:34 +01:00
Thomas Basler
f968179b60 Better handling of out of memory situations in live data websocket 2024-01-05 21:56:34 +01:00
Thomas Basler
f00cd1bd61 Prevent empty HASS auto discovery topics if memory allocation fails 2024-01-05 21:55:15 +01:00
Thomas Basler
88d75673fc Prevent config corruption by checking whether memory allocation was successfull. 2024-01-05 21:55:15 +01:00
Thomas Basler
a65f1e48a5 Fix: Access Point not working after firmware update
Fixes #1613
2024-01-05 21:55:15 +01:00
Thomas Basler
2a15677923 Fix: Optimize network connection handling
This should provide a more reliable connection to several AP types. See #576
2024-01-05 21:55:15 +01:00
Bernhard Kirchen
2ed66eb992 Fix: define _TASK_THREAD_SAFE for TaskScheduler
the TaskScheduler runs in the context of a FreeRTOS thread/task. there
are other such threads (MQTT client and web server in particular). to
allow changing TaskScheduler task properties from different threads, we
need to enable the use of a mutex to protect the TaskScheduler.
2024-01-05 21:55:15 +01:00
Bernhard Kirchen
377406f10c
Feature: add heap details to system info and prometheus (#595)
this change adds the values of ESP.gteMaxAllocHeap() and
ESP.getMinFreeHead() to the prometheus metrics and the system
information object. the web UI uses these values to diplay the size of
the largest free contiguous block, calculate a rough estimate for the
level of fragmentation, and the maximum usage of heap memory since boot
in absolute and relative amounts.
2024-01-05 21:46:31 +01:00
Fribur
e09ffcbb53 shorter parameter names 2024-01-05 14:39:32 -05:00
Fribur
85d0f2a8fb HttpPowerMeterClass: change order of resolving hostname
OpenDTU console gets spammed with "WifiGeneric::hostByName() error when first trying to resolve the hostname via DNS. So reverse order: first try mDNS, if that fails try DNS. Also ensure that https bool is passed correctly to HTTPClient::begin(). Lastly, concatenate strings for building Digest authorization using "+" and not via snprintf.
2024-01-05 14:36:19 -05:00
Fribur
9ed5a78818 Reverted changes to PowerLimiter, adapted DNS and mDNS handling in HttpPowerMeter
For non IP address URLs, HttpPowerMeter now first tries DNS for resolution as done in WifiClient::connect, and only if that fails tries mDNS. For the latter to work mDNS needs to be enabled in settings. Log in console if mDNS is disabled. String building for Digest authorization still tries to avoid "+" for reasons outlined in https://cpp4arduino.com/2020/02/07/how-to-format-strings-without-the-string-class.html This should also be saver than just concatenating user input strings in preventing format string attacks. https://owasp.org/www-community/attacks/Format_string_attack
2024-01-05 10:13:16 -05:00
Fribur
bc38ce344f remove FirebaseJson from platfromio.ini, fix unintended change in PowerLimiter 2024-01-04 18:22:58 -05:00
Bernhard Kirchen
3c8b8d4427
use frozen::string and frozen::map where reasonable (#593)
this change utilizes some of the features from library "frozen", which
was included upstream for the grid profile parser. to improve code
maintainability, a couple of std::maps mapping strings to values or the
other way around were introduced in OpenDTU-OnBattery-specific code at
the expense of some flash and computing overhead.

library "frozen" offers constexpr versions of map and string, which
saves initialization code and offers slightly faster lookups. this
brings the binary size down by ~25kB and should provide a small
performance improvement at runtime.
2024-01-04 23:28:34 +01:00
Thomas Basler
69cf63ed5e webapp: add app.js.gz 2024-01-04 23:02:13 +01:00
Thomas Basler
22e2d1bb54 webapp: update dependencies 2024-01-04 22:57:12 +01:00
Fribur
d5eba2392c fixed long/float parsing bug 2024-01-04 16:32:42 -05:00
Fribur
f5c69060f5 re-factoring of HttpPowerMeter
Added ability to deal with local host names (mDNS), remove use of FirebasedJson to save ~20kB build size, some changes to PowerLimiter to avoid setting new inverter power limits when not needed (=current limit as reported by inverter is within hysteresis)
2024-01-04 16:20:32 -05:00
helgeerbe
e9def28f3e add webapp 2024-01-04 15:43:08 +01:00
Bernhard Kirchen
e7a005839b
Feature: implement MQTT-driven battery provider (#589)
this battery provider implementation subscribes to a user-configurable
MQTT topic to retrieve the battery SoC value. the value is not
re-published under a different topic. there is no card created in the
web app's live view, since the SoC is already part of the totals at the
top of the live view. that is the only info this battery provider
implements.

closes #293.
relates to #581.
2024-01-04 15:42:10 +01:00
Thomas Basler
3c37b61f44 Use auto keyword and references more often 2024-01-04 15:38:56 +01:00
helgeerbe
65319ed07e log if memory allocation for live view fails
Explained in #591
2024-01-04 15:38:28 +01:00
Bernhard Kirchen
4548fc2a00
remove description of DPL from README (#588)
the DPL is described in more detail in the Wiki, which is the canonical
source of information.
2024-01-04 15:17:43 +01:00
Thomas Basler
b0b9764a23 Use Utils::checkJsonAlloc in ConfigurationClass 2024-01-04 14:47:21 +01:00
Thomas Basler
ef9f0040e8 Better handling of out of memory situations in live data websocket 2024-01-04 14:47:21 +01:00
Thomas Basler
ca18d2c841 Prevent empty HASS auto discovery topics if memory allocation fails 2024-01-04 14:09:58 +01:00
Thomas Basler
4053e31a5e Prevent config corruption by checking whether memory allocation was successfull. 2024-01-04 13:42:39 +01:00
Thomas Basler
c1fc907ecb Fix: Access Point not working after firmware update
Fixes #1613
2024-01-03 22:04:50 +01:00
helgeerbe
7946dfc0c2 add webapp 2024-01-03 13:10:50 +01:00
Thomas Basler
cbbe053cd5 Fix: Optimize network connection handling
This should provide a more reliable connection to several AP types. See #576
2024-01-03 01:17:39 +01:00
helgeerbe
2c1e145575 Merge branch 'development' of https://github.com/helgeerbe/OpenDTU into development 2024-01-01 17:20:57 +01:00
helgeerbe
bbf0003d1c Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development 2024-01-01 17:20:27 +01:00
MalteSchm
5bd3ce5a8f
Reducing lower limit for AC-charger (#574) 2024-01-01 17:06:58 +01:00
helgeerbe
cbf7680836 merge v23.12.31 2024-01-01 14:50:51 +01:00
Thomas Basler
892230b153 Merge branch 'pr1598' into dev 2023-12-31 20:23:36 +01:00