Skip to content

Commit

Permalink
6.4.0.3 Hass and Alexa fixes
Browse files Browse the repository at this point in the history
6.4.0.3 20181222
 * Change Hass discovery to short MQTT messages as used by Hass 0.81 and up (arendst#4711)
 * Change FallbackTopic detection (arendst#4706)
 * Add define WIFI_SOFT_AP_CHANNEL in my_user_config.h to set Soft Access Point Channel number between 1 and 13 as used by Wifi Manager web GUI (arendst#4673)
 * Fix Alexa "this value is outside the range of the device". Needs power cycle and Alexa deletion/discovery cycle. (arendst#3159, arendst#4712)
  • Loading branch information
arendst committed Dec 22, 2018
1 parent 3b9f981 commit c6f8cd0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
10 changes: 8 additions & 2 deletions sonoff/_changelog.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/* 6.4.0.2 20181221
/* 6.4.0.3 20181222
* Change Hass discovery to short MQTT messages as used by Hass 0.81 and up (#4711)
* Change FallbackTopic detection (#4706)
* Add define WIFI_SOFT_AP_CHANNEL in my_user_config.h to set Soft Access Point Channel number between 1 and 13 as used by Wifi Manager web GUI (#4673)
* Fix Alexa "this value is outside the range of the device". Needs power cycle and Alexa deletion/discovery cycle. (#3159, #4712)
*
* 6.4.0.2 20181221
* Fix possible dtostrf buffer overflows by increasing buffers
*
*
* 6.4.0.1 20181217
* Add support for AZ-Instrument 7798 CO2 meter/datalogger (#4672)
* Change RAM usage BMP/BME I2C sensors
Expand Down
1 change: 1 addition & 0 deletions sonoff/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
//#define MY_LANGUAGE zh-TW // Chinese (Traditional) in Taiwan

// -- Wifi Config tools ---------------------------
#define WIFI_SOFT_AP_CHANNEL 1 // Soft Access Point Channel number between 1 and 13 as used by Wifi Manager web GUI
//#define USE_WPS // Add support for WPS as initial wifi configuration tool (+33k code, 1k mem (5k mem with core v2.4.2+))
//#define USE_SMARTCONFIG // Add support for Wifi SmartConfig as initial wifi configuration tool (+23k code, +0.6k mem)

Expand Down
3 changes: 2 additions & 1 deletion sonoff/sonoff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
if (XdrvMqttData(topicBuf, sizeof(topicBuf), dataBuf, sizeof(dataBuf))) return;

grpflg = (strstr(topicBuf, Settings.mqtt_grptopic) != NULL);
fallback_topic_flag = (strstr(topicBuf, mqtt_client) != NULL);
snprintf_P(stemp1, sizeof(stemp1), PSTR(D_CMND "/%s/"), mqtt_client); // Full Fallback topic = cmnd/DVES_xxxxxxxx
fallback_topic_flag = (!strncmp(topicBuf, stemp1, strlen(stemp1)));
type = strrchr(topicBuf, '/'); // Last part of received topic is always the command (type)

index = 1;
Expand Down
10 changes: 9 additions & 1 deletion sonoff/xdrv_01_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#define XDRV_01 1

#ifndef WIFI_SOFT_AP_CHANNEL
#define WIFI_SOFT_AP_CHANNEL 1 // Soft Access Point Channel number between 1 and 11 as used by SmartConfig web GUI
#endif

#define HTTP_REFRESH_TIME 2345 // milliseconds
#define HTTP_RESTART_RECONNECT_TIME 9000 // milliseconds
#define HTTP_OTA_RESTART_RECONNECT_TIME 20000 // milliseconds
Expand Down Expand Up @@ -441,7 +445,11 @@ void WifiManagerBegin(void)
StopWebserver();

DnsServer = new DNSServer();
WiFi.softAP(my_hostname);

int channel = WIFI_SOFT_AP_CHANNEL;
if ((channel < 1) || (channel > 13)) { channel = 1; }
WiFi.softAP(my_hostname, NULL, channel);

delay(500); // Without delay I've seen the IP address blank
/* Setup the DNS server redirecting all the domains to the apIP */
DnsServer->setErrorReplyCode(DNSReplyCode::NoError);
Expand Down

0 comments on commit c6f8cd0

Please sign in to comment.