Skip to content

Commit

Permalink
Merge pull request #7 from letscontrolit/mega
Browse files Browse the repository at this point in the history
update from master
  • Loading branch information
Grovkillen authored May 1, 2018
2 parents c35fe3d + 343ea45 commit 16a6135
Show file tree
Hide file tree
Showing 17 changed files with 871 additions and 417 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
## Project #####################
lib/readme.txt
src/Custom.h
test/output_export.cpp
97 changes: 97 additions & 0 deletions dist/Release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,100 @@
-------------------------------------------------
Changes in release mega-20180501 (since mega-20180430)
-------------------------------------------------

Release date: Tue May 1 04:00:17 CEST 2018

mvdbro (1):
Fix broken Mini Dashboard feature


-------------------------------------------------
Changes in release mega-20180430 (since mega-20180429)
-------------------------------------------------

Release date: Mon Apr 30 04:00:08 CEST 2018

TD-er (4):
[wifi] Do not rely on WiFi.status() and better log of status
[wifi] Use internal ESPeasy state to check connected status
[rules] Add log indicating POST request for update rules
[MQTT] Set default timeout to 10 sec, equal to default Mosquito timeout

mvdbro (1):
Changed plugin call debug timers


-------------------------------------------------
Changes in release mega-20180429 (since mega-20180428)
-------------------------------------------------

Release date: Sun Apr 29 04:00:07 CEST 2018

TD-er (7):
[wifi] Setup static IP config after connecting to wifi.
[wifi] Set static IP config before and after connect
[wifi] Show number of reconnects in the sysinfo
[wifi] Add wifi status log (Debug More) and DHCP/Static config to info page
[wifi] ESP32 does not know wifi_station_get_connect_status()
[wifi] Added connectionCheckHandler() to force reconnect when needed
[wifi] Force wifi reconnect at lots of MQTT failed connects.


-------------------------------------------------
Changes in release mega-20180428 (since mega-20180426)
-------------------------------------------------

Release date: Sat Apr 28 04:00:15 CEST 2018

TD-er (4):
[wifi] Attempt to make event based wifi simpler
[PlatformIO] Updated core to 2.4.1
[wifi] Just disconnect when DNS lookup is not possible
[Wifi] Avoid doing network communications when not connected.


-------------------------------------------------
Changes in release mega-20180426 (since mega-20180425)
-------------------------------------------------

Release date: Thu Apr 26 04:00:14 CEST 2018

Gijs Noorlander (1):
Change use of core 2_4_0 to 2_3_0


-------------------------------------------------
Changes in release mega-20180425 (since mega-20180424)
-------------------------------------------------

Release date: Wed Apr 25 04:00:08 CEST 2018

Grovkillen (4):
Added a void addCopyButton
Made copy to clipboard JavaScript based instead
Added copy to clipboard on log page
Added new lines if BR + delimiter if wanted

Plebs (3):
Fix for #1300
Adding 3 new http commands: taskrun, taskvalueset and rules
Fix another bug in LCD plugin

TD-er (2):
[Modbus] PR #1128 made by @s0170071
[wifi] More active reconnect to wifi when disconnected


-------------------------------------------------
Changes in release mega-20180424 (since mega-20180423)
-------------------------------------------------

Release date: Tue Apr 24 04:00:13 CEST 2018

Grovkillen (1):
Added note to self compilers


-------------------------------------------------
Changes in release mega-20180423 (since mega-20180422)
-------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion lib/MechInputs/QEIx4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void QEIx4::begin(int16_t pinA, int16_t pinB, int16_t pinI, uint8_t mode)
_pinI = pinI;

_counter = 0;
_bHasChanged = true;
_bHasChanged = false;

if (mode == 1)
_eventMask = QEIx4_1x_MASK;
Expand Down
3 changes: 2 additions & 1 deletion lib/pubsubclient/src/PubSubClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
#endif

// MQTT_KEEPALIVE : keepAlive interval in Seconds
// Keepalive timeout for default MQTT Broker is 10s
#ifndef MQTT_KEEPALIVE
#define MQTT_KEEPALIVE 15
#define MQTT_KEEPALIVE 10
#endif

// MQTT_SOCKET_TIMEOUT: socket timeout interval in Seconds
Expand Down
18 changes: 11 additions & 7 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,39 @@ platform = espressif8266@1.5.0
[core_2_4_0]
platform = espressif8266@1.6.0

[core_2_4_1]
platform = espressif8266@1.7.0

[core_staged]
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage

[core_esp32]
#platform = espressif32@0.12.0
platform = https://github.com/platformio/platform-espressif32.git#feature/stage
platform = espressif32@0.12.0
#platform = https://github.com/platformio/platform-espressif32.git#feature/stage
build_flags = -D BUILD_GIT='"${env.TRAVIS_TAG}"'
lib_ignore = ESPeasySoftwareSerial, EspESPeasySoftwareSerial, AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, SerialSensors
lib_deps = ESP32WebServer


