Skip to content

Commit

Permalink
v5.12.0a - Fixes and changes
Browse files Browse the repository at this point in the history
5.12.0a
 * Change platformio option sonoff-ds18x20 to sonoff-xxl
enabling ds18x20 and all other sensors in one image
 * Fix providing web
page configuratin option for Friendly Name when no device (relay or
light) is configured (#1850)
 * Change default paremeters in
user_config.h to undefined for easy installation (#1851)
 * Change max
user configurable hold time from 10 to 25 seconds (#1851)
  • Loading branch information
arendst committed Feb 10, 2018
1 parent 741344a commit 193fdc9
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 64 deletions.
48 changes: 24 additions & 24 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ src_dir = sonoff

; *** Uncomment one of the lines below to build/upload only one environment
;env_default = sonoff
;env_default = sonoff-minimal
;env_default = sonoff-xxl
;env_default = sonoff-DE
;env_default = sonoff-ES
;env_default = sonoff-FR
;env_default = sonoff-IT
;env_default = sonoff-NL
;env_default = sonoff-PL
;env_default = sonoff-CN
;env_default = sonoff-minimal
;env_default = sonoff-ds18x20

[env:sonoff]
platform = espressif8266
Expand All @@ -47,110 +47,110 @@ monitor_baud = 115200
;upload_port = domus1:80/api/upload-arduino.php
;extra_scripts = pio/strip-floats.py, pio/http-uploader.py

[env:sonoff-DE]
[env:sonoff-minimal]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=de-DE
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DBE_MINIMAL
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
; Serial Monitor options
monitor_baud = 115200

[env:sonoff-ES]
[env:sonoff-xxl]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=es-AR
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_ALL_SENSORS
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
; Serial Monitor options
monitor_baud = 115200

[env:sonoff-FR]
[env:sonoff-DE]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=fr-FR
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=de-DE
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
monitor_baud = 115200

[env:sonoff-IT]
[env:sonoff-ES]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=it-IT
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=es-AR
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
monitor_baud = 115200

[env:sonoff-NL]
[env:sonoff-FR]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=nl-NL
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=fr-FR
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
monitor_baud = 115200

[env:sonoff-PL]
[env:sonoff-IT]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pl-PL
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=it-IT
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
monitor_baud = 115200

[env:sonoff-CN]
[env:sonoff-NL]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=nl-NL
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; *** Serial Monitor options
monitor_baud = 115200

[env:sonoff-minimal]
[env:sonoff-PL]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DBE_MINIMAL
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pl-PL
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; Serial Monitor options
; *** Serial Monitor options
monitor_baud = 115200

[env:sonoff-ds18x20]
[env:sonoff-CN]
platform = espressif8266
framework = arduino
board = esp01_1m
board_flash_mode = dout
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_DS18x20
build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN
lib_deps = PubSubClient, NeoPixelBus, IRremoteESP8266, ArduinoJSON
extra_scripts = pio/strip-floats.py

; Serial Monitor options
; *** Serial Monitor options
monitor_baud = 115200
4 changes: 4 additions & 0 deletions sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* 5.12.0a
* Change platformio option sonoff-ds18x20 to sonoff-xxl enabling ds18x20 and all other sensors in one image
* Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850)
* Change default paremeters in user_config.h to undefined for easy installation (#1851)
* Change max user configurable hold time from 10 to 25 seconds (#1851)
*
* 5.12.0 20180209
* Change library PubSubClient.h define MQTT_MAX_PACKET_SIZE from 512 to 1000 for Home Assistant support
Expand Down
2 changes: 1 addition & 1 deletion sonoff/sonoff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
else { // SetOption32 ..
switch (index) {
case P_HOLD_TIME:
if ((payload >= 1) && (payload <= 100)) {
if ((payload >= 1) && (payload <= 250)) {
Settings.param[P_HOLD_TIME] = payload;
}
break;
Expand Down
89 changes: 63 additions & 26 deletions sonoff/sonoff_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,85 +33,122 @@ void WifiWpsStatusCallback(wps_cb_status status);
}
#endif

#define USE_DHT // Default DHT11 sensor needs no external library
#define USE_DHT // Default DHT11 sensor needs no external library

#ifdef USE_ALL_SENSORS // ===================== Configure sonoff-xxl.bin =========================
#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices
#define USE_DS18x20 // For more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
//#define USE_DS18x20_LEGACY // For more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)
#define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram)
#define USE_SHT // Add I2C emulating code for SHT1X sensor (+1k4 code)
#define USE_SHT3X // Add I2C code for SHT3x sensor (+0k6 code)
#define USE_HTU // Add I2C code for HTU21/SI7013/SI7020/SI7021 sensor (+1k5 code)
#define USE_BMP // Add I2C code for BMP085/BMP180/BMP280/BME280 sensor (+4k code)
#define USE_BME680 // Add additional support for BME680 sensor using Adafruit Sensor and BME680 libraries (+6k code)
#define USE_BH1750 // Add I2C code for BH1750 sensor (+0k5 code)
#define USE_VEML6070 // Add I2C code for VEML6070 sensor (+0k5 code)
#define USE_TSL2561 // Add I2C code for TSL2561 sensor using library Adafruit TSL2561 Arduino (+1k2 code)
#define USE_ADS1115 // Add I2C code for ADS1115 16 bit A/D converter based on Adafruit ADS1x15 library (no library needed) (+0k7 code)
// #define USE_ADS1115_I2CDEV // Add I2C code for ADS1115 16 bit A/D converter using library i2cdevlib-Core and i2cdevlib-ADS1115 (+2k code)
#define USE_INA219 // Add I2C code for INA219 Low voltage and current sensor (+1k code)
#define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+2k code)
#define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code)
#ifndef CO2_LOW
#define CO2_LOW 800 // Below this CO2 value show green light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1)
#endif
#ifndef CO2_HIGH
#define CO2_HIGH 1200 // Above this CO2 value show red light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1)
#endif
#define USE_PMS5003 // Add support for PMS5003 and PMS7003 particle concentration sensor (+1k3 code)
#define USE_PZEM004T // Add support for PZEM004T Energy monitor (+2k code)
#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
#define USE_IR_HVAC // Support for HVAC system using IR (+2k code)
#define USE_IR_RECEIVE // Support for IR receiver (+5k5 code, 264 iram)
#define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by //
#ifndef USE_WS2812_CTYPE
#define USE_WS2812_CTYPE 1 // WS2812 Color type (0 - RGB, 1 - GRB, 2 - RGBW, 3 - GRBW)
#endif
// #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
#define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0))
#endif // USE_ALL_SENSORS =====================

#if defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY)
#else
#define USE_DS18B20 // Default DS18B20 sensor needs no external library
#define USE_DS18B20 // Default DS18B20 sensor needs no external library
#endif

//#define DEBUG_THEO // Add debug code
//#define DEBUG_THEO // Add debug code

#ifdef BE_MINIMAL
#ifdef BE_MINIMAL // ========================== Configure sonoff-minimal.bin =====================
#ifdef USE_MQTT_TLS
#undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set
#undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set
#endif
#ifdef USE_DISCOVERY
#undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server
#undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server
#endif
#ifdef USE_DOMOTICZ
#undef USE_DOMOTICZ // Disable Domoticz
#undef USE_DOMOTICZ // Disable Domoticz
#endif
#ifdef USE_HOME_ASSISTANT
#undef USE_HOME_ASSISTANT // Disable Home Assistant
#undef USE_HOME_ASSISTANT // Disable Home Assistant
#endif
//#ifdef USE_WEBSERVER
//#undef USE_WEBSERVER // Disable Webserver
//#undef USE_WEBSERVER // Disable Webserver
//#endif
#ifdef USE_EMULATION
#undef USE_EMULATION // Disable Wemo or Hue emulation
#undef USE_EMULATION // Disable Wemo or Hue emulation
#endif
#ifdef USE_PZEM004T
#undef USE_PZEM004T // Disable PZEM004T energy sensor
#undef USE_PZEM004T // Disable PZEM004T energy sensor
#endif
#ifdef USE_DS18x20
#undef USE_DS18x20 // Disable DS18x20 sensor
#undef USE_DS18x20 // Disable DS18x20 sensor
#endif
#ifdef USE_I2C
#undef USE_I2C // Disable all I2C sensors and devices
#undef USE_I2C // Disable all I2C sensors and devices
#endif
#ifdef USE_SPI
#undef USE_SPI // Disable all SPI devices
#undef USE_SPI // Disable all SPI devices
#endif
#ifdef USE_WS2812
#undef USE_WS2812 // Disable WS2812 Led string
#undef USE_WS2812 // Disable WS2812 Led string
#endif
#ifdef USE_DS18B20
#undef USE_DS18B20 // Disable internal DS18B20 sensor
#undef USE_DS18B20 // Disable internal DS18B20 sensor
#endif
#ifdef USE_DHT
#undef USE_DHT // Disable internal DHT sensor
#undef USE_DHT // Disable internal DHT sensor
#endif
#ifdef USE_DISPLAY
#undef USE_DISPLAY // Disable Display support
#undef USE_DISPLAY // Disable Display support
#endif
#ifdef USE_MHZ19
#undef USE_MHZ19 // Disable support for MH-Z19 CO2 sensor
#undef USE_MHZ19 // Disable support for MH-Z19 CO2 sensor
#endif
#ifdef USE_SENSEAIR
#undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor
#undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor
#endif
#ifdef USE_IR_REMOTE
#undef USE_IR_REMOTE // Disable IR driver
#undef USE_IR_REMOTE // Disable IR driver
#endif
#ifdef USE_ARILUX_RF
#undef USE_ARILUX_RF // Disable support for Arilux RF remote controller
#undef USE_ARILUX_RF // Disable support for Arilux RF remote controller
#endif
#ifdef DEBUG_THEO
#undef DEBUG_THEO // Disable debug code
#undef DEBUG_THEO // Disable debug code
#endif
#endif // BE_MINIMAL
#endif // BE_MINIMAL ==========================

#ifndef SWITCH_MODE
#define SWITCH_MODE TOGGLE // TOGGLE, FOLLOW or FOLLOW_INV (the wall switch state)
#define SWITCH_MODE TOGGLE // TOGGLE, FOLLOW or FOLLOW_INV (the wall switch state)
#endif

#ifndef MQTT_FINGERPRINT
#define MQTT_FINGERPRINT "A5 02 FF 13 99 9F 8B 39 8E F1 83 4F 11 23 65 0B 32 36 FC 07"
#endif

#ifndef WS2812_LEDS
#define WS2812_LEDS 30 // [Pixels] Number of LEDs
#define WS2812_LEDS 30 // [Pixels] Number of LEDs
#endif

#ifndef MESSZ
Expand Down
8 changes: 4 additions & 4 deletions sonoff/support.ino
Original file line number Diff line number Diff line change
Expand Up @@ -519,20 +519,20 @@ void WifiConfig(uint8_t type)
restart_flag = 2;
}
else if (WIFI_SMARTCONFIG == wifi_config_type) {
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_1_SMARTCONFIG D_ACTIVE_FOR_3_MINUTES));
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_1_SMARTCONFIG " " D_ACTIVE_FOR_3_MINUTES));
WiFi.beginSmartConfig();
}
else if (WIFI_WPSCONFIG == wifi_config_type) {
if (WifiWpsConfigBegin()) {
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_3_WPSCONFIG D_ACTIVE_FOR_3_MINUTES));
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_3_WPSCONFIG " " D_ACTIVE_FOR_3_MINUTES));
} else {
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_3_WPSCONFIG D_FAILED_TO_START));
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_3_WPSCONFIG " " D_FAILED_TO_START));
wifi_config_counter = 3;
}
}
#ifdef USE_WEBSERVER
else if (WIFI_MANAGER == wifi_config_type) {
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_2_WIFIMANAGER D_ACTIVE_FOR_3_MINUTES));
AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_WCFG_2_WIFIMANAGER " " D_ACTIVE_FOR_3_MINUTES));
WifiManagerBegin();
}
#endif // USE_WEBSERVER
Expand Down
Loading

0 comments on commit 193fdc9

Please sign in to comment.