Sonoff T0EU2C support

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
vdanjean
Normal user
Posts: 2
Joined: 11 Jan 2020, 15:35

Sonoff T0EU2C support

#1 Post by vdanjean » 11 Jan 2020, 16:28

Hi,

I recently discovered Sonoff products and the easyesp firmware (no way for me to send my data to a remote server).

I bought two wall plugs where I solder wires to VCC/GND/TX/RX and upload the current firmware with a command such as:

Code: Select all

esptool --chip esp8266 --port /dev/ttyUSB0 --baud 115200 write_flash -fm dio -fs 8MB -ff 26m  0x00000 ESP_Easy_mega-20191208_normal_ESP8266_1M.bin
And I configure it (found the new AP and setup wifi) and set it up with openhab. No problem, they work perfectly :D Many thanks for your work on this firmware.

Then, I tried to do the same with the third product I bought: a Sonoff T0EU2C. On the PCB, I've the following references:
T1EU TOUCH v1.0
2018.10.03
With the help to this webpage https://tasmota.github.io/docs/#/device ... 2018-10-03, I found the information required to put the device in flash mode (ie connecting GND from J1 and TP2/GPIO0 at boot time): my hardware seems really similar to the SONOFF T1 EU 3CH 2018-10-03 (with only two touches instead of three). And indeed, with this, I've been able to read the mac info and upload new firmware:

Code: Select all

$ esptool --chip auto --port /dev/ttyUSB0 --baud 115200 read_mac
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
MAC: d8:f1:5b:XX:XX:XX
Enabling default SPI flash mode...
MAC: d8:f1:5b:XX:XX:XX
Hard resetting via RTS pin...

$ esptool --chip auto --port /dev/ttyUSB0 --baud 115200 write_flash -fm dio -fs 8MB -ff 26m  0x00000 ESPEasy_mega-20191208/bin/ESP_Easy_mega-20191208_normal_ESP8285_1M.bin
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting...
Chip is ESP8285
Features: WiFi, Embedded Flash
MAC: d8:f1:5b:XX:XX:XX
Enabling default SPI flash mode...
Configuring flash size...
Erasing flash...
Flash params set to 0x0281
Took 7.14s to erase flash block
Wrote 851968 bytes at 0x00000000 in 93.1 seconds (73.2 kbit/s)...

Leaving...
Hard resetting via RTS pin...
However, despite the flashing seeming correct, I never observed the AP coming after reboot (without the shortcut between GND and GPIO0 of course). The boot is indeed different (I cannot execute read_mac with esptool as expected) but no AP.
I tried lots of different firmwares (blank_1M, different ESPEasy releases (20181112, 20191130, 20191208, v2.0.0-dev12) for ESP8285 but also ESP8266, normal test and dev variants when they exist, and also tasmota-FR.bin from there website (but probably compiled for 8266 and not 8285)). I boot the hardware with the USB-serial power (as for when flashing) or with the (normal) 220V power (with the other part of the device). I never see any AP.

So, I've some questions:
- is there someone that succeed in running this exact module with espeasy?
- is there some way to know if some code is running (to get a console ?) ? I tried (when powered by the serial cable) to read the serial line after the normal boot: I never see anything (but I'm not sure I setup the serial line correctly: speed, parity, ...)
- is there a way to know if my module is broken? It seemed to work (AP, reaction to touch, ...)) with the original firmware but I perhaps broke it when I solder the connector for flashing.
- I'm trying to recompile the firmware myself but did not succeed yet. I installed PlatformIO-cli (not Atome not IDE) but do not find how to start the build. I will try with an IDE if I do not find how to do this from the CLI (any advises ?)

Regards,
Vincent

TD-er
Core team member
Posts: 3129
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff T0EU2C support

#2 Post by TD-er » 11 Jan 2020, 20:48

After flashing (and rebooting the ESP) you can also connect some serial terminal and listen to the same pins you used to flash the node.
It should show at least some log when booting until it got an IP address.
So you should be able to see what is happening there.
If it does seem to boot normally, you could also try sending the commands to set the WiFi credentials (don't forget to send the save command)

But given it does not start the AP mode, I guess it is not booting well.

User avatar
ThomasB
Normal user
Posts: 715
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Sonoff T0EU2C support

#3 Post by ThomasB » 12 Jan 2020, 20:21

Doesn't appear that anyone on this forum has discussed this module. So maybe you are the first to try it out on ESPEasy.

TD-er's idea to sniff the serial log is the best place to start debugging.

BTW, if the Sonoff is being powered by the USB connection then maybe that does not provide enough current to operate the WiFi hardware. So remove the USB, install everything back in the plastic case, and connect to mains power. Maybe that will allow AP mode to appear.

- Thomas

TD-er
Core team member
Posts: 3129
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff T0EU2C support

#4 Post by TD-er » 12 Jan 2020, 20:24

And better tell it too often instead of not often enough.
Do not leave it connected to the PC and connected to mains power.

Also some Sonoff devices in the past were a bit picky on connecting to WiFi when connected to USB (or mains power forgot which one ;) )
So only one of both could be used to let WiFi work.

vdanjean
Normal user
Posts: 2
Joined: 11 Jan 2020, 15:35

Re: Sonoff T0EU2C support

