Skip to content

Commit

Permalink
v4.0.3
Browse files Browse the repository at this point in the history
4.0.3 20170309
* Renamed Module NodeMCU to WeMos D1 mini
* Add GPIO1 as user option to some modules
* Add Buttons, Relays and Leds to user configurable options (#159)
* Add description on Module parameters web page to some well known GPIOs
(#107, #171)
  • Loading branch information
arendst committed Mar 9, 2017
1 parent 7786889 commit 59bb20d
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 96 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Sonoff-Tasmota
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.

Current version is **4.0.2** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
Current version is **4.0.3** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.

- This version provides all (Sonoff) modules in one file and starts up with Sonoff Basic.
- Once uploaded select module using the configuration webpage or the commands ```Modules``` and ```Module```.
Expand Down
Binary file modified api/arduino/sonoff-minimal.ino.bin
Binary file not shown.
Binary file modified api/arduino/sonoff.ino.bin
Binary file not shown.
8 changes: 7 additions & 1 deletion sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/* 4.0.2 20170308
/* 4.0.3 20170309
* Renamed Module NodeMCU to WeMos D1 mini
* Add GPIO1 as user option to some modules
* Add Buttons, Relays and Leds to user configurable options (#159)
* Add description on Module parameters web page to some well known GPIOs (#107, #171)
*
* 4.0.2 20170308
* Restore correct seriallog level after Serial logging was disabled
* Add simple dimmer slider to Sonoff Led web page
* Reduced root webpage size by 31%
Expand Down
22 changes: 16 additions & 6 deletions sonoff/sonoff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

//#define ALLOW_MIGRATE_TO_V3
#ifdef ALLOW_MIGRATE_TO_V3
#define VERSION 0x03091900 // 3.9.25
#define VERSION 0x03091A00 // 3.9.26
#else
#define VERSION 0x04000200 // 4.0.2
#define VERSION 0x04000300 // 4.0.3
#endif // ALLOW_MIGRATE_TO_V3

enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL};
Expand Down Expand Up @@ -890,7 +890,7 @@ void mqttDataCb(char* topic, byte* data, unsigned int data_len)
else if (!strcmp(type,"MODULES")) {
snprintf_P(svalue, sizeof(svalue), PSTR("{\"Modules1\":\""), svalue);
byte jsflg = 0;
for (byte i = 0; i < 11; i++) {
for (byte i = 0; i < MAXMODULE /2; i++) {
if (jsflg) snprintf_P(svalue, sizeof(svalue), PSTR("%s, "), svalue);
jsflg = 1;
snprintf_P(stemp1, sizeof(stemp1), modules[i].name);
Expand All @@ -900,7 +900,7 @@ void mqttDataCb(char* topic, byte* data, unsigned int data_len)
mqtt_publish_topic_P(0, PSTR("RESULT"), svalue);
snprintf_P(svalue, sizeof(svalue), PSTR("{\"Modules2\":\""), svalue);
jsflg = 0;
for (byte i = 11; i < MAXMODULE; i++) {
for (byte i = MAXMODULE /2; i < MAXMODULE; i++) {
if (jsflg) snprintf_P(svalue, sizeof(svalue), PSTR("%s, "), svalue);
jsflg = 1;
snprintf_P(stemp1, sizeof(stemp1), modules[i].name);
Expand Down Expand Up @@ -935,9 +935,19 @@ void mqttDataCb(char* topic, byte* data, unsigned int data_len)
}
}
else if (!strcmp(type,"GPIOS")) {
snprintf_P(svalue, sizeof(svalue), PSTR("{\"GPIOs\":\""), svalue);
snprintf_P(svalue, sizeof(svalue), PSTR("{\"GPIOs1\":\""), svalue);
byte jsflg = 0;
for (byte i = 0; i < GPIO_SENSOR_END; i++) {
for (byte i = 0; i < GPIO_SENSOR_END /2; i++) {
if (jsflg) snprintf_P(svalue, sizeof(svalue), PSTR("%s, "), svalue);
jsflg = 1;
snprintf_P(stemp1, sizeof(stemp1), sensors[i]);
snprintf_P(svalue, sizeof(svalue), PSTR("%s%s (%d)"), svalue, stemp1, i);
}
snprintf_P(svalue, sizeof(svalue), PSTR("%s\"}"), svalue);
mqtt_publish_topic_P(0, PSTR("RESULT"), svalue);
snprintf_P(svalue, sizeof(svalue), PSTR("{\"GPIOs2\":\""), svalue);
jsflg = 0;
for (byte i = GPIO_SENSOR_END /2; i < GPIO_SENSOR_END; i++) {
if (jsflg) snprintf_P(svalue, sizeof(svalue), PSTR("%s, "), svalue);
jsflg = 1;
snprintf_P(stemp1, sizeof(stemp1), sensors[i]);
Expand Down
Loading

0 comments on commit 59bb20d

Please sign in to comment.