patience4711 / ESP32-read-APS-inverters

MIT License
9 stars 2 forks source link

ESP32 Devkit v4 - did not start #11

Closed ds2k5 closed 10 months ago

ds2k5 commented 10 months ago

Chip info:

$ esptool.py read_mac
esptool.py v4.7-dev
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 08:d1:f9:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
MAC: 08:d1:f9:xx:xx:xx
Hard resetting via RTS pin...

Flashed to ESP32

sudo esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash 0x0 ESP32-ECU_v0-8.bin

Serial Monitor Output

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) invalid header: 0x73617265 invalid header: 0x73617265 invalid header: 0x73617265 invalid header: 0x73617265 invalid header: 0x73617265 invalid header: 0x73617265 invalid header: 0x73617265 ets Jul 29 2019 12:21:46

What did I wrong ?

Building from Source did not work: AsyncEventSource.h missing

WARNING: Category '' in library ESP Insights is not valid. Setting to 'Uncategorized' WARNING: Category '' in library ESP RainMaker is not valid. Setting to 'Uncategorized' WARNING: Category '' in library WiFiProv is not valid. Setting to 'Uncategorized' Build options changed, rebuilding all ESP32-ECU_v0-8:1:10: fatal error: AsyncEventSource.h: No such file or directory

include

      ^~~~~~~~~~~~~~~~~~~~

compilation terminated. exit status 1 AsyncEventSource.h: No such file or directory

patience4711 commented 10 months ago

I really wouldn't know, i never uses esptool to flash, i suppose i could try it myself.

ds2k5 commented 10 months ago

@patience4711

thank you

which flash tool can I use on Linux (x86_64) ?

patience4711 commented 10 months ago

I am trying to flash it (with espressif dowload tools) but no luck, get invalid header. Also with other good working software. It seems that i have to flash a bootloader as well. Could you flash other software successfully? If you have a program with ota you could flash that and replace it with the .bin. I try some other things and come back when i find the solution.

ds2k5 commented 10 months ago

Could you flash other software successfully?

Need a name of a tool.... sorry only know the esptool.py

patience4711 commented 10 months ago

I used FLASH_DOWNLOAD_TOOLS_V3.4.4 (from the manufacturer espressif) with the settings below. I flashed an esp32 that had other working software uploaded via Arduino_IDE. Maybe that is needed to get the bootloader and partitiontable right. So if you compile and flash a simple sketch on the esp32 with arduineo_ide you can upload the binary @0x10000. It should not make a difference if you use esptool.py or something else as long as the address is right.

photo

ds2k5 commented 10 months ago

is this this link ?

https://www.espressif.com/en/support/download/other-tools?keys=FLASH+DOWNLOAD+TOOLS

see only windows version.... need linux version

patience4711 commented 10 months ago

Yes, but like i said, if you use esptool it should work too. I don't know nor use other flashers under linux.

If you install ESPasyncWebserver library in arduino ide you should be able to compile yourself,

ds2k5 commented 10 months ago

from https://github.com/espressif/esptool/releases is Version 4.6.2

but the same issue after flashing

sudo esptool-v4.6.2-linux-amd64/esptool --chip esp32 --port /dev/ttyUSB0 write_flash 0x0 ESP32-ECU_v0-8.bin

