enabling a lot of logging messages, e.g., by setting verbose as the
default level, can make the system unresponsive if syslogging is
enabled. to protect against this, a rate limiting algorithm is
implemented in the syslogger.
On every edit the whole HA MQTT gets published. This leads to a memory issue when saving quite often without any delay in between. The patch only send config updates every 60 seconds and adds several yield() calls.
This should also fix the crash when saving the network config very often.
The code part regarding overflow was also removed as the write method 1 in any case. Different handling regarding line break etc. in one message was also removed as the function is called only containing one log line from MessageOutput.
This implements RFC5424 version of the protocol.
Doesn't use https://github.com/arcao/Syslog since the protocol itself
is trivial and most of the libraries functionality is not needed here.
The library also doesn't support setting the PROCID field, which is set
to a random id to indicate a reboot here.
Adds UI for syslog configuration to network admin view.
MQTT messages might arrive in parts if their payload is too big. for that
reason, we need to be prepared to re-assemble fragmented messages
on a topic before handing them over to the subscriber.
Sometimes the ESP does not trigger the ARDUINO_EVENT_WIFI_STA_DISCONNECTED when a disconnect occours. In this case, no further reconnect attempt is done. To take care of this behavior, the wifi hardware is reset when no connect occours within 60 seconds..
index and total are only required to handle different payload fragments. This is not done here. In a further step, the correct fragment handling will be implemented outside this library.
the configuration write guard is now required when the configuration
struct shall be mutated. the write guards locks multiple writers against
each other and also, more importantly, makes the writes synchronous to
the main loop. all code running in the main loop can now be sure that
(1) reads from the configuration struct are non-preemtive and (2) the
configuration struct as a whole is in a consistent state when reading
from it.
NOTE that acquiring a write guard from within the main loop's task will
immediately cause a deadlock and the watchdog will trigger a reset. if
writing from inside the main loop should ever become necessary, the
write guard must be updated to only lock the mutex but not wait for a
signal.
with ESPAsyncWebServer 3.3.0, the setAuthentication() method became
deprecated and a replacement method was provided which acts as a shim
and uses the new middleware-based approach to setup authentication. in
order to eventually apply a changed "read-only access allowed" setting,
the setAuthentication() method was called periodically. the shim
implementation each time allocates a new AuthenticationMiddleware and
adds it to the chain of middlewares, eventually exhausting the memory.
we now use the new middleware-based approach ourselves and only add the
respective AuthenticatonMiddleware instance once to the respective
websocket server instance.
a regression where enabling unauthenticated read-only access is not
applied until reboot is also fixed. all the AuthenticationMiddleware
instances were never removed from the chain of middlewares when calling
setAuthentication("", "").