Commit Graph

3475 Commits

Author SHA1 Message Date
Maxim Prokhorov
09c0750c69 sns: change magnitude filter 2022-06-11 23:04:35 +03:00
Maxim Prokhorov
c58b37c173 ina219: correctly scale raw values
fix gain multipliers, last two scaled down instead of up
bus voltage is in mV, using datasheet value of lsb (4mV)
2022-06-11 23:04:35 +03:00
Maxim Prokhorov
8059f1a4ca ina219: invalid max expected current is a config error 2022-06-09 23:52:17 +03:00
Maxim Prokhorov
4572dd3d6c ina219: we already know the type 2022-06-09 23:51:09 +03:00
Maxim Prokhorov
15f6446479 ina219: shunt resistance and expected current
address #2516, implement through ratio setting
2022-06-09 23:49:58 +03:00
Maxim Prokhorov
a52f0b0ce4 ws: fix multiple clients 2022-06-01 22:27:11 +03:00
Maxim Prokhorov
567b9d7769 web: also check for ap state 2022-06-01 22:20:25 +03:00
Maxim Prokhorov
2c728074f9 web: image length is a compile time constant 2022-06-01 21:52:18 +03:00
Maxim Prokhorov
81e4d423e2 board: type of webui image 2022-06-01 21:50:10 +03:00
Maxim Prokhorov
1f9f4998cc pio: bump platform_latest to 4.0.x 2022-06-01 21:35:25 +03:00
Maxim Prokhorov
ef15c20c04 web: more experiments with captive portal
fixing redirect, authenticate softap connection implicitly
further support needs DHCP helper, at least that's a standard...

plus, pass F(...) strings where String is accepted by the server
2022-06-01 20:14:39 +03:00
Maxim Prokhorov
a64631ebd6 wifi: opmode can be changed directly 2022-06-01 18:34:25 +03:00
Maxim Prokhorov
3d9fbf0469 web: some captive portal pages 2022-06-01 18:33:25 +03:00
Maxim Prokhorov
8fb1a49881 system: reset sdk config when unstable
similar to the tasmota ota, reset SDK when AP settings somehow are not
set to default *and* we are in safe mode already
move both even earlier in boot, before the wifi setup happens
2022-06-01 18:32:36 +03:00
Maxim Prokhorov
1078459350 system: clangd warning fix 2022-06-01 15:13:19 +03:00
Maxim Prokhorov
ce5e8d53a2 ota: instruct to crash instead of undefined behaviour
follow-up a684348b17
2022-06-01 15:12:43 +03:00
Maxim Prokhorov
54b275de4d ota: no need for fence 2022-06-01 15:12:12 +03:00
Maxim Prokhorov
2b2c20f383 gpio: direct hardware access for pin peripheral
using most recent RTOS for reference, allows us to skip Arduino
layer when configuring things. especially useful for UART
re-implementation that does not involve magic pin function modes

adjust our terminal command to really show valid pins and their modes
2022-06-01 13:13:51 +03:00
Maxim Prokhorov
6a0d6b0c49 sns: more flash strings 2022-05-25 05:07:04 +03:00
Maxim Prokhorov
b23137f414 dcz: flash strings and our own namespace 2022-05-25 03:50:17 +03:00
Maxim Prokhorov
d2c7f7ea28 ws: module names in flash 2022-05-25 03:50:17 +03:00
Maxim Prokhorov
c52002a397 ws: always fpstr() cast name of the module 2022-05-25 03:50:17 +03:00
Maxim Prokhorov
2598c4a77b tspk: pass sensor data as string, rework http parser
schedule immediately with module functions, don't wait
more flash-strings in the module and utility functions

support rare condition when body cannot be sent on connect, use poll to send it
don't wait for header line in body, and bail out when done parsing
make sure data is copied into the async variant, and remains there for
the duration of the connection