esptool.py v4.6.2
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 08:d1:f9:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x000f2fff...
Compressed 994544 bytes to 562324...
Wrote 994544 bytes (562324 compressed) at 0x00000000 in 49.7 seconds (effective 160.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

screen /dev/ttyUSB0 115200


invalid header: 0x73617265
invalid header: 0x73617265
invalid header: 0x73617265
invalid header: 0x73617265
invalid header: 0x73617265
invalid header: 0x73617265
invalid header: 0x73617265
ds2k5 commented 10 months ago

I flashed with 0x10000 insted of 0x0

sudo esptool-v4.6.2-linux-amd64/esptool --chip esp32 --port /dev/ttyUSB0 write_flash 0x10000 ESP32-ECU_v0-8.bin

now I can see this:

entry 0x4008067c
I (52) boot: ESP-IDF qa-test-v4.3.3-20220423 2nd stage bootloader
I (53) boot: compile time 11:11:52
I (53) boot: chip revision: 3
I (58) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (65) boot.esp32: SPI Speed      : 40MHz
I (69) boot.esp32: SPI Mode       : DIO
I (74) boot.esp32: SPI Flash Size : 4MB
I (78) boot: Enabling RNG early entropy source...
I (84) boot: Partition Table:
I (87) boot: ## Label            Usage          Type ST Offset   Length
I (95) boot:  0 phy_init         RF data          01 01 0000f000 00001000
I (102) boot:  1 otadata          OTA data         01 00 00010000 00002000
I (110) boot:  2 nvs              WiFi data        01 02 00012000 0000e000
I (117) boot:  3 at_customize     unknown          40 00 00020000 000e0000
I (125) boot:  4 ota_0            OTA app          00 10 00100000 00180000
I (132) boot:  5 ota_1            OTA app          00 11 00280000 00180000
I (140) boot: End of partition table
E (144) boot: ota data partition invalid and no factory, will try all partitions
E (152) esp_image: image at 0x100000 has invalid magic byte (nothing flashed here?)
E (160) boot: OTA app partition slot 0 is not bootable
E (166) esp_image: image at 0x280000 has invalid magic byte (nothing flashed here?)
E (175) boot: OTA app partition slot 1 is not bootable
E (180) boot: No bootable app partitions in the partition table
ets Jul 29 2019 12:21:46

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7672
load:0x40078000,len:16432
load:0x40080400,len:3704
entry 0x4008067c
I (52) boot: ESP-IDF qa-test-v4.3.3-20220423 2nd stage bootloader
I (53) boot: compile time 11:11:52
I (53) boot: chip revision: 3
I (58) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (65) boot.esp32: SPI Speed      : 40MHz
I (69) boot.esp32: SPI Mode       : DIO
I (74) boot.esp32: SPI Flash Size : 4MB
I (78) boot: Enabling RNG early entropy source...
I (84) boot: Partition Table:
I (87) boot: ## Label            Usage          Type ST Offset   Length
I (95) boot:  0 phy_init         RF data          01 01 0000f000 00001000
I (102) boot:  1 otadata          OTA data         01 00 00010000 00002000
I (110) boot:  2 nvs              WiFi data        01 02 00012000 0000e000
I (117) boot:  3 at_customize     unknown          40 00 00020000 000e0000
I (125) boot:  4 ota_0            OTA app          00 10 00100000 00180000
I (132) boot:  5 ota_1            OTA app          00 11 00280000 00180000
I (140) boot: End of partition table
E (144) boot: ota data partition invalid and no factory, will try all partitions
E (152) esp_image: image at 0x100000 has invalid magic byte (nothing flashed here?)
E (160) boot: OTA app partition slot 0 is not bootable
E (166) esp_image: image at 0x280000 has invalid magic byte (nothing flashed here?)
E (175) boot: OTA app partition slot 1 is not bootable
E (180) boot: No bootable app partitions in the partition table
ets Jul 29 2019 12:21:46
ds2k5 commented 10 months ago

where to get partion and bootloader image ?

ds2k5 commented 10 months ago

@patience4711

open ESP32-ECU_v0-8.ino in Arduino 1.8.19

03_installed_libs_2 02_installed_libs_1 01_board_settings

04_compile_error

Error Text:

WARNING: Category '' in library ESP Insights is not valid. Setting to 'Uncategorized' WARNING: Category '' in library ESP RainMaker is not valid. Setting to 'Uncategorized' WARNING: Category '' in library WiFiProv is not valid. Setting to 'Uncategorized' ESP32-ECU_v0-8:1:10: fatal error: AsyncEventSource.h: No such file or directory

include

      ^~~~~~~~~~~~~~~~~~~~

compilation terminated. exit status 1 AsyncEventSource.h: No such file or directory

Which LIB need to be installed for: AsyncEventSource.h ?

patience4711 commented 10 months ago

I dont know where to get the other binaries, i never used that. Like i said, if yoy have a working esp32 and repeat your last attempt at 0x10000 it should work. Just put a simple program on the esp32 first, one of the examples for instance.

Naamloos1

ds2k5 commented 10 months ago

Like i said, if yoy have a working esp32 and repeat your last attempt at 0x10000 it should work.

Thanks!!! that worked I think....

but connect to WiFI "ESP-ECU-"did not work PW: 123456789

now I see this with: screen /dev/ttyUSB0 115200


mounted file system
wificonfig.json not opened

basisconfig.json not opened

mqttconfig.json not opened
read value from EEPROM is �����������������������q�?
requestUrl = /
starting wifi 
**********
          WARNING connection failed
scan start
scan done
2 networks found
1: box11 (-50)*
2: GUEST (-51)*

result scan networksFound = 2

could not connect with the last known wificredentials,  starting access point...
AP IP address: 
192.168.4.1
started async HTTP server for the portal
entering the infinitive loop with heartbeat

self build from your source failed

did rm -rf .arduino15/ to get a clean arduino

use this device URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

got this message at open the file: ESP32-ECU_v0-8.ino

Screenshot_2023-11-22_21-09-37

thank you - now is OTA.H missing

Screenshot_2023-11-22_21-13-30

copy the OTA.H to the folder: ESP32-ECU_v0-8

Screenshot_2023-11-22_21-16-46

Screenshot_2023-11-22_21-17-22

Now hash.h is missig.... which LIB need to be installed ?

Screenshot_2023-11-22_21-20-32

patience4711 commented 10 months ago

Indeed, you have a working system so no need to compile yourself. It sees only two networks is that correct? When you enter the wifi networkname and passwd (read the wiki) you can see in the serial monitor whats happening. If you see "connected" than you can just reset the device and it will connect.

Sorry but i am not supporting self-compiling, That would cost me too much time, its impossible for me to know why it doesn't work for you, i am afraid you have to find out yourself.

ds2k5 commented 10 months ago

thanks for your help!

ds2k5 commented 10 months ago

works for me