I see sys.platform, which returns "esp8266", which is certainly helpful, but is there a way to detect which of the various wrapper boards I'm running on? I want to configure the pins differently for different boards. For example, given an ESP-01's limitations, I want to reallocate the TX pin for other use, but on a D1 Mini (essentially an ESP-12), I want to use other pins for the same tasks.
Is this possible from code at run time? I've looked through the machine module a bit and don't see anything that does this.
Thanks.
Identify board from code?
Re: Identify board from code?
That's not possible by the pure dtandard firmware. You can of course add a specific config file on the board which identifies the board type.
Re: Identify board from code?
Thank you. Yeah, I know I can effectively set a constant to toggle the code between configurations. As you say, I could stash it in a file, but there's still the risk that the state file could get copied over with the wrong value due to various sporadic user errors. I was hoping for a definitive solution. I accept that it just isn't possible.
Thanks again.
Thanks again.
Re: Identify board from code?
Assuming you aren't running the same firmware on the ESP-01s and the D1s you could use the more limited set of modules on the 1M firmware to tell them apart.
Custom firmware with a suitable added module would work too but unless you already have the tool chain built that's a lot of work.
Custom firmware with a suitable added module would work too but unless you already have the tool chain built that's a lot of work.