Commit Graph

2739 Commits

Author SHA1 Message Date
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
Max Prokhorov
37f6247772 Light: configure dimmer pins from settings (#2129)
- add ltDimmerGPIO<index> & ltDimmerInv<index> to override / add to hardware configuration. Add pin defaults, mapped as GPIO_NONE. pwm_init() receives resulting GPIO mapping based on settings loader.
- remove bogus _light_channels variable, use this name for channel array instead (...which is vector and has size(). functions always use that value anyway)
2020-02-04 02:51:44 +03:00
Max Prokhorov
833978d75f Merge pull request #2130 from mcspr/ci/pio-test
Fix UnixHostDuino dependency
2020-02-04 02:15:01 +03:00
Max Prokhorov
0d40d2275a Load sensor classes later (#2128)
* Sensors: refactor configuration

- move sensor implementaion to the .ino,
  remove dependency undef / define from sensor files
- update test/build/sensor.h from SENSOR_SUPPORT
- allow to change sensor config variables externally
- `#include <...>` for global headers and libraries,
  fix relative path for math library

* add missing sns <-> i2c dependency

* ledrelay should return relay_none as default

* rollback to original test header

* include debug header when requested (relative)
2020-02-04 02:14:31 +03:00
Max Prokhorov
a41819a28a ci: run pio test directory 2020-01-29 23:59:39 +03:00
Maxim Prokhorov
712bd8a5e1 Buttons: small optimization for vector 2020-01-22 01:56:59 +03:00
Maxim Prokhorov
d1df9d5587 Add timelib header in utils 2020-01-22 01:44:50 +03:00
Maxim Prokhorov
2e891e3129 Debug: use lowercase enum for mode (following isocpp guidelines) 2020-01-22 01:44:50 +03:00
Maxim Prokhorov
2ff50169b9 Static configuration for LED and Buttons
- use similar to relay & wifi, configuration through helper methods that
  use indexed defines
- clock cycles for led delay polling
- button mode defaults
2020-01-22 01:44:50 +03:00