general async api is... more complicated that it needs to be
until wolfssl / brssl port is here, though, there is no other choice
secureclient config becomes a simple struct, pending further rework
2022-05-25 03:50:17 +03:00
Maxim Prokhorov
821df407c0 sns: separate report from modules 2022-05-24 20:38:31 +03:00
Maxim Prokhorov
699edf1b08 sns: typo, reported value was not yet set 2022-05-24 20:23:25 +03:00
Maxim Prokhorov
307a41f5a9 sht3x: crc is a static function 2022-05-24 19:47:42 +03:00
Maxim Prokhorov
946f5f0dfa sht3x: formatting, fix visibility of virtual
also experiment a bit with status register in log
2022-05-24 19:29:50 +03:00
Maxim Prokhorov
b23845bfb9 compat: should apply to both Core versions 2022-05-24 19:29:13 +03:00
Maxim Prokhorov
53b0f452a0 sns: fix order of values 2022-05-24 19:03:07 +03:00
drc38
adca49232a sht3x: add crc and status debug (#2518)
* sht3x: add crc and status debug

* reduce delays, add sensor debug

* add full status output
2022-05-24 18:32:48 +03:00
Maxim Prokhorov
6fd70aae82 sns: typo 2022-05-24 00:28:03 +03:00
Maxim Prokhorov
c6ab437c1a dcz: also use sensor value struct 2022-05-23 23:47:35 +03:00
Maxim Prokhorov
d5e59bb232 sns: log all three value states 2022-05-23 23:47:35 +03:00
Maxim Prokhorov
133edc801a sns: only keep the last elem when size is >2
fixing reset always keeping the last value, not the intended size 3... and above.
revert to the previous behaviour where the last element is preserved and
real `capacity` becomes `capacity + 1`. adjust methods accordingly.
and a slightly more verbose median funciton
2022-05-23 21:08:28 +03:00
Maxim Prokhorov
09273b1bc1 sns: fix for thermostat readings
amends 5fcac5d27f
2022-05-22 00:17:34 +03:00
Maxim Prokhorov
a232f5b917 sns: show real magnitude topic value in the terminal 2022-05-21 18:17:15 +03:00
Maxim Prokhorov
5fcac5d27f sns: read / report handlers with a prepared structure
generalize topic and value representation
breaking change for rpn, since the magnitude *may not* be indexed

also fixes debug logs, where we would always see units of the 1st
magnitude instead of the one being processed
2022-05-21 18:13:10 +03:00
Maxim Prokhorov
683347c8d7 sns: overwrite median filter storage with capacity of one
keeping the last value will prevent us from updating
anything due to capacity check

also see #2519
2022-05-21 18:04:09 +03:00
Maxim Prokhorov
b5e467d451 sns: fix settings key generator
see #2519
2022-05-21 17:09:18 +03:00
Maxim Prokhorov
61ac1c0778 sns: single value filter has no reason to override capacity 2022-05-21 17:09:05 +03:00
Maxim Prokhorov
c980acbd10 i2c: reserved addresses 2022-05-20 10:04:43 +03:00
Maxim Prokhorov
08f752689a i2c: search for more addresses when already locked
third time's a charm... reorganize external funcs to reference internal
ones, and there's no need for an extra check of address
2022-05-20 09:56:20 +03:00
Maxim Prokhorov
29472b667e kingart: same type for position value 2022-05-18 23:02:56 +03:00
Maxim Prokhorov
e4b068ec7d pzem004tv30: fixing static <-> instance member init order
since we don't have multiple instances yet, move everything into the
existing sensor instance class. for the multi-device migration, we will
only need port and it's read timeout setting. address will be stored per
device instance, where the main one will work with the port
2022-05-18 22:50:12 +03:00
Maxim Prokhorov
d9e87552ce ina219: another case of constexpr static binding 2022-05-18 22:48:30 +03:00
Maxim Prokhorov
c9e3cd65f4 sns: constrain only works on a single type
make sure we use clamp instead of constrain
2022-05-18 22:18:33 +03:00
Maxim Prokhorov
49cd7fc3f4 sns: fixes for gcc4.8 2022-05-18 22:11:33 +03:00
hamed
660d8c339b sns: add INA219 (current / power monitor)
resolves #2501

Co-Authored-by: Maxim Prokhorov <prokhorov.max@outlook.com>
2022-05-18 21:22:32 +03:00
Maxim Prokhorov
8f194848ee sns: some more error types 2022-05-18 21:22:32 +03:00
Maxim Prokhorov
396733d1fb sns: show locked address in the description
and make sure we use it when trying to read/write something
2022-05-18 21:21:02 +03:00