Page 1 of 1

Powstro (sonoff) [multiple trials] - SOLVED

Posted: 15 Jan 2018, 09:34
by NDR008
Hi guys, first post here.
I have used ESP-Easy on a LoLin board.

Yesterday I tried programming a SonOff clone - Powstro.
Unfortunately some ebay sellers are selling it is a re-branded SonOff, but they are actually not.
https://www.aliexpress.com/ios-module_reviews.html

But it indeed does have an ESP8266, but the chip is different from what I have seen so far.
It is an ESP8266-S3:
https://fccid.io/2AKBPESP8266-S3/User-M ... 791.iframe

Tasmota group have been able to flash it:
https://github.com/arendst/Sonoff-Tasmota/issues/1419
Indeed, I have succeeded to flash Tasmota and set it up correctly.

However, whenever I tried to compile ESP Easy and flash it, it seems to work.
But the ESP never boots (or at least I cannot see any wifi activity and nothing seems to be sent over serial).

As of now, I messed up my Arduino setup while trying to make ESP Easy work.
So I will try to resolve that later.

But maybe I can get this problem solving rolling by asking if anyone can figure out what gives?
As you may read, the PowStro has 3 LEDs and a push-button installed.
I wonder if some GPIO is preventing ESP Easy from booting based on its default?

(I am have lwpip header problems - may need help with that later too).

Thanks everyone!

Re: Powstro (sonoff)

Posted: 15 Jan 2018, 12:15
by Shardan
Hello,

it should be possible to flash and use that chip. Due to datasheet it is a ESP8266 with 1 MByte, no additional serial processor chip or something alike.

So the precompiled "1024" binaries should fit that chip.
As it is not specified which flashram type they use it might be necessary to use DOUT mode for flashing.

Regrds
Shardan

Re: Powstro (sonoff)

Posted: 15 Jan 2018, 15:37
by NDR008
Hmmmm, that is how I had my IDE setup.
DOUT
1M

Will re-solder the header and give it a try.

If not, how do I flash a pre-compiled bin in Linux?
Thanks.

For my education, what is DOUT?

Thanks.

Re: Powstro (sonoff)

Posted: 15 Jan 2018, 16:57
by TD-er
DOUT is the slower interface to the flash chip.
See: https://github.com/letscontrolit/ESPEas ... -322781542

Re: Powstro (sonoff)

Posted: 15 Jan 2018, 19:16
by Shardan
NDR008 wrote: 15 Jan 2018, 15:37 Hmmmm, that is how I had my IDE setup.
DOUT
1M

Will re-solder the header and give it a try.

If not, how do I flash a pre-compiled bin in Linux?
Thanks.

For my education, what is DOUT?

Thanks.
Just use a flash tool like ESPtool or one of the many tools that are availlable.
They usually get the name of the binary as a parameter or entry field.

Re: Powstro (sonoff)

Posted: 15 Jan 2018, 21:29
by Zeric
I suggest watching the serial port during boot and see what it says. In my case it showed that the checksum did not match, that clued me in to it being a corrupted write as opposed to some issue with the binary itself. The default baud rate is slower than people typically use. I just used the arduino serial monitor and set the rate to 74880 baud, but any serial terminal program should work as long as it support this less common rate.

On a recent sonoff device I needed to slow down the flash frequency and use DOUT get a good write, DOUT alone didn't seem to do it.

esptool.py --port com3 write_flash --flash_mode dout -ff 20m 0x0 espeasy.bin

Re: Powstro (sonoff)

Posted: 15 Jan 2018, 21:57
by NDR008
In my case I compiled and uploaded tasmota.
So I later tried esp-easy in the exact same setup...

I will try powering it with external power (not the USB TTL supply).
Maybe esp is needing more juice even to boot?

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 05:29
by Zeric
If tasmota is loaded and is working okay using your existing setup then I doubt the flashing setup or power is the issue. The power requirements of espeasy post flashing (before fully configuring in the web browser) shouldn't be much different than a new tasmota install (from what I recall, both just spin up an access point then wait for someone to connect). I use a cheap chinese CH340 USB/serial converter to flash sonoffs all the time for espeasy (and occasionally tasmota) without issue. It boots just fine and I can do the initial configuration through the web browser while it is still powered by the serial converter. I've even left them powered only by the serial converter for days at a time and they have never glitched or gone offline. I don't know your setup so YMMV.
Image

