how to determine which processor module i'm using?
i'm writing code to execute on either a WiPy or a GPy.
i need to determine at run time which module the code is running on so i can initialise LTE (GPy) or not (WiPy)
aside from using the try...except method to check for LTE modem presence is there an object i can query for a device id
i can't seem to find anything in the documentation.
any help will be appreciated
I need to determine at run time which module the code is running on so i can initialise LTE (GPy) or not (WiPy) aside from using the
If you will need a more extensive platform switch, you are welcome to take our implementation  from the Universal MicroPython Application Loader.
More or less, it just wraps
We are using it to run the Terkin-Datalogger on both ESP32 and STM32 plaforms and to decide whether it is running on Pycom MicroPython or Genuine MicroPython.
platform_info = PlatformInfo() if platform_info.mcu == platform_info.MCU.ESP32: print('Running on ESP32') elif platform_info.mcu == platform_info.MCU.STM32: print('Running on STM32') if platform_info.vendor == platform_info.MICROPYTHON.Pycom: print('Running on Pycom MicroPython') elif platform_info.vendor == platform_info.MICROPYTHON.Vanilla: print('Running on Genuine MicroPython')
With kind regards,
many thanks for the speedy reply
exactly what i needed
robert-hh last edited by
@cYc sys.platform will tell you.