Esphome on esp8266-07s

Hey everyone,

i currently trying to flash a custom fw on a growatt Wifi stick (Link) to get rid of the growatt cloud and have up to date information’s in HA.
The construction of the stick is rather simple:
An ESP8266 07s connected to a I2C real time clock, a USB Serial converter, some led’s and a voltage regulator from 5V to 3.3V.

Real time clock: NXP 8563T
USB Serial converter: xr21v1410

After removing two 0Ohm resistors between the ESP TX/RX Lines and the USB Serial converter I was able to dump the original FW and could Upload a small test FW from esphome:

esphome:
  name: "test"
  platform: ESP8266
  board: esp07

logger:
  level: DEBUG
  baud_rate: 9600

wifi:
  ssid: MY-WIFI-SSID
  password:  MY-WIFI-PASSWORD

ota:
  password: "test1234"

The upload and hash verifying went thru successfully. But after a reset of the ESP nothing happened.
On the serial console on baud rate 38400 I saw the following message:

ets Jan 8 2013,rst cause:2, boot mode:(3,0)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
sy
ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
sy
ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
sy

mpfff… It seems that the bootloader can not find the start address so I flashed back the original FW and saw the following on boot:

ets Jan 8 2013,rst cause:2, boot mode:(3,0)

load 0x40100000, len 2408, room 16
tail 8
chksum 0xe5
load 0x3ffe8000, len 776, room 0
tail 8
chksum 0x84
load 0x3ffe8310, len 632, room 0
tail 8
chksum 0xd8
csum 0xd8

2nd boot version : 1.6
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

OS SDK ver: 2.0.0(e271380) compiled @ Mar 30 2018 18:54:06

So here everything is fine. The first thing that what caught my eye is the SPI Mode and Flash Size.
I tried to override these setting with the following configurations (As described in the documentation: here and here):

esphome:
  name: "test"
  platform: ESP8266
  board: esp07
  platformio_options:
    board_build.flash_mode: qio
    board_build.f_flash: 40000000L

logger:
  level: DEBUG
  baud_rate: 9600

wifi:
  ssid: MY-WIFI-SSID
  password:  MY-WIFI-PASSWORD

ota:
  password: "test1234"

after compiling and flashing it I got the error message

system param error, use last saved param!

on boot.

After some googleing around I have found this (now closed) Issue: ESP-07 flash configuration not correct? · Issue #1638 · esphome/issues · GitHub
In this issue it is stated that the ESP8266 07 has 1MB of flash and the ESP8266 07S 4MB of flash and i am using the 07 in my configuration. So something is odd there.

After listing all boards with the prefix “esp07” in the ~/.platformio/platforms/[email protected]/boards/ directory I have only found the 4MB version:

6171003 4 -rw-r–r-- 1 tom tom 781 Feb 3 22:00 /home/tom/.platformio/platforms/[email protected]/boards/esp07.json

Ok then. It seems that i am not running the bleeding edge version of PlatformIO. Fine for me. Everything seems to match. Even “esptool.py flash_id” reports back:

Manufacturer: 20
Device: 4016
Detected flash size: 4MB

But why can’t I get the esp to boot and why does the status message of the original FW say

SPI Flash Size & Map: 32Mbit(512KB+512KB)

??

The Datasheet of the flash claims that it as a size of 64MB (Link).

Do anybody has an idea was going on here?

Update:
I just build the “Hello World” example from the RTOS SDK with the espressif toolchain and uploaded it with success. So the HW is alright.
As soon as I flash a program build with platformIO the ESP crashes. It seems to me that it is a problem with the Arduino framework.

Hi audacity363, this project has a great potential, have you had any success so far?

Check this link for working power generation output
https://community.home-assistant.io/t/esphome-modbus-growatt-shinewifi-s/369171/34

Heads up, the easiest way to make this work is to desolder the esp 07 and put in an esp 12f that you’ve programmed with a programmer. Works perfectly and is a better chip for esphome anyhow and costs like $1.50 each.

I don’t know if this helps, but Expressif says to use esp07s in PlatformIO.

Different pinouts.

ESP-07S Pinout

That’s not correct. The 07 and 12F are identical pin outs. The 12F has additional pin outs on the bottom that you don’t need to worry about.

And I know this for a fact because it works flawlessly and I traced everything.

Flashing this pissed me off so i knicked the aerial socket of it and soldered it onto a nodeMCU8266 and then threw this little shit away!