device_info
module provides basic information for the board type, firmware and capabilities accompanied by initialization functions and watchdog related controls.
import device_info
device_info.get_device_fw()
Get device firmware release and version name
(release, version)
device_info.get_reset_cause()
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()
(reset_cause)
device_info.get_device_id()
Get a device id based on machine unique id in readable and byte format. This matches with the WiFi MAC address.
(id_hex_string, id_bytes)
device_info.get_lora_mac()
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.
(lora_mac_hex_string, lora_mac_bytes)
device_info.get_lte_ids()
Get all possible LTE Modem-related ids in readable format. If LTE modem is not supported, None
values are returned.
(imei, iccid, imsi, modem_version, lte_fw_version)
device_info.get_heap_memory()
Get heap memory in bytes.
device_info.get_cpu_temp()
Get CPU temperature in degrees of Celsius
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.
device_info.set_led_color(color)
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
device_info.wdt_reset()
Reset watchdog timer.