Commit Graph

3829 Commits

Author SHA1 Message Date
Maxim Prokhorov
7095cfffd7 pwm: missing header
missed when moving new-pwm includes
fix accidentally including sdk header
github20220816
2022-08-16 13:01:11 +03:00
Maxim Prokhorov
2d38efcd6b pzem004tv30: fix debug 2022-08-15 16:44:31 +03:00
Maxim Prokhorov
c07310c974 pzem004tv30: correct magnitude index for energy reset 2022-08-15 16:25:21 +03:00
Maxim Prokhorov
7f15da59ee sns: fix swdt reset when parsing MQTT payload
This *must* use views, but that's something for another day
Tweak terminal command, also allow to view the energy value
2022-08-15 16:25:21 +03:00
Maxim Prokhorov
1e655cc921 system: fix Core flash API usage when assessing latest crash
amends 8fb1a49881

Core accepts address, not sector
Compare with partial data, not just one byte
2022-08-15 16:25:01 +03:00
Maxim Prokhorov
c9a3a6ed54 lib: fix fs_math include 2022-08-15 12:01:50 +03:00
Maxim Prokhorov
b0da3e8c7f light: external pwm support
- allow both new-pwm and analogWrite (Core) implementations
- rework new-pwm initialization, a bit more sane type for pin config
- remove pin setup from lights, everything is handled by provider already
Core prepares and initializes pins when updating duty, new-pwm does this
when pwm_init is called
- rework internals related to value scaling, allow percentage as pwm duty
and value limit (instead of absolute limit set by lights previously)
2022-08-15 12:01:20 +03:00
Maxim Prokhorov
5929ae9f16 pzem004tv30: typo in pin default 2022-08-11 22:58:06 +03:00
Maxim Prokhorov
2f5ea5d06b emon: fix energy ratio accessor and notify when any ratio changes
in case some hardware needs it, like ina219 calibration register
that is used by both sensor implementation and hw itself
2022-08-11 11:11:33 +03:00
Maxim Prokhorov
396f8a7770 pzem004tv3: init serial port
fix a bug introduced in e4b068ec7d
resolve #2528
2022-08-11 10:18:55 +03:00
Maxim Prokhorov
e9de3d4435 emon: typo in energy counter 2022-07-22 23:52:14 +03:00
Maxim Prokhorov
34f83c9c90 rfm69: re-apply ad8e30fcda 2022-07-21 15:56:31 +03:00
Maxim Prokhorov
aaefbfbc4a emon: api changes 2022-07-21 15:29:28 +03:00
Maxim Prokhorov
58d4a98553 webui: version bump terser 4.8.1
dependabot woes
2022-07-21 15:11:22 +03:00
Maxim Prokhorov
b6c5d9a126 docs: changelog 2022-07-20 20:35:07 +03:00
Maxim Prokhorov
aaf58585b2 ci: snapshot build workflow 2022-07-20 20:32:55 +03:00
Maxim Prokhorov
1b49326e12 ntc: scale based on input voltage
resolves #2500
resolves #2523

- fixing default config values, make sure we take inputs into
  an account and not assume we stay in the 0.0...1.0 range
- use shelly values from tasmota analog sensor impl
- handle edgecase when both resistances are zeroed
- clearer description of available connection schemes

in theory, there is also an option of having *both* up and down
resistors at the same time; right now we simply deduce NTC position by
making it an opposite of resistance. ldrsensor implementation currently
allows to explicitly set sensor position
2022-07-20 20:32:55 +03:00
Maxim Prokhorov
b366d77a5e sns: namespace, fix init function(s)
One namespace for sensor functions and types.
Fix discrepancy between topic and indexed topic funcs.
Energy types fixes, make sure we use known ratios.

Sensor fixes, moving certain pin settings and defaults into the sensor
classes, using those in the actual sensor init code.
Energy is still within the sensor module, pending version bump before moving.
2022-07-20 20:32:55 +03:00
Maxim Prokhorov
91eb010fea ina219: fix invalid shift 2022-07-15 04:43:16 +03:00
Maxim Prokhorov
ad8e30fcda rfm69: clean-up *after* max ID, not before
fixes #2507
2022-06-13 14:29:49 +03:00
Maxim Prokhorov
fb31449ed9 ntc: formatting & actually return the value
fixup 4d4b8461dd
(if only the compiler warned about an empty branch...)
2022-06-13 02:14:40 +03:00
Maxim Prokhorov
a461d2c18a board: fix 2.7.4 build 2022-06-13 00:12:36 +03:00
Maxim Prokhorov
65db8e6112 board: spi_flash_read size is in bytes 2022-06-12 23:55:29 +03:00
Maxim Prokhorov
01047c3b80 sns: type prefixes should be in flash 2022-06-12 22:18:53 +03:00
Maxim Prokhorov
4d4b8461dd ntc: make sure we handle adc value of 0
plus, move reading into pre()
2022-06-12 22:04:24 +03:00
Maxim Prokhorov
84017214d2 webui: detect when sensor unit changes
also split energy info into a separate payload & handler
2022-06-12 20:36:01 +03:00
Maxim Prokhorov
68374bba9e sns: refactoring
make sure we have access to magnitude formatters early in the file
more namespacing, where possible
2022-06-12 20:36:01 +03:00
Maxim Prokhorov
e3a2294ef0 sns: handle basic metric units conversion
proper support for both conversion directions
ratio object stores the scaling, no need to deduce it through the enum
name anymore

we still don't really enforce incompatible units, though,
but it is unclear at what stage the error should come in
2022-06-12 20:36:01 +03:00
Maxim Prokhorov
7dfb10905c sns: handle both directions when converting temperature unit
when types are the same, handle things directly in the class base
plus, reduce the amount of explicit comparisons
2022-06-12 20:36:01 +03:00
Maxim Prokhorov
c937b10d86 analog: raw and advanced scaling in the base class 2022-06-12 20:36:01 +03:00
Maxim Prokhorov
425027223c sns: sensor ratio helpers 2022-06-11 23:43:10 +03:00
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