[common]
build_flags = -D BUILD_GIT='"${env.TRAVIS_TAG}"' ; ${compiler_warnings.build_flags}
-D PIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
lib_deps = ""
lib_ignore = ESP32_ping, ESP32WebServer
lib_ldf_mode = chain
upload_speed = 460800
framework = arduino
board = esp12e
platform = ${core_2_4_0.platform}
platform = ${core_2_4_1.platform}

[normal]
platform = ${common.platform}

[testing]
platform = ${core_2_4_0.platform}
platform = ${core_2_4_1.platform}

[dev]
platform = ${core_2_4_0.platform}
platform = ${core_2_4_1.platform}


[esp8266_1M]
Expand All @@ -83,13 +87,13 @@ build_flags = ${esp8266_1M.build_flags} -DESP8285
board = esp01_1m
board_flash_mode = ${esp8266_1M.board_flash_mode}
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.1m128.ld
platform = ${core_2_4_0.platform}
platform = ${core_2_4_1.platform}

[Sonoff_8285]
board_flash_mode = ${esp8285_1M.board_flash_mode}
board = ${esp8285_1M.board}
build_flags = ${esp8285_1M.build_flags}
platform = ${core_2_4_0.platform}
platform = ${core_2_4_1.platform}

[espWroom2M]
board_flash_mode = dout
Expand Down
20 changes: 10 additions & 10 deletions src/Command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void ExecuteCommand(byte source, const char *Line)
}
break;
}

case cmd_TimerPause:
{
if (Par1>=1 && Par1<=RULES_TIMER_MAX)
Expand All @@ -500,7 +500,7 @@ void ExecuteCommand(byte source, const char *Line)
{
String event = F("Rules#TimerPause=");
event += Par1;
rulesProcessing(event);
rulesProcessing(event);
RulesTimer[Par1 - 1].paused = true;
RulesTimer[Par1 - 1].interval = -delta; // set remaind time
}
Expand All @@ -514,9 +514,9 @@ void ExecuteCommand(byte source, const char *Line)
{
addLog(LOG_LEVEL_ERROR, F("TIMER: invalid timer number"));
}
break;
break;
}

case cmd_TimerResume:
{
if (Par1>=1 && Par1<=RULES_TIMER_MAX)
Expand All @@ -528,9 +528,9 @@ void ExecuteCommand(byte source, const char *Line)
{
String event = F("Rules#TimerResume=");
event += Par1;
rulesProcessing(event);
rulesProcessing(event);
RulesTimer[Par1 - 1].timestamp = millis() + (RulesTimer[Par1 - 1].interval);
RulesTimer[Par1 - 1].paused = false;
RulesTimer[Par1 - 1].paused = false;
}
}
else
Expand All @@ -542,9 +542,9 @@ void ExecuteCommand(byte source, const char *Line)
{
addLog(LOG_LEVEL_ERROR, F("TIMER: invalid timer number"));
}
break;
break;
}

case cmd_Delay:
{
success = true;
Expand Down Expand Up @@ -748,7 +748,7 @@ void ExecuteCommand(byte source, const char *Line)
case cmd_WifiConnect:
{
success = true;
setWifiState(WifiTryConnect);
WiFiConnectRelaxed();
break;
}

Expand All @@ -761,7 +761,7 @@ void ExecuteCommand(byte source, const char *Line)

case cmd_WifiAPMode:
{
setWifiState(WifiEnableAP);
setAP(true);
success = true;
break;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Controller.ino
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void callback(char* c_topic, byte* b_payload, unsigned int length) {
strncpy(c_payload,(char*)b_payload,length);
c_payload[length] = 0;

/*
String log;
log=F("MQTT : Topic: ");
log+=c_topic;
Expand All @@ -97,6 +98,7 @@ void callback(char* c_topic, byte* b_payload, unsigned int length) {
log=F("MQTT : Payload: ");
log+=c_payload;
addLog(LOG_LEVEL_DEBUG_MORE, log);
*/

// sprintf_P(log, PSTR("%s%s"), "MQTT : Topic: ", c_topic);
// addLog(LOG_LEVEL_DEBUG, log);
Expand All @@ -116,6 +118,7 @@ void callback(char* c_topic, byte* b_payload, unsigned int length) {
\*********************************************************************************************/
bool MQTTConnect(int controller_idx)
{
++mqtt_reconnect_count;
ControllerSettingsStruct ControllerSettings;
LoadControllerSettings(controller_idx, (byte*)&ControllerSettings, sizeof(ControllerSettings));
if (!ControllerSettings.checkHostReachable(true))
Expand Down Expand Up @@ -170,6 +173,7 @@ bool MQTTConnect(int controller_idx)
if (MQTTclient.publish(LWTTopic.c_str(), "Connected", 1)) {
updateMQTTclient_connected();
statusLED(true);
mqtt_reconnect_count = 0;
return true; // end loop if succesfull
}
return false;
Expand Down
Loading

0 comments on commit 16a6135

Please sign in to comment.