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?

1
  • 2
    esptool.py reports it
    – Juraj
    Feb 22 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.

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?
    – PMF
    Feb 23 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.