Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plain esp-01 and esp-12x to sonoff_template #1220

Closed
MatzeJoerling opened this issue Nov 19, 2017 · 13 comments
Closed

Add plain esp-01 and esp-12x to sonoff_template #1220

MatzeJoerling opened this issue Nov 19, 2017 · 13 comments
Labels
stale Action - Issue left behind - Used by the BOT to call for attention

Comments

@MatzeJoerling
Copy link

Hi,

Feature Request:
im setting up a bunch of esp-01 and esp-12 modules and it would be great to have them as module type in sonoff_template .
Is that possible?

regards Matze

@arendst
Copy link
Owner

arendst commented Nov 19, 2017

esp-01 with 0.5 M flash won't work.
esp-12 is wemos and is available out of the box.

@MatzeJoerling
Copy link
Author

esp-01 has 1M flash, have it running (i also soldered a 4M on esp-01 for testing :-) )
wemos, ok , but would be nice to have esp-12 shown...
tnx for answer

@KPK75
Copy link

KPK75 commented Nov 30, 2017

Just modify sonoff_template.h
Some ESP-01 ( e.g. with black PCB from Robotdyn ) have 1M flash. Also "ESP-01S" have 1M.

@benzino77
Copy link

The black modules has 1M flash (AFAIK). OTA works fine.
@arendst maybe you can add native support for this module?

...
// Supported hardware modules
enum SupportedModules {
  SONOFF_BASIC,
  SONOFF_RF,
  SONOFF_SV,
  SONOFF_TH,
  SONOFF_DUAL,
...
  SONOFF_DUAL_R2,
  ESP_01,
  MAXMODULE };

then

const uint8_t kNiceList[MAXMODULE] PROGMEM = {
  SONOFF_BASIC,
  SONOFF_RF,
  SONOFF_TH,
  SONOFF_DUAL,
...
  WEMOS,
  WITTY,
  ESP_01
};

and

