Ancient ESP Versus New? LED Not On Pin 2?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Ancient ESP Versus New? LED Not On Pin 2?

Post by Jibun no kage » Sun Aug 07, 2022 4:15 am

Just came across something, have ESP modules that have different LED pin assignments? The most recent ESP modules I have, based on recent purchase, the LED is pin 2. But I have older ESP modules where LED is on pin 0. Trying to work out a method to know which pin is used on which module. Anyone have any suggestions?

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: Ancient ESP Versus New? LED Not On Pin 2?

Post by karfas » Sun Aug 07, 2022 10:03 am

You might use machine.unique_id() to find out on which of your boards your program runs.
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: Ancient ESP Versus New? LED Not On Pin 2?

Post by Jibun no kage » Mon Aug 08, 2022 2:54 am

Pulling the manufacturer code and chip id worked for all the ESP8266 variants but not the ESP32 modules, had to get creative with them since it was MAC addresses, so have an exclusion list, in the list, newer ESP32, otherwise older. Had to do the same thing with ESP32 for those that do have the on-board temperature sensor versus the newer ones that don't.

Post Reply