Revert "v5.10.0a - Fixes ADS1115 and Sonoff Dual R2"

This reverts commit 73547c8bd7.
This commit is contained in:
arendst 2017-12-02 12:38:50 +01:00
parent 73547c8bd7
commit 5731c975e4
7 changed files with 35 additions and 100 deletions

View File

@ -1,62 +0,0 @@
## 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 **5.10.0a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
### ATTENTION All versions
Only Flash Mode DOUT is supported. Do not use Flash Mode DIO / QIO / QOUT as it might seem to brick your device.
See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips) for background information.
### ATTENTION Version 5 and up
These versions use a new linker script to free flash memory for future code additions. It moves the settings from Spiffs to Eeprom. If you compile your own firmware download the new linker to your IDE or Platformio base folder. See [Wiki > Prerequisite](https://github.com/arendst/Sonoff-Tasmota/wiki/Prerequisite).
Best practice to implement is:
- Open the webpage to your device
- Perform option ``Backup Configuration``
- Upgrade new firmware using ``Firmware upgrade``
- If configuration conversion fails keep the webpage open and perform ``Restore Configuration``
You should now have a device with 32k more code memory to play with.
### Version Information
- Sonoff-Tasmota provides all (Sonoff) modules in one file and starts with module Sonoff Basic.
- Once uploaded select module using the configuration webpage or the commands ```Modules``` and ```Module```.
- After reboot select config menu again or use commands ```GPIOs``` and ```GPIO``` to change GPIO with desired sensor.
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonoffbasic.jpg" width="250" align="right" />
See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki) for more information.<br />
See [Community](https://groups.google.com/d/forum/sonoffusers) for forum and more user experience.
The following devices are supported:
- [iTead Sonoff Basic](https://www.itead.cc/smart-home/sonoff-wifi-wireless-switch-1.html)
- [iTead Sonoff RF](https://www.itead.cc/smart-home/sonoff-rf.html)
- [iTead Sonoff SV](https://www.itead.cc/smart-home/sonoff-sv.html)<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonoff_th.jpg" width="250" align="right" />
- [iTead Sonoff TH10/TH16 with temperature sensor](https://www.itead.cc/smart-home/sonoff-th.html)
- [iTead Sonoff Dual (R2)](https://www.itead.cc/smart-home/sonoff-dual.html)
- [iTead Sonoff Pow](https://www.itead.cc/smart-home/sonoff-pow.html)
- [iTead Sonoff 4CH](https://www.itead.cc/smart-home/sonoff-4ch.html)
- [iTead Sonoff 4CH Pro](https://www.itead.cc/smart-home/sonoff-4ch-pro.html)
- [iTead S20 Smart Socket](https://www.itead.cc/smart-socket.html)
- [iTead Slampher](https://www.itead.cc/slampher.html)
- [iTead Sonoff Touch](https://www.itead.cc/sonoff-touch.html)
- [iTead Sonoff T1](https://www.itead.cc/sonoff-t1.html)
- [iTead Sonoff SC](https://www.itead.cc/sonoff-sc.html)
- [iTead Sonoff Led](https://www.itead.cc/sonoff-led.html)<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonoff4ch.jpg" height="250" align="right" />
- [iTead Sonoff BN-SZ01 Ceiling Led](https://www.itead.cc/bn-sz01.html)
- [iTead Sonoff B1](https://www.itead.cc/sonoff-b1.html)
- [iTead Sonoff RF Bridge 433](https://www.itead.cc/sonoff-rf-bridge-433.html)
- [iTead Sonoff Dev](https://www.itead.cc/sonoff-dev.html)
- [iTead 1 Channel Switch 5V / 12V](https://www.itead.cc/smart-home/inching-self-locking-wifi-wireless-switch.html)
- [iTead Motor Clockwise/Anticlockwise](https://www.itead.cc/smart-home/motor-reversing-wifi-wireless-switch.html)
- [Electrodragon IoT Relay Board](http://www.electrodragon.com/product/wifi-iot-relay-board-based-esp8266/)
- [AI Light or any my9291 compatible RGBW LED](http://www.ebay.com/itm/172644855726)
- MagicHome and AriLux AL-LC01 and AL-LC11
### License
This program is licensed under GPL-3.0

View File

@ -1,7 +1,5 @@
/* 5.10.0a
* Add (experimental) support for sensor SHT3x
* Change ADS1115 default voltage range from +/-2V to +/-4V (#1289)
* Add multipress support and more user configurable options to Sonoff Dual R2 (#1291)
*
* 5.10.0 20171201
* Upgrade library ArduinoJson to 5.11.2

View File

@ -2008,7 +2008,7 @@ void ButtonHandler()
if (!restart_flag && !holdbutton[i] && (multipress[i] > 0) && (multipress[i] < MAX_BUTTON_COMMANDS +3)) {
boolean single_press = false;
if (multipress[i] < 3) { // Single or Double press
if ((SONOFF_DUAL_R2 == Settings.module) || (SONOFF_DUAL == Settings.module) || (CH4 == Settings.module)) {
if ((SONOFF_DUAL == Settings.module) || (CH4 == Settings.module)) {
single_press = true;
} else {
single_press = (Settings.flag.button_swap +1 == multipress[i]);

View File

@ -765,15 +765,15 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
0, 0
},
{ "Sonoff Dual R2", // Sonoff Dual R2 (ESP8285)
GPIO_USER, // GPIO00 Button 0 on header (0 = On, 1 = Off)
GPIO_SWT1, // GPIO00 Button 1 on header
GPIO_USER, // GPIO01 Serial RXD and Optional sensor
0,
GPIO_USER, // GPIO03 Serial TXD and Optional sensor
0,
GPIO_REL2, // GPIO05 Relay 2 (0 = Off, 1 = On)
0, 0, 0, // Flash connection
GPIO_USER, // GPIO09 Button 1 on header (0 = On, 1 = Off)
GPIO_KEY1, // GPIO10 Button on casing
GPIO_SWT2, // GPIO09 Button 2 on header
GPIO_KEY1, // GPIO10 Button 3 on casing
0, // Flash connection
GPIO_REL1, // GPIO12 Relay 1 (0 = Off, 1 = On)
GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)

View File

@ -33,8 +33,8 @@
* ADS1115
* -------
* ADS1115_REG_CONFIG_PGA_6_144V // 2/3x gain +/- 6.144V 1 bit = 0.1875mV
* ADS1115_REG_CONFIG_PGA_4_096V // 1x gain +/- 4.096V 1 bit = 0.125mV (default)
* ADS1115_REG_CONFIG_PGA_2_048V // 2x gain +/- 2.048V 1 bit = 0.0625mV
* ADS1115_REG_CONFIG_PGA_4_096V // 1x gain +/- 4.096V 1 bit = 0.125mV
* ADS1115_REG_CONFIG_PGA_2_048V // 2x gain +/- 2.048V 1 bit = 0.0625mV (default)
* ADS1115_REG_CONFIG_PGA_1_024V // 4x gain +/- 1.024V 1 bit = 0.03125mV
* ADS1115_REG_CONFIG_PGA_0_512V // 8x gain +/- 0.512V 1 bit = 0.015625mV
* ADS1115_REG_CONFIG_PGA_0_256V // 16x gain +/- 0.256V 1 bit = 0.0078125mV
@ -126,7 +126,7 @@ void Ads1115StartComparator(uint8_t channel, uint16_t mode)
uint16_t config = mode |
ADS1115_REG_CONFIG_CQUE_NONE | // Comparator enabled and asserts on 1 match
ADS1115_REG_CONFIG_CLAT_NONLAT | // Non Latching mode
ADS1115_REG_CONFIG_PGA_4_096V | // ADC Input voltage range (Gain)
ADS1115_REG_CONFIG_PGA_2_048V | // ADC Input voltage range (Gain)
ADS1115_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val)
ADS1115_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val)
ADS1115_REG_CONFIG_DR_6000SPS; // 6000 samples per second

View File

@ -84,7 +84,7 @@ void Ads1115Detect()
ADS1115 adc0(ads1115_address);
if (adc0.testConnection()) {
adc0.initialize();
adc0.setGain(ADS1115_PGA_4P096); // Set the gain (PGA) +/-4.096V
adc0.setGain(ADS1115_PGA_2P048); // Set the gain (PGA) +/-4.096V
adc0.setRate(ADS1115_RATE_860);
adc0.setMode(ADS1115_MODE_CONTINUOUS);
ads1115_type = 1;

View File

@ -1,7 +1,7 @@
/*
xsns_14_sht3x.ino - SHT3X temperature and humidity sensor support for Sonoff-Tasmota
xsns_15SHT3X.ino - WeMos SHT30 Shield
Copyright (C) 2017 Theo Arends
Copyright (C) 2017 Palich2000
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
@ -20,11 +20,10 @@
#ifdef USE_I2C
#ifdef USE_SHT3X
/*********************************************************************************************\
* SHT3X - Temperature and Humidy
* WeMos SHT30 Shield
* https://wiki.wemos.cc/products:d1_mini_shields:sht30_shield
*
* Required library: none but based on Adafruit Industries SHT31 library
*
* I2C Address: 0x44 or 0x45
* https://github.com/wemos/WEMOS_SHT3x_Arduino_Library
\*********************************************************************************************/
#define SHT3X_ADDR_GND 0x44 // address pin low (GND)