Commit Graph

2570 Commits

Author SHA1 Message Date
Max Prokhorov
af18758073 ws: check for client_id value before checking for client (#1887) 2019-09-03 06:17:43 +03:00
Max Prokhorov
1fe28225a4 Disable serial debug for env:nodemcu-pzem004t 2019-09-03 06:16:20 +03:00
Max Prokhorov
35ce68710c Test: etharp_gratuitous (#1877)
* test: etharp_gratuitous

* proper checks before calling etharp_gratuitous, move includes

* disable at runtime

* ms values

* reload

* debug

* reword

* filter by ifnum instead of checking for AP mode

* drop station_if check

2.3.0/lwip1 builds netif->num increments on for each sta or ap
lwip2 keeps those constant, but that seems like a implementation detail
might break in the future anyways...
2019-08-30 10:58:05 +03:00
Max Prokhorov
c123156b87 WiFi SoftAP fixes (#1881)
* Stop updating SoftAP SSID and password when changing hostname and password via WebUI / settings `reload`:
https://gitter.im/tinkerman-cat/espurna?at=5d65418f49ac051923be1f06
* Show real ssid and psk values from the current sdk configuration instead of using getSetting
* `WIFI.STA` command
2019-08-30 10:57:29 +03:00
Max Prokhorov
18b403bb56 lights: update kelvin constants 2019-08-30 07:51:00 +03:00
Max Prokhorov
ec25976717 domoticz: handle cmode=2
resolve #1763
2019-08-30 07:51:00 +03:00
Max Prokhorov
b3600bdc14 Format fixes in light module (#1874)
* Light: proper printf format for HSV, use lround

* core: warn about map() and 2.3.0, type-strict constrain()

* use generic format

* value already has brightness
2019-08-30 06:32:56 +03:00
reaper7
bbb4c061f6 Fix relative paths in prototypes.h (#1878)
Fix Arduino IDE error by changing to proper relative paths:

```
In file included from sketch\config/all.h:36:0, from C:\Programy\arduino_projekty\espurna_dev\code\espurna\espurna.ino:22:
sketch\config/prototypes.h:178:86: fatal error: static/letsencrypt_isrgroot_pem.h: No such file or directory

#include "static/letsencrypt_isrgroot_pem.h" // Default to LetsEncrypt X3 certificate

compilation terminated.
```
2019-08-30 06:32:35 +03:00
Max Prokhorov
58401c8a61 Use indexed keys for energy saving (#1875)
* Use indexed keys for energy saving

* match else even when rtcmem cannot fit the value

* fix energy reset placement

* fix rtcmem->energy size check

* revert to pre 62a2b9e value, handle update from 1.13.5
2019-08-27 03:15:47 +03:00
foxman69
d66b8a9bed Syncronize js when saving configuration (#1863)
* Syncronize js when saving important data

* update webui
2019-08-27 01:15:24 +03:00
Antonio López Marín
93c1dd6bf9 Support Shelly 2.5 (#1827)
* Add Shelly 2.5

* Add ADE7953 sensor support

* Fix compilation

* Use only one instance

* WIP: Not working, I got StoreProhibited exception

* Fix exception

* Fix merge issues

* Apply request review changes

* declare struct before using it

* uninterruptible delay

* try optimized reg_size

* fix types

* Remove gpio 0 input in analog sensor

* Add energy to ADE7953, it is not finished yet

* Add new method to save energy with index

* Finish energy for ADE7953
2019-08-27 00:25:19 +03:00
Niek van der Maas
b48f8c1440 MQTT rewrite with SSL fixes (#1751, #1829)
* MQTT rewrite with SSL fixes

- Added Arduino MQTT library support (actively maintained)
- Added support for BearSSL (core >= 2.5)
- BearSSL validation: insecure, fingerprinting and CA validation
- AxTLS validation: insecure and fingerprinting
- Support MFLN in order to reduce heap usage

* Better header incl, fix building w/ no NTP_SUPPORT

* Clean up code, use DEBUG_MSG_P

* Fix compile error
2019-08-26 23:59:07 +03:00
Yonsm
fa9ff7dee7 Check value range for PMSX005 and SenseAir CO2 sensor (#1865) 2019-08-22 03:23:50 +03:00
Tercio Gaudencio Filho
85a09a2b47 Add #ifndef guard for BMX280_... defines (#1867) 2019-08-22 03:10:40 +03:00
Max Prokhorov
c15d87a517 Remove gpio 0 pinmode in analog sensor
Thanks to @tonilopezmr 
1c3d68af34
2019-08-22 03:08:28 +03:00
foxman69
43a44cf964 Authenticate /reset endpoint (#1858) 2019-08-16 02:46:21 +03:00
Max Prokhorov
b100d5f603 ws: create incoming buffer once, no need to delay 2019-08-16 02:44:48 +03:00
Max Prokhorov
c126ff4604 ws: include queue header 2019-08-16 02:44:48 +03:00
Max Prokhorov
4ef069abb0 Fully fit unsigned char in the format 2019-08-16 02:44:48 +03:00
Max Prokhorov
c5827b228d Fix WS memory leak when disconnected (#1857) 2019-08-15 18:23:58 +03:00
Max Prokhorov
9d9df478bd Fix WEB_SUPPORT=0 and missing definitions (#1853)
* clean-up ws declarations, remove old stubs

* always fw declare callback types

* wsPost is only possible with WEB_SUPPORT

* some more ws methods
2019-08-15 18:05:26 +03:00
Max Prokhorov
ef153b4eff Core 2.6.0+ fixes (#1852)
* Core 2.6.0+ fixes

* fix env -> config, run travis04 job

* don't duplicate free heap in frag data, use single stats struct

* fix dtostrf warnings, bump buffer sizes

* ...and even less words for fragmentation stat
2019-08-15 18:04:55 +03:00
Max Prokhorov
d4311211ad Lock relay status on boot (#1705)
* relays: locked status

* remove debug

* Disable relay toggle when locked

* fixup! Disable relay toggle when locked

* Send lock with status, fix "disable" condition

* typo

* Update WebUI
2019-08-13 00:33:27 +03:00
Max Prokhorov
d4dea17f94 Fix missing WS debug messages (#1851)
Amend #1843 , since we have updated ESPAsyncWebServer
Fixes (again) #1300

Gather WS debug messages in a buffer and flush every N times
info,keys,crash actually output data now
2019-08-13 00:18:45 +03:00
Max Prokhorov
21423431ce Fixed size json payload & other WS bugfixes (#1843)
- update every dynamicjsonbuffer with fixed size constructor argument
- change to ws callback registration to use a class builder (just cosmetic)
- test multiple ws data callbacks for each module
- remove some of the static strings in favour of ws data callback
- improve sensor ws callback data size, remove duplicated strings
- use static buffer in wsDebugSend
- postpone wsSend until loop, implement wsPost to allow other modules to queue message callbacks. remove Ticker based ws callbacks for data
- update WebUI files
2019-08-12 23:24:52 +03:00
Max Prokhorov
9156eb1477 Experimental support of HTTPUpdate for OTA (#1751)
- add httpupdate ota impelementation
- move async ota into a separate module
- support bearssl & axtls through wificlientsecure
- allow to disable arduino ide ota module
2019-08-12 23:16:06 +03:00
Max Prokhorov
f4e3ced56a Port PROGMEM from 2.5.0 (#1374)
* Port PROGMEM from 2.5.0

* Update prototypes.h

* Guard for <2.5.0, prettify
2019-08-12 21:46:42 +03:00
Niek van der Maas
274f71d7d9 Allow offline building - skip package updater if there is no connection (#1841) 2019-08-06 15:13:08 +03:00
Max Prokhorov
437424aaac .ld scripts refactoring (#1559)
* initial ldscripts refactoring

* add missing menu options

* board for 2.3.0 and 2.4.2

* test with core 2.5.0

* typo

* ...same typo in other boards.local.txt

* generate boards.local.txt from common template

* Depend on file presence instead of platform version

* sdk selection

* Override only relevant entries

* generate ldscripts

* formatting

* unused

* fix section scope

* fix linker script comment and build getting stuck

* py2 compat

platformio from pip still does not support py3

* add TODO for py3

* chmod +x, remove leading newline

* comment with real spiffs size

* fixup! chmod +x, remove leading newline

* regenerate all ldscripts

* Preventive fix of spiffs_end calculation

* update arg parsing

* generate only 2.3.0 and latest

* readme for boards.local.txt

* Update ldscript readme

* unique flash sizes

* fix sub

* line break

* correct way to get framework path

* Alias for _FS_... symbols

* unused 2m1m1s

* bump?

* show travis logs

* ensure latest toolchain for travis

* check platform packages when building
2019-08-05 19:44:21 +03:00
Max Prokhorov
8d009a66f5 Add missing DOMOTICZ_... ifndef guards
https://github.com/xoseperez/espurna/issues/1839#issuecomment-518248474
2019-08-05 19:35:23 +03:00
Pavel S
228fba5b3a Enable multiple Digital & Events sensors (#1832)
* enable multiple Digital, Events & PulseMeter

* delete SPI dependency

* back to only one PulseMeter

* deprecared pins
2019-08-05 19:20:10 +03:00
Laine Walker-Avina
7e536be79c Add iselector-sm-pw702 (#1837) 2019-08-05 19:01:05 +03:00
Sandeep Sirpatil
6d74f4e958 Add etekcity-esw01-usa (#1836)
*  * Added support for Etekcity ESW01-USA device

* Update hardware.h

* Update hardware.h
2019-08-05 18:57:08 +03:00
Max Prokhorov
e49e538ce3 Update arduino.h 2019-08-05 18:46:35 +03:00
Michael Murton
dfb0cfb717 add s31-lite hardware profile
Signed-off-by: Michael Murton <6764025+CrazyIvan359@users.noreply.github.com>
2019-07-20 09:26:59 -04:00
arihant daga
fbf2b71749 Backup EEPROM before performing OTA (#1808, #1809)
* [Fix] Backing up EEPROM before performing OTA.For fixing - [#1808]

* Guard ArduinoOTA, different handler for async
2019-07-18 02:05:25 +03:00
Max Prokhorov
6765fd830f Fix assert condition 2019-07-18 02:04:17 +03:00
Max Prokhorov
e169a9dc6d Always apply channel inputValue->value 2019-07-18 02:04:17 +03:00
Max Prokhorov
5883617ee6 Light: move gamma to PROGMEM 2019-07-18 02:04:17 +03:00
Max Prokhorov
c918791920 Light: split RGBWW and only W brightness 2019-07-18 02:04:17 +03:00
Max Prokhorov
f8a0b9935c Terminal: Add description for each channel 2019-07-18 02:04:17 +03:00
Antonio López Marín
2e8ff3ab3d Add Shelly 1PM (#1822)
* Add Shelly 1PM

* Improve Shelly 1PM temperature tabs

* Add shelly 1pm button
2019-07-18 02:03:51 +03:00
Max Prokhorov
4469ec8575 env:wemos-d1mini is 4MB board 2019-07-15 00:44:42 +03:00
m-kozlowski
8dac0bbe49 Build date in ota.py (mDNS) (#1736)
* include build_date in mdns (and ota.py)

* ota.py: correct number of dashes in header
2019-07-15 00:42:12 +03:00
Max Prokhorov
98fbb8fc6f Update platformio.ini
Fix upload_... -> ota_upload_...
2019-07-13 05:35:38 +03:00
Max Prokhorov
b454cc4ed8 Web OTA: check authentication result before accepting payload (#1812) 2019-07-13 05:18:08 +03:00
Max Prokhorov
dd7760e76a Fixes for platformio builds (#1818)
* Define ota_upload_port, ota_upload_flags

* Update core builds - basic, wps and smartconfig
2019-07-13 02:58:43 +03:00
konsgn
ee8a6e022a Nexete A19 RGBW bulb (#1814)
* adding Nexete

Started Adding Nexete A19 Bulb

* Update hardware.h

* fixed pinout

* Rename to Nexete_A19 + added non-ota
2019-07-13 02:58:04 +03:00
Niek van der Maas
9be43c364a Telnet/WiFiServer: alternative to ESPAsyncTCP (#1799)
* Telnet rewrite, no longer using ESPAsyncTCP

* Support two telnet server implementations

* Clean up diff

* Update types, no free() calls, cleanup

* Use std::unique_ptr

* Fix nullptr checks

* Fix double log with async server

* Common new connection method

* use same connected() check as sync variant

* fixup! use same connected() check as sync variant

* Fix compile issue, close connection in case of timeout and when max connections reached

* Use AyncsClient* in function call

* Allow overriding telnet port + max clients

* Do not allocate 512 bytes by default

* Use TERMINAL_BUFFER_SIZE
2019-07-13 02:56:31 +03:00
Rui Caridade
3bb5cc879f Make compilation more flexible (#1816)
* Make compilation more flexible allowing to define in custom.h your own variation to devices and define four wifi networks

* Implement suggestion from Max Prokhorov, it's simpler and cleaner

* Change a #elif by #else

* Move ESPurna Core comment
2019-07-13 02:54:53 +03:00