#5 Post by vdanjean » 12 Jan 2020, 22:52

I checked with one of my two wall plugs and indeed see some messages on the serial line.

Then, I retried with the Sonoff T0EU2C but I do not see anything at all. Any idea ? Anything to try ?

For info, I reflashed ESP_Easy_mega-20191208_normal_ESP8285_1M.bin before doing the try.
And when I'm trying to read the serial line on boot, I cannot use esptool to read_mac or write the flash (normal, in this case, I do not boot with the GPIO0/GND connection)

ThomasB: I also tried with the main power (initially, I only did this) but do not see any AP (of course, I do not have access to the serial line in this case)


Regards
Vincent

User avatar
ThomasB
Normal user
Posts: 715
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Sonoff T0EU2C support

#6 Post by ThomasB » 13 Jan 2020, 02:34

That does not sound good. It appears that the ESPEasy code is not running.

But if the CPU is alive, the ESP8xx boot ROM should log some messages while booting (for early stage crash debugging). These messages are at 74880 baud (versus ESPEasy's 115.2K baud).
Some details:
https://github.com/espressif/esptool/wi ... ot-ROM-Log

If you don't see the Early stage crash log (74880 baud) then the ESP chip is in trouble or the serial connection has an issue.

- Thomas

Olivier92
Normal user
Posts: 1
Joined: 04 Jun 2020, 23:56

Re: Sonoff T0EU2C support

#7 Post by Olivier92 » 05 Jun 2020, 00:03

Hi everyone,

@Vincent, did you manage to have your T1EU Touch working?
I am strugling to flash mine.
I think I manage to put it in flash mode by grounding GPIO0 because the wifi led is not blinking (it is if not grounding gpio0 while booting) but I do not manage to have any flashing software connecting to the board.
Can you tell me how you did it?

Thanks

Olivier

runner1221
Normal user
Posts: 1
Joined: 27 Jul 2020, 22:30

Re: Sonoff T0EU2C support

#8 Post by runner1221 » 27 Jul 2020, 22:45

Hi all, hoping someone can help.

It seems I have encountered the same problem like Oliver - my T1EU2C switch (2018.10.03) is in flash mode, however I am not able to flash the device. Every time I get message "Failed to connect to ESP".

Did anyone had the same problem? And did you manage to solved it?

Thanks,

Adam

User avatar
Ath
Normal user
Posts: 183
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Sonoff T0EU2C support

#9 Post by Ath » 28 Jul 2020, 08:03

Any time sofar that I encountered issues like that, my wiring was broken (I tend to use patch wires for that), so you might want to check or replace your wiring.

dov
Normal user
Posts: 2
Joined: 30 Jul 2020, 21:36

Re: Sonoff T0EU2C support

#10 Post by dov » 30 Jul 2020, 21:48

I found this page after getting a similar experience with a new Sonoff TX T2EU1C switch that arrived today from China. I wanted to put Micropython on it, which is my prefered software that I use for most of my esp8266 and esp32 chips around the house.

I soldered wires to G,VCC,TXD, and RXD. By temorarily connecting the pad named TP2 GPIO0 on the board to ground while powering up the board, I was subsequently able both to erase the old firmware and to upload the Micropython firmware through epstool. During upload and verification everything seemed fine.

But after booting the board again I fail to connect to the micropython repl. Indeed it seems like it is not running.

I tested my wiring setup with a bare ESP01 chip, and it works just fine, so something is going on with the Sonoff switch.

Has anybody else been more successful. With any alternate firmware?

sdio4lor
Normal user
Posts: 1
Joined: 29 Aug 2020, 15:58

Re: Sonoff T0EU2C support

#11 Post by sdio4lor » 29 Aug 2020, 16:04

I faced this problem too.
The device is flashing, but does not work

It started working only when I flashed the device in "dout" mode

esptool ... -fm dout ...

dov
Normal user
Posts: 2
Joined: 30 Jul 2020, 21:36

Re: Sonoff T0EU2C support

#12 Post by dov » 29 Aug 2020, 20:46

Thanks! --flash_mode=dout did the trick! I now got the MicroPython prompt! :-)

User avatar
Grumpf
Normal user
Posts: 46
Joined: 05 May 2017, 23:45
Location: Namur
Contact:

Re: Sonoff T0EU2C support

#13 Post by Grumpf » 01 Sep 2020, 18:01

Was rummaging in project boxes today to clean a bit and found a T0EU2C in the box. I tried to flash it using the latest Mega with flasher tool. Didn't work until I tried Esp_easy_mega_20200829_normal_alt_wifi_ESP8266_1M.bin.

GPIO0 from back pad to gnd, that's it.

Now I had to use those rules to make it work :

Code: Select all

 on touch1#state do
  if [touch1#state]=1
   gpio,12,1
  else
   gpio,12,0
  endif
 endon 

 on touch2#state do
  if [touch2#state]=1
   gpio,5,1
  else
   gpio,5,0
  endif
 endon 
Devices being touch1 = GPIO0, relay1 GPIO12 then 9 & 5 for right button. Push button active high for the touch#.
On domoticz, simple virtual switch with On action like http://172.19.0.226/control?cmd=GPIO,5,1 dunno the Mqtt equivalent.

Oh, and I had to disable I²C & Serial to free GPIOs normaly reserved.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests