Commit Graph

2747 Commits

Author SHA1 Message Date
Max Prokhorov
92bdf211eb Update platformio.ini comments
Clarify flash size settings, fix old comment regarding build_flags
2020-04-08 02:33:26 +03:00
Max Prokhorov
b500273029 sns: add SI1145 sensor (#2216)
Co-authored-by: Joop Hilverink <33230021+HilverinkJ@users.noreply.github.com>
2020-04-08 01:48:45 +03:00
Max Prokhorov
5de6330890 dcz: add workaround for pressure sensors (#2215)
- Domoticz only accepts svalue <pressure>;<forecast>,
  failing to display anything otherwise.
  We don't have any forecast calculation (yet?), simply send dummy value.
- Move Domoticz code outside of sensor.ino
2020-04-08 01:35:33 +03:00
Max Prokhorov
cae50fa544 sensor/emon: refactoring (#2213)
- Update sensor classes to support a generic way to store energy values
- Update sensor conversion code to deal with units and not magnitudes
- Add magnitude<->unit for sensors, generic way of defining used unit. Convert from sensor magnitude unit to the one used for display.
- Reset energy value based on index through external means (MQTT, HTTP)
- Rework energy timestamping, update webui with 'last saved' value

While this solves the energy conversion issues and we are finally seeing the real value, what I don't really like:
- KilowattHour and WattHour are separate enum tags, thus sort-of are different types altogether
- Conversion code in Energy object should probably use some generic 'ratio' calculation? (https://en.cppreference.com/w/cpp/numeric/ratio/ratio)
- We are still using runtime checks to do calculations and depend that sensor outputs only one specific value type.

Consider this a fix for energy display / storage and preliminary work on sensor.ino
Further sensor refactoring... soon.
2020-04-08 00:37:26 +03:00
Max Prokhorov
49b6d351d9 PIO/hardware.h: Update naming (#2214)
* update platformio.ini comments
* espurna-base -> espurna-core-webui
* esp8266-<flavour>-<size>-base -> esp8266-<size>-<flavour>-base
* clean-up ESPURNA_CORE detection, use boards function
2020-04-07 21:48:43 +03:00
Max Prokhorov
db50be91bc PIO: fix env definitions (again) (#2212)
* base envs

* CI: speed up release process (since we still want some .bin files)

* fixup! CI: speed up release process (since we still want some .bin files)

* release dry run

* fixup! release dry run

* adjust

* fix .bin name

* it works

* minor cleanup for current git

* use pio suggestion about ldscript, reduce build_flags impact

* fix linker

* parse ${vars} instead of ignoring them

* add filtering and override file (sneak peak into tasmota's pio config)

* don't generate secure client (for now)

* formatting

* codacy
2020-04-07 21:20:32 +03:00
ziggurat29
e2e0409c59 correct Gosund WP3 LED documentation and provide reasonable default actions (#2200)
* correct Gosund WP3 led color documentation; provide reasonable default actions for button and the two LEDs

* reverse red/blue led roles, as requested, to be consistent with other existing products

Co-authored-by: ziggurat29 <xxx@yyy.zzz>
2020-04-02 02:06:19 +03:00
Max Prokhorov
83339605aa webui: ledGPIO is a list (#2202) 2020-03-30 13:41:11 +03:00
ziggurat29
387d4cea58 Board definition for the Gosund WP3 smart socket (#2191)
Co-authored-by: ziggurat29 <xxx@yyy.zzz>
2020-03-24 22:34:14 +03:00
Max Prokhorov
a71f233caa Remove OTA from ESP01 build
https://github.com/xoseperez/espurna/pull/2185#issuecomment-601198322
-11KiB
2020-03-20 21:38:03 +03:00
Max Prokhorov
43c2c41cba mqtt(async): buffer some data (#2181)
* mqtt: enum state

* mqtt: async client buffer with MQTT_MAX_PACKET_SIZE

* mqtt: rework debug messages

* mqtt: MQTT_BUFFER_MAX_SIZE

* mqtt/test: debug log for async callback

* mqtt/test: don't log things we don't handle

* button: fix typo
2020-03-20 21:07:02 +03:00
ziggurat29
7496606140 Example for Generic ESP01 boards with 512KiB flash (#2185)
Co-authored-by: ziggurat29 <xxx@yyy.zzz>
2020-03-20 21:06:12 +03:00
Max Prokhorov
917ce8de83 Optional Web(UI) OTA (#2190)
* web: optional OTA support

* add prototype

* hide under websupport
2020-03-20 21:05:04 +03:00
Maxim Prokhorov
032f921fc4 btn: store actions as uint8_t instead of uint16_t 2020-03-14 01:20:32 +03:00
Maxim Prokhorov
2172bc6cb1 btn: rename pin status / state -> value 2020-03-14 01:20:32 +03:00
Maxim Prokhorov
b289c77021 cfg: clean-up hardware.h 2020-03-13 09:28:15 +03:00
Maxim Prokhorov
ee7356b91a relay: clean-up for ota .bin 2020-03-13 09:28:15 +03:00
Maxim Prokhorov
1f5b22ebcf ir: fix syntax issue 2020-03-13 09:28:15 +03:00
Max Prokhorov
3243dafb61 cfg: check for led and button GPIO settings (#2177)
In case board configuration is empty, loop should try to check at least once
2020-03-13 07:15:07 +03:00
Max Prokhorov
80825590a5 LED Updates (#2170)
* support GPIO setting in WebUI
* experimental led pattern support
* support loading settings in setup() (not yet fully working)
2020-03-13 07:01:14 +03:00
Max Prokhorov
bdedb2b7ae wifi: unconditionally erase all settings after fixed index (#2175) 2020-03-13 04:43:54 +03:00
Max Prokhorov
f2ed94f230 cfg: update migrate configuration (#2176) 2020-03-13 04:43:35 +03:00
Max Prokhorov
ba3e6267e6 Button pin provider & runtime settings (#2162)
* wip

* cleanup buttons-through-serial code, remove hw mention from button module

* remove wip

* implement mqtt settings

* fixup struct members, dual no longer allocates debouncer

* add missing debounceevent lib

* fix missing event_handler, update names

* fix namespace

* drop lib

* fix int<->bool comparison

* Move gpio16 handling from DigitalPin to EventHandler

* Cleanup debounceevent headers

* Don't expect system headers to be included

* re 70b54c489f - no allocation, for real

* Adjust settings names

* dont retain by default

* unused

* typo

* Fix length type (ref 6017ad9474)

* Move pin class outside of debounce lib, lowercase ns

* move event handling inside of button_t

* refactor config. ..._MODE -> _CONFIG, ..._MODE_... -> ..._ACTION_...

* fix test

* naming

* move indexed value to header

* refactor actions into direct opts

* fix webui, fix buttons not respecting old user setting

* change button config format from bitmask to a struct, adjust settings conversion

* proxy some more header defautls, fix web kv

* gpiopin

* adjust webui func to support every setting

* clarify single-return event->string

* fix dual setting

* fix dual packet condition, de-duplicate funcs

* fix bogus warning
2020-03-13 04:42:40 +03:00
Rui Caridade
ae232c9381 Add support for read PIO-A of DS2406 (#2174)
* Add support for read PIO-A of DS2406

* Verify reset() reseult
2020-03-12 06:03:46 +03:00
irmishappy
c02a981b1c Apparent, reactive power measurement unit corrections (#2161)
* Update sensor.ino

Apparent, reactive power measurement unit corrections.

* Update sensor.ino
2020-03-12 06:03:17 +03:00
DmitryBlinov
373dd27d60 Fixes and updates for thermostat and display (#2173)
* Fixes and updates for thermostat and display:

- Switch to original esp8266-oled-ssd1306 library
- Fixes and updates for thermostat and display
- Add display switching off after interval
- If THERMOSTAT_DISPLAY_SUPPORT enabled, then one click enable display, long click switch relay. This functionality also depend on fix for long click. See pull request https://github.com/xoseperez/espurna/pull/2172

* Move buttons definitions for display to dependencies.h

* Pin ThingPulse/esp8266-oled-ssd1306#3398c97
2020-03-08 18:15:27 +03:00
DmitryBlinov
6017ad9474 Fix for long click (#2172)
With uint8_t length function _buttonMapReleased never returned BUTTON_EVENT_LNGCLICK. BUTTON_EVENT_CLICK returned instesd. I verified that with uint16_t length it returns BUTTON_EVENT_LNGCLICK when correspondent delay passed.
2020-03-08 02:31:16 +03:00
julianwb
8f7d77b2a1 Config for Teckin SP23 & Maxcio W-UK007S (#2157) 2020-02-18 22:23:52 +03:00
Max Prokhorov
8f4f1beb54 mqtt+api: move action handler (#2158) 2020-02-18 22:23:08 +03:00
Max Prokhorov
980b736fc8 ir: move button structs outside of config headers (#2155) 2020-02-18 12:19:32 +03:00
Max Prokhorov
be7ca13d76 influxdb: fix http response parsing, refactor module scope (#2153) 2020-02-18 12:16:13 +03:00
Max Prokhorov
3747d2ef46 Merge pull request #2154 from mcspr/mqtt/bump
mqtt: bump arduino-mqtt version, tweak keepalive
2020-02-18 12:15:44 +03:00
Max Prokhorov
f403ea06cf wifi: respect hardcoded settings when checking for deletion (#2151) 2020-02-18 12:15:12 +03:00
Max Prokhorov
79e45324ca Bump RFM69 version (#2148)
* Check patched RFM69 with relative includes

* merged upstream, point to the commit
2020-02-18 12:14:52 +03:00
Max Prokhorov
0d5129db4d Fix latched pulse always being HIGH (#2145)
see https://gitter.im/tinkerman-cat/espurna?at=5e44563355b6b04bf6aac94b
2020-02-18 12:14:35 +03:00
Max Prokhorov
fd50e95e9e Thingspeak: tweak SecureClient connection (#2144)
- continue #2140 , use the correct implementation for http requests not confuse code readers with our parsing
- fix data sender data duplication, run build test
- add note that this is actually really RAM heavy, some connection failures are not easily distinguishable from any code errors and are simply OOM.

also
- fix arduinoota prototype error when building without it (... ino2cpp, again)
- add comment about 160mhz into the platformio.ini
2020-02-18 12:14:07 +03:00
Maxim Prokhorov
d0c9b6d5eb mqtt: keepalive less than hb interval 2020-02-18 11:57:52 +03:00
Maxim Prokhorov
098de0cb0b mqtt: pin arduino mqtt version 2020-02-18 09:46:39 +03:00
Max Prokhorov
7862b52060 Fix "Fix AsyncTCP dependency" (#2149)
* Revert "Fix AsyncTCP dependency (#2147)"

This reverts commit d5093b4d18.

* Ignore AsyncTCP
2020-02-14 14:40:51 +03:00
Max Prokhorov
d5093b4d18 Fix AsyncTCP dependency (#2147)
PIO 4.2.1a default soft does not work
2020-02-14 13:27:18 +03:00
Max Prokhorov
cacc7584d3 hlw8012: gpio cfg (#2142) 2020-02-09 04:54:33 +03:00
Max Prokhorov
d9482b917b rfm69: fix types of settings (#2141)
* rfm69: fix types of settings

* down
2020-02-09 04:41:31 +03:00
Max Prokhorov
80bff31d8a Thingspeak: cleanup (#2140)
* Thingspeak: cleanup

* fix sync client config, refactoring

* revert changes in tspk config

* inheritance

* fix empty wificlient
2020-02-09 04:41:18 +03:00
foxman69
bc1fb0ba38 WebUI: alert when WS closes (#2131)
* Added alert when websocket closes and trying to trigger it faster

* Added window before function...

* Changed from setTimeout to SetInterval

* Fixed position of if statement

* formatting

* images

Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
2020-02-09 01:41:14 +03:00
Sammy BAUER
f73917decc Configure Thingspeak URL at runtime (#2124)
* Permit thingspeak urn edit

* Update thinkspeak.ino

* Update index.html

* Replace Host, Port, and URL with Address in Thingspeak

* Create AsyncThingspeak object

Create AsyncThingspeak object to contain the url of the component.

* replace pointer by class member

Thingspeak class improvement to answer Max's question:
why use a pointer when it can be a class member?
So now address parameter isn't a pointer anymore.

* Update Thingspeak address on post
2020-02-09 01:15:27 +03:00
Max Prokhorov
460083c28f Show pretty uptime with NTP_SUPPORT (#2137)
Fallback to basic N seconds display when disabled
2020-02-04 19:56:43 +03:00
Max Prokhorov
1a6b709a8f Fix ADE7953 typo (#2136) 2020-02-04 19:21:31 +03:00
Max Prokhorov
cda3dab0a1 Fix rpnSticky inverse condition (#2135) 2020-02-04 19:20:15 +03:00
Max Prokhorov
f7f41980b6 Headers cleanup (#2134)
* Config: remove prototypes.h

* fixup order

* word

* add missing

* fix warning while still using .ino

* bad at c/p;
2020-02-04 10:02:01 +03:00
Max Prokhorov
ba3ec47ed0 NTP: use sntp app from lwip on latest Cores, replace ntpclientlib (#2132)
* ntp: try using sntp app from lwip, drop ntpclientlib

* fix display

* thermostat: fix day and month getters

* test build sizes with scheduler

* use system timers for once-a-minute scheduling, no polling

* tick

* avoid timestamps, use tm

* drop utc rpn operator, add utc_hour and utc_dow

* try to build with old implementation too

* dep

* notify ws

* progmem

* cleanup types

* offset tm values by 1 to match existing schedules

* avoid using ntpclientlib with rpn

* test. show debug strings in sch

* fix secureclient

* consts, fix unsyncing when changing tz (and not triggering sntp after reinit for some reason)

* startup time in seconds

* same delay as lwip

* header

* assume build timestamp is unixtime

* cache server value

* fmt

* typo

* handle dhcp request

* rename

* web

* TZ.h

* add notice about what alias means

* fix disabling NTP_SUPPORT

* scheduled ticker

* same behaviour as old module

* rollback rpn dependency check, utc_ prefixes

* ...

* comments, refactor naming
2020-02-04 06:17:40 +03:00