Browse Source

Version 1.4.0

fastled 1.4.0
Xose Pérez 8 years ago
parent
commit
b511e65905
15 changed files with 22 additions and 54 deletions
  1. +9
    -3
      CHANGELOG.md
  2. +6
    -10
      README.md
  3. +0
    -1
      code/espurna/config/general.h
  4. +1
    -1
      code/espurna/config/version.h
  5. +0
    -1
      code/espurna/data/fsversion
  6. BIN
      code/espurna/data/index.html.gz
  7. BIN
      code/espurna/data/script.js.gz
  8. BIN
      code/espurna/data/style.css.gz
  9. +1
    -13
      code/espurna/espurna.ino
  10. +0
    -3
      code/espurna/mqtt.ino
  11. +1
    -0
      code/espurna/web.ino
  12. +1
    -1
      code/gulpfile.js
  13. +0
    -1
      code/html/fsversion
  14. +2
    -2
      code/html/index.html
  15. +1
    -18
      code/pio_hooks.py

+ 9
- 3
CHANGELOG.md View File

@ -3,12 +3,20 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/) The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
## [1.4.0] 2016-12-31
### Added ### Added
- Domoticz support via MQTT (https://www.domoticz.com/wiki/MQTT) - Domoticz support via MQTT (https://www.domoticz.com/wiki/MQTT)
- Support for static IP connections
### Fixed
- #16 Enforce minimum password strength in web interface
### Changed ### Changed
- Using default client_id provided by AsyncMqttClient - Using default client_id provided by AsyncMqttClient
- Allow up to 5 different WIFI networks
### Removed
- File system version file
## [1.3.1] 2016-12-31 ## [1.3.1] 2016-12-31
### Fixed ### Fixed
@ -126,8 +134,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed ### Changed
- Moving wifi management to library (JustWifi) - Moving wifi management to library (JustWifi)
### Changed
- Split code into modules - Split code into modules
## [0.9.6] 2016-08-12 ## [0.9.6] 2016-08-12


+ 6
- 10
README.md View File

@ -1,15 +1,15 @@
# ESPurna Firmware # ESPurna Firmware
ESPurna ("spark" in Catalan) is a custom firmware for ESP8266 based smart switches. ESPurna ("spark" in Catalan) is a custom firmware for ESP8266 based smart switches.
It was originally developed with the **[IteadStudio Sonoff][1]** in mind but now it supports a growing number of ESP8266-based boards.
It was originally developed with the **[IteadStudio Sonoff](https://www.itead.cc/sonoff-wifi-wireless-switch.html)** in mind but now it supports a growing number of ESP8266-based boards.
It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries. It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries.
**Current Release Version is 1.3.1**, read the [changelog](CHANGELOG.md).
**Current Release Version is 1.4.0**, read the [changelog](CHANGELOG.md).
## Features ## Features
* Support for **multiple ESP8266-based boards** ([check list](#supported-hardware)) * Support for **multiple ESP8266-based boards** ([check list](#supported-hardware))
* Wifi **AP Mode** or **STA mode** with **multiple network definitions**
* Wifi **AP Mode** or **STA mode** with **multiple network definitions** and static IP support
* **MQTT** enabled * **MQTT** enabled
* Switch on/off and toggle relays * Switch on/off and toggle relays
* LED notifications * LED notifications
@ -17,7 +17,7 @@ It uses the Arduino Core for ESP8266 framework and a number of 3rd party librari
* DHT11 / DHT22 / DHT21 / AM2301 * DHT11 / DHT22 / DHT21 / AM2301
* DS18B20 * DS18B20
* HLW8012 (Sonoff POW) * HLW8012 (Sonoff POW)
* Non-invasive current sensor using the [EmonLiteESP Library][3] (requires some hacking)
* Non-invasive current sensor using the [EmonLiteESP Library](https://bitbucket.org/xoseperez/emonliteesp) (requires some hacking)
* Fast asynchronous **HTTP Server** * Fast asynchronous **HTTP Server**
* Basic authentication * Basic authentication
* Web-based configuration * Web-based configuration
@ -28,8 +28,9 @@ It uses the Arduino Core for ESP8266 framework and a number of 3rd party librari
* **Command line configuration** * **Command line configuration**
* **Over-The-Air** (OTA) updates even for 1Mb boards * **Over-The-Air** (OTA) updates even for 1Mb boards
* Manually from PlatformIO or Arduino Inside * Manually from PlatformIO or Arduino Inside
* Automatic updates through the [NoFUSS Library][2]
* Automatic updates through the [NoFUSS Library](https://bitbucket.org/xoseperez/nofuss)
* **Alexa** integration (requires staging version of Arduino Core for ESP8266) * **Alexa** integration (requires staging version of Arduino Core for ESP8266)
* [**Domoticz**](https://domoticz.com/) integration via MQTT
## Documentation ## Documentation
@ -61,8 +62,3 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
[1]: https://www.itead.cc/sonoff-wifi-wireless-switch.html
[2]: https://bitbucket.org/xoseperez/nofuss
[3]: https://bitbucket.org/xoseperez/emonliteesp

+ 0
- 1
code/espurna/config/general.h View File

@ -6,7 +6,6 @@
#define HOSTNAME DEVICE #define HOSTNAME DEVICE
#define BUFFER_SIZE 1024 #define BUFFER_SIZE 1024
#define HEARTBEAT_INTERVAL 300000 #define HEARTBEAT_INTERVAL 300000
#define FS_VERSION_FILE "/fsversion"
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// RELAY // RELAY


+ 1
- 1
code/espurna/config/version.h View File

@ -1,4 +1,4 @@
#define APP_NAME "ESPurna" #define APP_NAME "ESPurna"
#define APP_VERSION "1.3.1"
#define APP_VERSION "1.4.0"
#define APP_AUTHOR "xose.perez@gmail.com" #define APP_AUTHOR "xose.perez@gmail.com"
#define APP_WEBSITE "http://tinkerman.cat" #define APP_WEBSITE "http://tinkerman.cat"

+ 0
- 1
code/espurna/data/fsversion View File

@ -1 +0,0 @@
1.3.0

BIN
code/espurna/data/index.html.gz View File


BIN
code/espurna/data/script.js.gz View File


BIN
code/espurna/data/style.css.gz View File


+ 1
- 13
code/espurna/espurna.ino View File

@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <NtpClientLib.h> #include <NtpClientLib.h>
#include <ESPAsyncWebServer.h> #include <ESPAsyncWebServer.h>
#include <AsyncMqttClient.h> #include <AsyncMqttClient.h>
#include "FS.h"
void mqttRegister(void (*callback)(unsigned int, const char *, const char *)); void mqttRegister(void (*callback)(unsigned int, const char *, const char *));
template<typename T> bool setSetting(const String& key, T value); template<typename T> bool setSetting(const String& key, T value);
template<typename T> String getSetting(const String& key, T defaultValue); template<typename T> String getSetting(const String& key, T defaultValue);
@ -48,18 +48,6 @@ void hardwareSetup() {
SPIFFS.begin(); SPIFFS.begin();
} }
void getFSVersion(char * buffer) {
File h = SPIFFS.open(FS_VERSION_FILE, "r");
if (!h) {
DEBUG_MSG("[SPIFFS] Could not open file system version file.\n");
strcpy(buffer, APP_VERSION);
return;
}
size_t size = h.size();
h.readBytes(buffer, size - 1);
h.close();
}
void hardwareLoop() { void hardwareLoop() {
// Heartbeat // Heartbeat


+ 0
- 3
code/espurna/mqtt.ino View File

@ -84,9 +84,6 @@ void _mqttOnConnect(bool sessionPresent) {
// Say hello and report our IP and VERSION // Say hello and report our IP and VERSION
mqttSend(MQTT_IP_TOPIC, getIP().c_str()); mqttSend(MQTT_IP_TOPIC, getIP().c_str());
mqttSend(MQTT_VERSION_TOPIC, APP_VERSION); mqttSend(MQTT_VERSION_TOPIC, APP_VERSION);
char buffer[50];
getFSVersion(buffer);
mqttSend(MQTT_FSVERSION_TOPIC, buffer);
// Send connect event to subscribers // Send connect event to subscribers
for (unsigned char i = 0; i < _mqtt_callbacks.size(); i++) { for (unsigned char i = 0; i < _mqtt_callbacks.size(); i++) {


+ 1
- 0
code/espurna/web.ino View File

@ -177,6 +177,7 @@ void _wsParse(uint32_t client_id, uint8_t * payload, size_t length) {
} }
if (value != getSetting(key)) { if (value != getSetting(key)) {
//DEBUG_MSG("[WEBSOCKET] Storing %s = %s\n", key.c_str(), value.c_str());
setSetting(key, value); setSetting(key, value);
dirty = true; dirty = true;
if (key.startsWith("mqtt")) dirtyMQTT = true; if (key.startsWith("mqtt")) dirtyMQTT = true;


+ 1
- 1
code/gulpfile.js View File

@ -91,4 +91,4 @@ gulp.task('html', function() {
/* Build file system */ /* Build file system */
gulp.task('buildfs_split', ['clean', 'files', 'html']); gulp.task('buildfs_split', ['clean', 'files', 'html']);
gulp.task('buildfs_inline', ['clean', 'files', 'inline']); gulp.task('buildfs_inline', ['clean', 'files', 'inline']);
gulp.task('default', ['buildfs_inline']);
gulp.task('default', ['buildfs_split']);

+ 0
- 1
code/html/fsversion View File

@ -1 +0,0 @@
1.3.1

+ 2
- 2
code/html/index.html View File

@ -388,12 +388,12 @@
<div class="more"> <div class="more">
<div class="break" />
<div class="break"></div>
<label class="pure-u-md-1-6 pure-u-1-4" for="pass">Password</label> <label class="pure-u-md-1-6 pure-u-1-4" for="pass">Password</label>
<input class="pure-u-md-5-6 pure-u-3-4" name="pass" type="password" value="" tabindex="0" /> <input class="pure-u-md-5-6 pure-u-3-4" name="pass" type="password" value="" tabindex="0" />
<div class="break" />
<div class="break"></div>
<label class="pure-u-md-1-6 pure-u-1-4" for="ip">Static IP</label> <label class="pure-u-md-1-6 pure-u-1-4" for="ip">Static IP</label>
<input class="pure-u-md-5-6 pure-u-3-4" name="ip" type="text" value="" size="15" tabindex="0" /> <input class="pure-u-md-5-6 pure-u-3-4" name="ip" type="text" value="" size="15" tabindex="0" />


+ 1
- 18
code/pio_hooks.py View File

@ -5,24 +5,7 @@ import socket
from SCons.Script import DefaultEnvironment from SCons.Script import DefaultEnvironment
env = DefaultEnvironment() env = DefaultEnvironment()
def is_valid_ip(ip):
try:
socket.inet_aton(ip)
return True
except socket.error:
return False
def before_build_spiffs(source, target, env): def before_build_spiffs(source, target, env):
env.Execute("gulp buildfs_split")
def before_upload(source, target, env):
upload_port = env.get('UPLOAD_PORT', False)
if upload_port and upload_port[0] == '/':
cmd = ["mosquitto_sub", "-t", upload_port, "-h", "192.168.1.10", "-N", "-C", "1"]
ip = subprocess.check_output(cmd)
if is_valid_ip(ip):
env['UPLOAD_PORT'] = '"' + ip + '"'
env.Execute("gulp")
#env.AddPreAction("uploadfs", before_upload)
#env.AddPreAction("upload", before_upload)
env.AddPreAction(".pioenvs/%s/spiffs.bin" % env['PIOENV'], before_build_spiffs) env.AddPreAction(".pioenvs/%s/spiffs.bin" % env['PIOENV'], before_build_spiffs)

Loading…
Cancel
Save