const mytmplt kModules[MAXMODULE] PROGMEM = {
  { "Sonoff Basic",    // Sonoff Basic (ESP8266)
     GPIO_KEY1,        // GPIO00 Button
...
  { "ESP 01",  // Sonoff Dual R2 (ESP8285)
     GPIO_USER,        // GPIO00 Button 0 on header (0 = On, 1 = Off)
     GPIO_USER,        // GPIO01 Serial RXD and Optional sensor
     GPIO_USER,
     GPIO_USER,        // GPIO03 Serial TXD and Optional sensor
     0,
     0,        // GPIO05 Relay 2 (0 = Off, 1 = On)
     0, 0, 0,          // Flash connection
     0,        // GPIO09 Button 1 on header (0 = On, 1 = Off)
     0,        // GPIO10 Button on casing
     0,                // Flash connection
     0,        // GPIO12 Relay 1 (0 = Off, 1 = On)
     0,    // GPIO13 Blue Led (0 = On, 1 = Off)
     0, 0, 0, 0
  }
};

Should do the job I think.

@stoehrmark
Copy link

DIY SONOFF using
ESP-01 (black 1M), Sonoff-Tasmota 5.10.0e and above modifications (@benzino77 Thank You)
All works perfectly including OTA

Memory Info after uploading. From "Information" Page
Flash Size 1024kB
Program Flash Size 1024kB
Program Size 445kB
Free Program Space 556kB
Free Memory 27kB

@arendst this would make a good addition for DIY or more advanced builds.

https://photos.app.goo.gl/mV66qkgRs6KsL4RE3

Thank you for the great firmware!!!!

@davidelang
Copy link
Collaborator

davidelang commented Jan 11, 2018 via email

@FanLin-ffms
Copy link

The WeMos is a nice module but it is a fat bumblebee comparing the ESP-01.

@davidelang
Copy link
Collaborator

davidelang commented Jan 14, 2018 via email

@stoehrmark
Copy link

I agree that the WeMos setting will work perfectly for the ESP-01. But for a new person, this may be confusing. There are a lot of people getting into Home Automation that do not have a full understanding of what they are doing. Adding the ESP-01 to the list will just improve the ease of use of the firmware. The easier the better.

Once again Thank You for all your hard work on this project.

@davidelang
Copy link
Collaborator

davidelang commented Jan 14, 2018 via email

arendst added a commit that referenced this issue Jan 18, 2018
5.11.1c
 * Make command color parameter input less strict to ease Hass
support
 * Add ColorTemperature to light status message
 * Change
PubSubClient.h define MQTT_MAX_PACKET_SIZE from 512 to 1000 for Hass
support
 * Make define MESSZ dependent on PubSubClient.h define
MQTT_MAX_PACKET_SIZE
 * Fix logging line length around 400 characters
 *
Change module name Wemos D1 mini into Generic (#1220)
 * Revert HTML
change from width=100% to style=width:100% supporting HTML5 (#1358)
 *
Add experimental (still Hass python exceptions) Home Assistant Discovery
for switch and light to be enabled by command SetOption19 1 (#1534)
 *
Updated French Translation (#1561)
 * Fix DS18B20 temperature JSON
decimal dot (#1561)
 * Add Spanish language file (#1589)
 * Update
Italian Language file (#1594)
 * Consolidate WIFI_MANAGER_SEC into
WIFI_CONFIG_SEC (#1616)
 * Fix Energy JSON message (#1621)
arendst added a commit that referenced this issue Feb 9, 2018
5.12.0 20180209
* Change library PubSubClient.h define MQTT_MAX_PACKET_SIZE from 512 to
1000 for Home Assistant  support
* Change relation of define MESSZ being dependent on PubSubClient.h
define MQTT_MAX_PACKET_SIZE
* Change command color parameter input checks to less strict for Home
Assistant support
* Change command Ina219Mode into command Sensor13
* Change commands HlwPCal, HlwUCal and HlwICal to PowerCal, VoltageCal
and CurrentCal to be used for both Pow and S31 calibration
* Change commands HlwPSet, HlwUSet and HlwISet to PowerSet, VoltageSet
and CurrentSet to be used for both Pow and S31 calibration
* Change uptime from hour to second resulting in a display of
123T13:45:21 where 123 is days
* Change module name Wemos D1 mini into Generic (#1220)
* Change HTML from width=100% to style=width:100% supporting HTML5
(#1358)
* Change OSWATCH_RESET_TIME (Blocked loop) from 30 to 120 seconds to
allow slow networks (#1556)
* Change WIFI_MANAGER_SEC into WIFI_CONFIG_SEC (#1616)
* Change function pointers code to save code space and memory (#1683)
* Change webserver argument processing gaining 5k code space (#1705)
* Change weblog memory usage (#1730, #1793, #1819)
* Update TasmotaSerial library to 1.1.0
* Update language files Italian (#1594), Dutch (#1723) and Spanish
(#1722)
* Fix Non-English JSON temperature unit attachement
* Fix Arilux RF induced exception by moving interrupt handler to iram on
non ESP8266/Arduino lib v2.3.0
* Fix truncated command names and wrong response for DomoticzSwitchIdx
(#1571)
* Fix %-sign issue as printf escape character in Humidity and Sonoff SC
(#1579)
* Fix DS18B20 temperature JSON decimal dot (#1561)
* Fix Energy JSON message (#1621)
* Fix IRSend parameter translation (#1636)
* Fix TSL2561 device detection (#1644, #1825)
* Fix BME680 teleperiod resistance measuring (#1647)
* Fix Energy Monitoring Energy Today and Energy Total reading after
restart (#1648)
* Fix IRReceive Data value (#1663)
* Fix Energy Monitoring Energy Period roll-over (#1688)
* Fix compiler warnings (#1774)
* Fix command PWM response if no PWM channel is configured (#1783)
* Add locale Decimal Separator to Web sensor page
* Add ColorTemperature to light status message
* Add command PowerOnState option 5 which inverts PulseTime and allows
for delayed always on after power on
* Add OtaMagic two step Web server OTA upgrade using filename-minimal
image if OTA free space is too small
* Add support for PMS5003 and PMS7003 particle concentration sensor
* Add command SetOption21 1 to allow Energy Monitoring when power is off
on Sonoff Pow and Sonoff S31 (#1420)
* Add Chinese language file (#1551)
* Add French language file (#1561)
* Add Spanish language file (#1589)
* Add HTTP Allow Cross Origin removed from ESP8266/Arduino lib v2.4.0
(#1572)
* Add Home Assistant MQTT Discovery for switch and light to be enabled
by command SetOption19 1 (#1534) or define
HOME_ASSISTANT_DISCOVERY_ENABLE in user_config.h (#1685)
* Add command State to retrieve device state information (same data as
teleperiod state and status 11 in slightly different JSON format)
* Add optional login to Webserver AP mode (#1587, #1635)
* Add command Sensor15 2 to start MHZ19(B) Zero Point Calibration
(#1643)
* Add support for Sonoff S31 Smart Socket with Power Consumption
Detection (#1626)
* Add command SetOption20 to allow update of Dimmer/Color/Ct without
turning power on (#1719, #1741)
* Add NTP sync time slot based on chip id (#1773)
* Add cursor pointer to web button (#1836)
@stale
Copy link

stale bot commented May 14, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label May 14, 2018
@stale
Copy link

stale bot commented May 28, 2018

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

@stale stale bot closed this as completed May 28, 2018
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.11.1c
 * Make command color parameter input less strict to ease Hass
support
 * Add ColorTemperature to light status message
 * Change
PubSubClient.h define MQTT_MAX_PACKET_SIZE from 512 to 1000 for Hass
support
 * Make define MESSZ dependent on PubSubClient.h define
MQTT_MAX_PACKET_SIZE
 * Fix logging line length around 400 characters
 *
Change module name Wemos D1 mini into Generic (arendst#1220)
 * Revert HTML
change from width=100% to style=width:100% supporting HTML5 (arendst#1358)
 *
Add experimental (still Hass python exceptions) Home Assistant Discovery
for switch and light to be enabled by command SetOption19 1 (arendst#1534)
 *
Updated French Translation (arendst#1561)
 * Fix DS18B20 temperature JSON
decimal dot (arendst#1561)
 * Add Spanish language file (arendst#1589)
 * Update
Italian Language file (arendst#1594)
 * Consolidate WIFI_MANAGER_SEC into
WIFI_CONFIG_SEC (arendst#1616)
 * Fix Energy JSON message (arendst#1621)
@alexandre-shima
Copy link

@stoehrmark I'm having issues apparently with the same device, an ESP-01 with 1 MB (black board).
Are you using exactly the same text for the changes on the sonoff_template.h file as shown by @benzino77?
I'm getting this error while compiling:
sonoff_template.h:1795:1: error: too many initializers for 'const mytmplt {aka const MYTMPLT}'
If I use the "Sonoff Basic" as a template, changing the first 4 initializers to GPIO_USER and all the rest to 0, the compilation works fine, but the device doesn't work after uploading the code.
Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Action - Issue left behind - Used by the BOT to call for attention
Projects
None yet
Development

No branches or pull requests

8 participants