Here is another thing to try...
I've occasionally found that the flash needs to be completely erased before changing firmware. Why this sometimes is required, and other times it's not I've never investigated, maybe someone else knows.

The most sure way I've found to do this is to write a blank bin file that is the same size as the flash chip (explained here http://www.pratikpanda.com/completely-f ... sh-memory/). Providing the write process is working correctly, that will ensure no left overs from the old config interfere with the new one. I've used the 1MB file provided at the bottom of the above article several times on sonoffs that have gone into weird boot loops or other strange behavior to fix them (then of course flashed the desired FW). There is no need to use Espressif flash tool, any flashing software will do such as esptool.exe or esptool.py. Both esptool.exe and esptool.py have erase functions, but it's unclear how thorough they are. I know esptool.exe erase has not fixed issues that were resolved by a writing a blank file.

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 06:46
by NDR008
Similar setup.
Will try again.

Image

Image

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 07:23
by papperone
can you post a picture of top PCB with closeup of ESP8266 module?

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 08:31
by NDR008
Will do so tonight.
But it obviously looks exactly like in the PDF.

In notice many people send these switches back thinking that they are not compatible.
But we should be able to get it working.
I just wonder if the unconventional gpio LEDs is holding it from booting up at all.

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 19:09
by NDR008
First update, so actually there is no device name on the chip:
Image
Image
Image
Image

Unfortunately I broke the switch. :P

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 20:19
by NDR008
What memory size and SPIFF is the minimum I can compile for?

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 20:35
by Shardan
NDR008 wrote: 16 Jan 2018, 20:19 What memory size and SPIFF is the minimum I can compile for?
As mentioned above due to datasheet it is a ESP8266 with
1 MByte of flash.

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 20:39
by NDR008

Re: Powstro (sonoff)

Posted: 16 Jan 2018, 21:14
by NDR008
I gave up for today.

Something seriously wrong with my Arduino setup..
I cannot get TASMOTA to compiled and upload either (even though it is running on this thing already)
It keeps asking me for IRsend.h

So I think I have to figure out what's wrong with my Arduino IDE setup first.

Maybe upgrading to ESP 2.4.0 broke it?

Re: Powstro (sonoff)

Posted: 17 Jan 2018, 00:17
by TD-er
If you're going to use it, don't use it with high currents.

And can you look at the used flash chip? Does it have any labels on the flash chip indicating "PUYA" ?

Re: Powstro (sonoff)

Posted: 17 Jan 2018, 07:23
by NDR008
TD-er wrote: 17 Jan 2018, 00:17 If you're going to use it, don't use it with high currents.

And can you look at the used flash chip? Does it have any labels on the flash chip indicating "PUYA" ?
I couldn't find puya.
Why low current?
I was going to power an Ikea 10W Led e24 bulb.

Re: Powstro (sonoff)

Posted: 17 Jan 2018, 19:42
by TD-er
NDR008 wrote: 17 Jan 2018, 07:23
TD-er wrote: 17 Jan 2018, 00:17 If you're going to use it, don't use it with high currents.

And can you look at the used flash chip? Does it have any labels on the flash chip indicating "PUYA" ?
I couldn't find puya.
Why low current?
I was going to power an Ikea 10W Led e24 bulb.
The PCB's which carry the load are quite thin and not covered with tin.
So when you will try to get like 5 - 10 A through them, their temperature will rise.
10 Watt is fine, but such devices are often sold to be able to handle 10 Amps or more and they simply cannot.

Re: Powstro (sonoff)

Posted: 17 Jan 2018, 21:01
by NDR008
Should I solder some parallel electrical cable?

Re: Powstro (sonoff)

Posted: 17 Jan 2018, 22:09
by Shardan
For a 10W LED it should suffice....
For more it should be enforced.

Re: Powstro (sonoff)

Posted: 17 Jan 2018, 23:38
by Zeric
Agreed, I would never try to run 10A through these, 1-2A should be ok, maybe 200 watts at most (non-inductive load!!). Not only are the traces questionable, I wouldn't trust the tiny relay either.

