device_info module provides basic information for the board type, firmware and capabilities accompanied by initialization functions and watchdog related controls.

import device_info



Get device firmware release and version name

  • returns tuple: (release, version)


Get device reset cause in integer format. Possible Values –> 0: PWRON_RESET, 1: HARD_RESET, 2: WDT_RESET, 3: DEEPSLEEP_RESET, 4: SOFT_RESET

For further reference of the values, advice Pycom documentation @ machine.reset_case()

  • returns integer: (reset_cause)


Get a device id based on machine unique id in readable and byte format. This matches with the WiFi MAC address.

  • returns tuple: (id_hex_string, id_bytes)


Get a device id based on LoRa MAC address in readable and byte format. This matches the LoRa DevEUI.

important After each erase_all call from pycom-fwtool, Force Update LoRa Region needs to be checked during flashing any new firmware. If region is not set, LoRa MAC will be reported as 0xFFFFFFFFFFFFFFFF. If LoRa is not supported, None values are returned.

  • returns tuple : (lora_mac_hex_string, lora_mac_bytes)


Get all possible LTE Modem-related ids in readable format. If LTE modem is not supported, None values are returned.

  • returns tuple: (imei, iccid, imsi, modem_version, lte_fw_version)


Get heap memory in bytes.

  • returns tuple: (allocated, free)


Get CPU temperature in degrees of Celsius

  • returns float: (cpu_temp)

device_info.set_defaults(heartbeat, wifi_on_boot, wdt_on_boot, wdt_on_boot_timeout_sec, bt_on_boot)

Set basic configuration of pycom board. By default sets pybytes functionality off.

  • params
    • heartbeat: set on/off the blinking led (boolean).
    • wifi_on_boot: set on/off the WiFi status during boot (boolean).
    • wdt_on_boot: set on/off the software watchdog (boolean).
    • wdt_on_boot_timeout_sec: if wdt_on_boot is true, set the watchdog timeout in seconds (integer).
    • bt_on_boot: set on/off the Bluetooth status (boolean).


Set the Pycom’s LED to the desired color. Supported string values: blue, red, yellow, green, white. Alternatively, any hex color representation can be used: ex. 0xFF0000

  • params
    • color: string of hex integer.


Reset watchdog timer.