0

I have the same application for both ESP32 and ESP8266 (the same functionality). The person, who is not an IT expert is expected to launch the dedicated installer program to upload the (first/new) version of the application. How can the installer (the program) detect what version of hardware is connected through USB? The goal is to upload the correct variant of he application. Is it possible at all?

asked Feb 22, 2022 at 9:56
1
  • 2
    esptool.py reports it Commented Feb 22, 2022 at 10:00

1 Answer 1

3

You can attempt to get the "chip ID" from the target board using esptool.py. The ESP8266 has a chip ID, but the ESP32 doesn't.

Running esptool.py --port <serial port> chip_id will either tell you, amongst other things:

Detecting chip type... ESP8266
Chip is ESP8266EX
....
Chip ID: 0x00a70414

Or:

Detecting chip type... ESP32
Chip is ESP32-PICO-D4 (revision 1)
...
Warning: ESP32 has no Chip ID. Reading MAC instead.

You can do similar with the read_mac command. In fact any operation on esptool.py that interacts with the target first probes the target to find out what the target is and report it - commands like chip_id and read_mac are just nice simple examples that return minimal information and don't interact with the target more than just querying the chip.

answered Feb 22, 2022 at 10:16
1
  • I suppose that you can't do it wrong anyway, can you? I mean attempting to upload an ESP8266-program to an ESP32 or vice versa will probably just result in an error? Commented Feb 23, 2022 at 7:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.