These are great for home lighting which these days is fairly low power, but they are not for heaters, refrigerators, full size desktop computers, or pretty much anything with a motor - power tools, garage door opener, etc.

Re: Powstro (sonoff)

Posted: 18 Jan 2018, 09:42
by NDR008
I'm safe then, as i only want to use it power single 240V-10Watt LED lamps.

Re: Powstro (sonoff) [multiple trials]

Posted: 19 Jan 2018, 16:38
by NDR008
So I need to re-try to flash myself (I tried again, but I now noticed that my GPIO0 was soldered incorrectly second time around).

Over on the openhab community someone failed to flash it via a linux flashtool, but managed to flash TASMOTA from Arduino (as I did).
From TASMOTA, they made an OTA update of the ESP_EASY.bin (Version 120, 1MB size).
ESP_EASY could then run.
They then tried to OTA the latest ESP_EASY, but that fails.

Re: Powstro (sonoff) [multiple trials]

Posted: 19 Jan 2018, 17:08
by enesbcs
NDR008 wrote: 19 Jan 2018, 16:38 From TASMOTA, they made an OTA update of the ESP_EASY.bin (Version 120, 1MB size).
ESP_EASY could then run.
They then tried to OTA the latest ESP_EASY, but that fails.
I am not familiar with ESPEasy 120, only using Mega versions... but as i know, Tasmota 5.9 did not use SPIFFS, but ESPEasy uses it, so it can be a little problem.
On 1MB module did you use the intermediate ESPEasy OTA binary, or the v120 is small enough to fit in 400k?

Re: Powstro (sonoff) [multiple trials]

Posted: 19 Jan 2018, 17:19
by NDR008
Hmmm, but TASMOTA saves user settings, is that not SPIFF?

Not possible to flash ESP_EASY SPIFF-less anyway?
When I flashed TASMOTA I selected 1M(64K SPIFF).

Re: Powstro (sonoff) [multiple trials]

Posted: 19 Jan 2018, 21:26
by NDR008
I finally got it to work.

I do not know why, but it seems I hard to start the flash within a short window of powering it on:

python esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dout -ff 20m 0x0 ESP_Easy_v2.0-20180116_normal_ESP8266_1024.bin
esptool.py v2.3-dev
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Flash params set to 0x0322
Compressed 574976 bytes to 378527...
Wrote 574976 bytes (378527 compressed) at 0x00000000 in 33.5 seconds (effective 137.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...




When I waited a couple of seconds, this happened:
python esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dout -ff 20m 0x0 ESP_Easy_v2.0-20180116_normal_ESP8266_1024.bin
esptool.py v2.3-dev
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

Re: Powstro (sonoff) [multiple trials]

Posted: 31 Jan 2018, 20:54
by enesbcs
NDR008 wrote: 19 Jan 2018, 17:19 Hmmm, but TASMOTA saves user settings, is that not SPIFF?

Not possible to flash ESP_EASY SPIFF-less anyway?
When I flashed TASMOTA I selected 1M(64K SPIFF).
In the official Arduino compilation FAQ it is clearly stated that: "1M (no SPIFFS)"
https://github.com/arendst/Sonoff-Tasmo ... rduino-IDE
It is also described here:
https://github.com/arendst/Sonoff-Tasmo ... smota-Tips

At ESPEasy i found this on behalf the Mega version:
https://www.letscontrolit.com/wiki/inde ... SPEasyMega
"It will use native SPIFFS support and all older custom flash access routines will be dropped"
I did not found any other documentation about SPIFF usage in ESPEasy.. but
1/ The deployed platformio.ini only contains lines with SPIFFS only setups
2/ And ESPEasy.ino contains the following error message string:
"No (or too small) SPIFFS area..\nSystem Halted\nPlease reflash with 128k SPIFFS minimum!""

So i guess that you are correct and latest ESPEasy versions can not be compiled in SPIFF-less.

Re: Powstro (sonoff) [multiple trials] - SOLVED

Posted: 03 Feb 2018, 08:59
by Zeric
Flaky issues when writing, and odd required timing would qualify, could be related to the power supply. Adding a capacitor can help. Since I last responded on this thread, I was having some flakey writes on a device that was solved by adding a 470uf low voltage cap at the power output of my serial board.