Skip to content

Commit

Permalink
v5.1.0
Browse files Browse the repository at this point in the history
5.1.0 20170513
* Fix Offline/Removal of retained topic when FullTopic is changed
* Add FullTopic to MQTT Configuration and Information web page
* Adde license model GPLv3 (#188)
  • Loading branch information
arendst committed May 13, 2017
1 parent 3143b6e commit f6f6616
Show file tree
Hide file tree
Showing 26 changed files with 1,129 additions and 445 deletions.
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

Binary file modified api/arduino/sonoff.ino.bin
Binary file not shown.
7 changes: 6 additions & 1 deletion sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/* 5.0.7 20170511
/* 5.1.0 20170513
* Fix Offline/Removal of retained topic when FullTopic is changed
* Add FullTopic to MQTT Configuration and Information web page
* Adde license model GPLv3 (#188)
*
* 5.0.7 20170511
* Fix possible exception 28 on empty command
* Add command SetOption0 as replacement for SaveState
* Add command SetOption1 as replacement for ButtonRestrict
Expand Down
21 changes: 18 additions & 3 deletions sonoff/settings.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/*********************************************************************************************\
* Config settings
\*********************************************************************************************/
/*
settings.h - setting variables for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

typedef union { // Restricted by MISRA-C Rule 18.4 but so usefull...
uint32_t data; // Allow bit manipulation using SetOption
Expand Down
38 changes: 16 additions & 22 deletions sonoff/settings.ino
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
/*
Copyright (c) 2017 Theo Arends. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
settings.ino - user settings for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*********************************************************************************************\
Expand Down
50 changes: 33 additions & 17 deletions sonoff/sonoff.ino
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
/*
* Sonoff-Tasmota by Theo Arends
*
* ====================================================
* Prerequisites:
* - Change libraries/PubSubClient/src/PubSubClient.h
* #define MQTT_MAX_PACKET_SIZE 512
*
* - Select IDE Tools - Flash size: "1M (no SPIFFS)"
* ====================================================
sonoff.ino - Sonoff-Tasmota firmware for iTead Sonoff, Wemos and NodeMCU hardware
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
====================================================
Prerequisites:
- Change libraries/PubSubClient/src/PubSubClient.h
#define MQTT_MAX_PACKET_SIZE 512
- Select IDE Tools - Flash size: "1M (no SPIFFS)"
====================================================
*/

#define VERSION 0x05000700 // 5.0.7
#define VERSION 0x05010000 // 5.1.0

enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL};
enum week_t {Last, First, Second, Third, Fourth};
Expand Down Expand Up @@ -327,11 +344,6 @@ void getTopic_P(char *stopic, byte prefix, char *topic, const char* subtopic)
fulltopic += "/";
}
snprintf_P(stopic, TOPSZ, PSTR("%s%s"), fulltopic.c_str(), romram);
/*
char log[LOGSZ];
snprintf_P(log, sizeof(log), PSTR("MTPC: %s"), stopic);
addLog(LOG_LEVEL_DEBUG, log);
*/
}

char* getStateText(byte state)
Expand Down Expand Up @@ -706,8 +718,12 @@ boolean mqtt_command(boolean grpflg, char *type, uint16_t index, char *dataBuf,
if (!strcmp(dataBuf, MQTTClient)) {
payload = 1;
}
strlcpy(sysCfg.mqtt_fulltopic, (1 == payload) ? MQTT_FULLTOPIC : dataBuf, sizeof(sysCfg.mqtt_fulltopic));
restartflag = 2;
strlcpy(stemp1, (1 == payload) ? MQTT_FULLTOPIC : dataBuf, sizeof(stemp1));
if (strcmp(stemp1, sysCfg.mqtt_fulltopic)) {
mqtt_publish_topic_P(2, PSTR("LWT"), (sysCfg.flag.mqtt_offline) ? "Offline" : "", true); // Offline or remove previous retained topic
strlcpy(sysCfg.mqtt_fulltopic, stemp1, sizeof(sysCfg.mqtt_fulltopic));
restartflag = 2;
}
}
snprintf_P(svalue, ssvalue, PSTR("{\"FullTopic\":\"%s\"}"), sysCfg.mqtt_fulltopic);
}
Expand Down
21 changes: 18 additions & 3 deletions sonoff/sonoff_template.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/*********************************************************************************************\
* Template parameters
\*********************************************************************************************/
/*
sonoff_template.h - template settings for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// User selectable GPIO functionality
enum upins_t {
Expand Down
19 changes: 19 additions & 0 deletions sonoff/support.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
support.h - parameters used by platformio for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
38 changes: 16 additions & 22 deletions sonoff/support.ino
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
/*
Copyright (c) 2017 Theo Arends. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
support.ino - support for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

const char JSON_SNS_TEMPHUM[] PROGMEM =
Expand Down
21 changes: 19 additions & 2 deletions sonoff/user_config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
/*
user_config.h - user specific configuration for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*********************************************************************************************\
* User specific configuration parameters
*
* ATTENTION: Changes to most PARAMETER defines will only override flash settings if you change
* define CFG_HOLDER.
* Most parameters can be changed online using commands via MQTT, WebConsole or serial
Expand Down
21 changes: 19 additions & 2 deletions sonoff/user_config_override.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
/*
user_config_override.h - user configuration overrides user_config.h for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*****************************************************************************************************\
* User specific configuration parameters to override user_config.h
*
* ATTENTION: - Changes to most PARAMETER defines will only override flash settings if you change
* define CFG_HOLDER.
* - Expect compiler warnings when no ifdef/undef/endif sequence is used.
Expand Down
Loading

0 comments on commit f6f6616

Please sign in to comment.