Commit Graph

3913 Commits

Author SHA1 Message Date
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
Maxim Prokhorov
5f67212935 test: generate compile_commands.json 2022-09-08 13:39:26 +03:00
Maxim Prokhorov
2a5756e1b5 terminal: fix escaped characters parsing
also fix test entry incorrectly using an already escaped string
2022-09-08 13:39:26 +03:00
Maxim Prokhorov
ef202109e7 terminal: remove shared output
Make every available call site 'private'
e.g. typing command in telnet no longer prints to serial or WebUI

Serial input is now optional, see `TERMINAL_SERIAL_SUPPORT`.
Telnet using async server is a proper Print implementation now.
WebUI, MQTT and HTTP input is allowed to inject multiple lines at once.

Modernize our helper classes and remove legacy 2.3.0 quirks.
Replace global Terminal object and allow to separately
split, parse ARGV list and perform command search and invocation with
standalone function calls.
(but, notice that we still depend on a globally shared 'commands' list)

This greatly reduces used RAM (but, slightly increases our ROM).

Update our test suite to use namespaces and new calling convention.
2022-09-08 13:39:11 +03:00
Maxim Prokhorov
8bfc0c4882 hw: fix basic & basic-rf extra pin switch actions
https://gitter.im/tinkerman-cat/espurna?at=6302c2f2cf6cfd27af20f01b
should be toggle, same as the others

tnx to @luismaranesi
2022-09-01 04:55:54 +03:00
Maxim Prokhorov
d2e0bd9ac5 pio: update formatting 2022-08-31 03:08:30 +03:00
Maxim Prokhorov
5527441d36 pio: cppcheck works with pio-check
https://docs.platformio.org/en/latest/core/userguide/cmd_check.html
2022-08-31 03:08:30 +03:00
Maxim Prokhorov
246364470c ci: compress debug symbols a bit more 2022-08-31 03:08:30 +03:00
Maxim Prokhorov
038f1ffec3 pio: firmware.bin.gz builder 2022-08-31 03:08:30 +03:00
Maxim Prokhorov
d17316f78c pio: fix .bin size check script dependency
cannot depend on checkprogsize, since it depends on .elf and not .bin

also, compare with the block-aligned size
add notes about reserved space

warning might become annoying, though :)
2022-08-31 03:08:06 +03:00
Maxim Prokhorov
11ca1a892a ci: fix debug zip pattern match 2022-08-30 04:54:27 +03:00
Maxim Prokhorov
ed28314fa0 github: contact links need move fields 2022-08-30 03:32:19 +03:00
Maxim Prokhorov
0e48dab5fb github: yaml typo in issue forms github220830 2022-08-30 03:26:34 +03:00
Maxim Prokhorov
e8e9c152e7 pio: missing scripts 2022-08-30 03:22:47 +03:00
Maxim Prokhorov
f3d4a4ae8a github: issue forms and bug report tools updates
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests
2022-08-30 03:21:29 +03:00
Maxim Prokhorov
a6df38e807 pio: stack dump decoder script
from the pending ESP8266 Core PR
2022-08-30 03:18:11 +03:00
Maxim Prokhorov
74ce4d974d pio: update formatting 2022-08-30 03:18:11 +03:00
Maxim Prokhorov
c0e74e431d pio: prettier file size output 2022-08-30 03:18:07 +03:00
Maxim Prokhorov
fd249c8055 pio: also hide raw putc function in postmortem
updates scripts to be a post action
rename redefined symbols to stubs
2022-08-30 02:06:30 +03:00
Maxim Prokhorov
6f122f5ecb pio: debug info in distributed builds and build-and-copy fixes
store objcopy of these extra symbols and .map from the linker
distribution will have an extra debug .zip file that could be used with
the exception decoder

also fixes relative paths in the build-and-copy
(although, yet again loses the pio target in the gui)
2022-08-30 01:33:55 +03:00
Maxim Prokhorov
25f6b021f5 system: convert is not inline 2022-08-29 22:51:31 +03:00