Commit Graph

3933 Commits

Author SHA1 Message Date
Maxim Prokhorov
b0af0afd19 hw: deprecated flag github220925 2022-09-25 18:41:19 +03:00
Maxim Prokhorov
ea881b12d1 hw: fix port checks 2022-09-25 18:40:33 +03:00
Maxim Prokhorov
3eaba2883d uart: fix building when disabled 2022-09-25 14:28:38 +03:00
Maxim Prokhorov
c46d007384 ci: debug the time zip takes 2022-09-25 13:03:50 +03:00
Maxim Prokhorov
73e3bdac2f cfg: inverse -> invert 2022-09-25 12:09:47 +03:00
Maxim Prokhorov
b52b128f5e cfg: more warnings about uart changes 2022-09-25 11:31:41 +03:00
Maxim Prokhorov
9e0dc73865 pzem004t(v3): commands need private access
also fix typos in the pzem004t lib import
2022-09-25 10:29:45 +03:00
Maxim Prokhorov
164d217bf7 sch: missing undef 2022-09-25 10:28:47 +03:00
Maxim Prokhorov
ae25402daa rfb: typo 2022-09-25 10:28:33 +03:00
Maxim Prokhorov
66a351b012 relay: fix stm & dual init with external port 2022-09-25 10:28:24 +03:00
Maxim Prokhorov
f9eb01143f docs: changelog 2022-09-25 08:29:15 +03:00
Maxim Prokhorov
5361e3d3df cfg: clean-up 2022-09-25 08:26:22 +03:00
Maxim Prokhorov
4ee1aa61a2 cfg: update arduino.h 2022-09-25 08:26:22 +03:00
Maxim Prokhorov
56affe713d cfg: formatting 2022-09-25 08:26:22 +03:00
Maxim Prokhorov
574fbf1960 uart: standalone configuration
- setup uart at boot instead of delaying until some module needs it
  removes global `SERIAL_BAUDRATE` and `DEBUG_PORT` in favour or
  globally accessible numbered port configurations with `MODULE_NAME_PORT`
- automagically enable uart support for sensors that need it
- allow every sensor to configure uart0 (normal and swapped), uart1
  and an optional software-serial mode support with an extra build flag
  remove individual includes across the sensors
- settings queries and runtime port configuration (prefixed with uart)
- update dependencies header to cross-reference used ports at build time
- update deprecations header with serial baudrate notice
2022-09-25 08:26:22 +03:00
Maxim Prokhorov
3d580f3577 terminal: __FlashStringHelper -> StringView
- clean-up comparison routines and get rid of most of the casts
- reduces total number of calls to terminalRegisterCommand
  replace with a func accepting list of commands, which in
  turn get instantiated as constexpr PROGMEM arrays
- reduce ram fragmentation, since we don't need to alloc as much
- reduce flash consumption b/c of lambda -> standalone func conversion
2022-09-25 06:14:54 +03:00
Maxim Prokhorov
1c9a4bd864 terminal: fix include
previous fix did not apply to builds without single-source env setup
ci builds with it enabled at all times
2022-09-25 06:14:54 +03:00
Maxim Prokhorov
4c75c2a070 sns: export sensors list
fix #2538
2022-09-24 08:02:59 +03:00
Maxim Prokhorov
75a518c6ca telnet: fix 'reverse' implementation
sync and async dns functions for both terminal and this

both use callbacks with IPAddress helper instead of using ip_addr_t
(at least, for now. seems like it is in need of our own wrapper, too)
2022-09-23 07:43:40 +03:00
Maxim Prokhorov
360a2f14e7 scripts: update core -> minimal
amend 5bc55cd1a5
2022-09-23 06:09:58 +03:00
Maxim Prokhorov
8eb61a8349 docs: changelog github220923 2022-09-23 05:15:59 +03:00
Maxim Prokhorov
ac14cbca4f pio: .gz and two-step hint on upload target 2022-09-23 05:04:26 +03:00
Maxim Prokhorov
6d982284c9 uartmqtt: clean-up and hex encode / decode
- fix initialization routine to auto-select appropriate port between
  either hardware-only serial or hardware-plus-software serial
  both depend on which TX and RX pins are selected
- allow to use 'swapped' uart0 mode with pinx 13 and 15
- software serial is no longer forced upon the user, setup depends on
  which tx and rx are used in config
- allow to either send or receive data as HEX strings
  mqtt received `616263` gets written as `abc` and vice versa
- (optional) send termination byte when writing to serial
2022-09-23 03:09:13 +03:00
Maxim Prokhorov
a8fe3e4664 build: directly use __TIMESTAMP__
avoid weird conversion from string -> time_t -> string

remove magic inline macros converting string value to time_t.
instead, just pick specific string regions and explicitly constexpr'ify conversion
(ref. https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html)

ntp could lose the value, since we never use it properly
(although, ctime functions do; it is rather tricky with timezones, though)

