if data size and crc are ok, make sure to notify the caller
rework parameter injection and make sure endianess is right
auto-calibration and range are both a setting and a build flag
* clean-up useless stream read() / flush(), rely on timer and internal state
avoids wdt reset with sensors looping on available()
* fix some instances of `available()` in boolean context to use `>0`
(not everything returns sign, but if it does - we are in trouble)
* util func to read available bytes from the stream using buffered
interface instead of 1 byte at a time
* stateless callbacks for mqttRegister. no module uses the lambda / std
func with captures or otherwise, so it is kind of pointless to have it
* make sure we know topic and payload length at all invocations and
not constantly trying to re-parse the same string over and over again
* clean-up api related to string parsing and make sure we allow
stringview as input
* clean-up id / unsigned number parsing to work with views instead of
using a generic strto{,u}l; sometimes this works, sometimes doesn't.
as noticed previously with IR implementation, it *will* parse until
the '\0' is found in the input and we can't interpret parts of the
string without doing a copy for the strtoul
* fixing additional bugs caught in ifan, leds, sensors and lights that
were causing build failures. plus, more range-based parsing code for
the same reason as described above
One server implementation instead of two, plus simplify I/O operations
scheduling by processing everything in loop regardless of the server
type used.
Make it possible to accept authorization and several commands in a
single packet. If we fail the check, clients discards rest of the data.
Since we finally track connection state, debug info gets set *only* to
authorized clients.
get rid of board module, replace with system calls for hostname, board
and password. move boot (quirks) handlers to system as well
espurna::build { ... } namespace for our app const values
Restore behaviour from dd12251e437ba1283024 unintentionally removed it
Instead of reverting to the 'atof' code, just use the provided string
as-is via RawJson (aka `serialized()` in the v6)
Note that the old approach may have caused some silent data loss b/c the
data could have been stored in 'double' or 'u64', where the ArduinoJson
only stores 'u32' and 'float' in it's internal buffer and does not (really)
warn us about any type incompatibilities.
(at least by default. but, the alternative is to store all floating point
numbers as 'double' internally, see ArduinoJson/Configuration.hpp)
resolves#2503
Settling on naming 'options' for enumerations (...possibly, everything
else in the future, would that make sense to store for 'setting' object)
Update terminal commands that were reporting status to also report a
full list of 'indexed' settings for the specific entity
Also updates the WebUI outputs which are (hopefuly) are already handled
as-is through the .js processing pipeline and the .html properties
receiving certain special string values
More namespacing and save ~2KiB of RAM by reducing the amount of loaded keys strings
However, ROM side of things may suffer b/c of template specializations for the
generic conversion functions when there are many different types involved.
Make sure to properly clamp delay times, as the recent issue had shown
it is possible to go below the update limit. SNTP app does not do any
runtime checks, so it's up to us to enforce these limits
Update internal random number generator from raw `secureRandom()` to a custom
'std::random_device'-look-alike, where we could also use it with STL functions
(current implementation is `os_random()` aka `esp_random()`)
- BREAKING replace loadavg and system check from millis to seconds
- implement all available system clocks, make sure it is correctly
scaled with the origin type
- fix duration::{millis(),ccount(),seconds()} and return a respective
clock's time_point instead of duration. just like led sources, make
sure every module stores timestamps as time_point and intervals as
duration
- no need to track millis overflow on top of existing overflow counter
of the micros64 in getUptime
- remove class overhead in led static delays conversion, just try to
inline the required calculations and use NAME as unique id
also fix some non-apparent issues with heartbeat
- allow zero interval when it is also Mode::Once
- iterating runners to find the interval might return zero
- provide a queue for the outgoing messages, don't depend on the MQTT
callback implementation details and always postpone the actual transfer.
- generate user input parsers using re2c, adds special PlatformIO build handlers
- add terminal command to show GPIO info and send a simple payload
- rework button<->action presets into value<->terminal command presets and custom ones
through the use of `irCmd<VALUE>` settings, where the VALUE is taken from the simple payload
(yet, it does not understand repeated codes, but that's something to add later *or* use rpnlib)
- add tx message integration for the relay module via `irRelayOn#` and `irRelayOff#`
- rework simple payload to include 'repeats' value for the 'IRsend::send()'
also adds internal 'series', 'delay' and includes full 64bit 'value'
(as uppercase HEX, instead of decimal)
- rework raw payload to use 'series' instead of 'repeats', and provide a
clear distinction between the usec time and the options of the message
by moving the required options to the front and separating them using ':'
(just like the simple variant)
- make RX and TX pin a runtime setting, make RX and TX support a build flag
- small test framework to check whether internal string encode<->decode works
Also updates the hexEncode & hexDecode implementations to use
'iterators' instead of just pointer + index.
- reduce info lines on boot
- more compact `info` command. show versions, modules and crash info when there is one
- add `storage` command to display flash layout (experimental)
- display full chip id aka MAC, including the oui
- fix telnet never printing the crash data b/c telnet in not yet authorized
- fix eeprom size not reflecting the space used by the backup sectors
- use static flash strings when possible for the fw info
Namespace build configurations of modules, make more things into constexpr
(not fully finished though)
Unify code using ...Count() to parse IDs
Avoid using unsigned char aka uint8_t as index, prefer size_t
as most code already uses it anyway. Making sure we never accidentally
truncate the value or try to read it as 32bit-wide. Also, simplify
access to built in containers, since those use the wide type as well.
Renames led and button types, more consistent initialization and field access.
- shrink utils source file, move heartbeat and boot management into system
- improvise with 'heartbeat' functionality. include scheduler implementation that will
manage the per-module heartbeat callbacks with individual 'mode' and
'interval' settings. current ones are mqtt (including relays, lights, thermostat), debug and
influxdb. preserve heartbeat NONE, ONCE and REPEAT, REPEAT_STATUS is effectively a hbReport & status bit.
- mqtt heartbeat is managed through mqttHeartbeat() callbacks
- tweak mqtt callbacks to use lists instead of the vector, slighly reducing the size of the .bin
- update WebUI, include report setting and update hbMode values
- make sure general.h settings include new heartbeat,
move constant definitions outside of the header
- correctly include dependencies through the .cpp, avoid leaking
internal details.
- as a side-effect, base headers are no longer included recursively
Add new V3.0 version of PZEM004T, not tested. Default to factory default address 0xf8, configurable through pzemv30Addr 8-bit number
Add 'frequency' measurement & 'hz' unit
Add pz.address that configures address
Implemented energy reset
Right now we only support a single device. No way to test this properly (mostly, how exactly we need to connect this stuff), so left as not implemented.
- general conversion from .ino modules into a separate .cpp files
- clean-up internal headers, place libraries into .h. guard .cpp with _SUPPORT flags
- fix some instances of shared variables instead of public methods
- tweak build system to still build a single source file via os environment variable ESPURNA_BUILD_SINGLE_SOURCE
* debug: store boot log
* order
* roll single header
* hide when not implemented
* fix capacity check
* dependencies
* refactor names, can just use malloc
* settings formatting
* dbgBuf prefix
* show size
* release memory after buffer is displayed
* fix uptime unused warning, combine printer
* comments
* use arg flag instead of static to handle boot
* ci test fix
* Hide whole info() without debug
* typo
* cleanup setDebugOutput condition
- mask is defined as (relay# status << number)
- transparently handle base-2 and base-10 numbers
- if the relay mode requires us to save the mask, it will be saved as base-2