nofuss could use any value, might as well use the string that is already
provided by the compiler that has the same property as the used timestamp
2022-09-21 18:12:37 +03:00
Maxim Prokhorov
af12762eb6 wifi: fix blocking-delay oopsie
blockingDelay uses inverse logic; passed function should return false
when the condition is satisfied
only broken on 2.7.x, 3.x.x skips the check
2022-09-21 04:31:20 +03:00
Maxim Prokhorov
7fc8ccdf72 system: fix view comparison
note that it is equality, not byte comparison based on
memcmp or strcmp return values
2022-09-21 04:31:20 +03:00
Maxim Prokhorov
009d1b0014 mqtt: comments 2022-09-21 04:31:20 +03:00
Maxim Prokhorov
79ef68b435 telnet: directly use our async networking API
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.
2022-09-21 04:31:20 +03:00
Maxim Prokhorov
95e659fa58 decoder: spacing for lines prefixed with (inlined by) 2022-09-21 04:31:20 +03:00
Maxim Prokhorov
5a9cd59ca9 debug: show uart banner before telnet 2022-09-21 04:31:20 +03:00
Maxim Prokhorov
d32c4b45d0 web: json adapter for our string view
effectively, same thing as `const __FlashStringHelper*`
but, we know the actual size at build time vs. calling `strlen_P`

can't specialize the way things are read until v6; current implemenation
simply attaches arbitrary char pointer to the internal buffer, which is
then read byte-by-byte when writing output json stream

revert to static json buffer class in `/discovery`
will move more things to it, but probably should move to v6 first
2022-09-21 04:21:23 +03:00
Maxim Prokhorov
60194e9069 settings: clean-up weird keys 2022-09-21 04:21:23 +03:00
Maxim Prokhorov
eec71eec8c system: settings queries 2022-09-21 04:21:23 +03:00
Maxim Prokhorov
78cd6556f0 system: build time constants and settings
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
2022-09-21 04:21:23 +03:00
Maxim Prokhorov
5bc55cd1a5 hw: core -> minimal 2022-09-21 04:21:23 +03:00
Maxim Prokhorov
24d342e1f1 ota: typo 2022-09-14 17:06:04 +03:00
Maxim Prokhorov
a05dbf2ba3 hw: disable serial terminal in minimal builds 2022-09-14 17:05:54 +03:00
Maxim Prokhorov
a1a50c0083 board: include manufacturer and device info
both boot and `info`. also, make boot message a bit smaller yet again
2022-09-14 16:54:43 +03:00
Maxim Prokhorov
457bd16143 docs: wiki urls 2022-09-09 19:41:23 +03:00
Maxim Prokhorov
3ef4b39355 gpio: source location may as well be constexpr 2022-09-09 19:41:23 +03:00
Maxim Prokhorov
5f6df82110 gpio: source code locations of locks / unlocks
sorted in a reverse order of when they were called
refactor gpio module itself, so our `namespace { ... }` stays consistent

using GCC `__builtin_{LINE,FILE,FUNC}()`
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fLINE
https://en.cppreference.com/w/cpp/utility/source_location
2022-09-08 19:36:52 +03:00
Maxim Prokhorov
59686a80ac debug: revert forced gpio lock
ref. 8ceeebdb24
does not really do much, just causes yet another 'why does this driver
ignores pin 1 or 3' question by anyone trying to use buttons or relays

since we configure pins on per-driver basis and dont have global
'roles' assigned to each pin, it is pretty tricky to understand every
other dependency coming in at setup() time. right now, first one wins.

a bit more complex pre-setup() dependency resolution could also work,
and some concept that we depend on uart as peripheral and not just some pins
2022-09-08 18:37:54 +03:00
Maxim Prokhorov
f98724a358 docs: changelog 2022-09-08 18:36:12 +03:00
Maxim Prokhorov
7595d3357c terminal: revert UnescapedText handling
Totally breaks on unicode input.

Main reason to add this in the first place was handling of
terminal escape sequences, but perhaps it would be better off to do
that on another layer.

For example, <Backspace> will inject an invisible symbol into the resulting
'chunk', at least one other thing to do is to validate after we append
things into an 'argv' that it at least looks like some kind of text.
2022-09-08 15:56:52 +03:00
Maxim Prokhorov
798f1ed782 webui: rebuild blobs 2022-09-08 15:53:11 +03:00
Maxim Prokhorov
fc8bdef7d5 terminal: fixing web socket interface
Make the buffer work on '\n' instead of a limit, flush asap.
Still using single 'DEBUG' output for both terminal and debug prints;
we no longer have 'pre' and 'msg' distinction - there is just 'msg'.
2022-09-08 15:50:30 +03:00
Maxim Prokhorov
9b92144ab9 telnet: promptly flush() when buffers get filled up
implementation is a bit clunky, since WIFISERVER seems to be working
much slower with (or because?) of no-delay

pending some changes so we *always* schedule telnet comms in the loop
(which also would leave just one SERVER option, and also enable encryption)
2022-09-08 13:39:26 +03:00
Maxim Prokhorov
bb41673e48 terminal: deduce error from state when uninitialized
also refactor Values and Span as class methods
(since we are dealing with struct members anyway)
2022-09-08 13:39:26 +03:00
Maxim Prokhorov
0af60479e5 terminal: wait to concat for continuous data 2022-09-08 13:39:26 +03:00
Maxim Prokhorov
677f368cfa test: bump esp8266 version used for unit tests 2022-09-08 13:39:26 +03:00