本站改版新增arduino频道
def sys_stats():
import os, gc, machine, sys
from binascii import hexlify
hwid = str(hexlify(machine.unique_id())) #Hardware ID
output = "Hardware ID\t\t"+hwid + '\n'
uname = os.uname()
firmwareversion = str(uname.version)
hardware = uname.machine
output += "Hardware:\t\t"+hardware+'\n'
output += "Firmware version:\t"+firmwareversion+'\n'
mhz = str(machine.freq()/1000000) # Freq in MHz
freeram = str(gc.mem_free()/1024) # Free RAM
usedram = str(gc.mem_alloc()/1024) # Used RAM
vfs = os.statvfs('/')
freedisk = str(vfs[0] * vfs[4]/1024) # Flash VFS size freestr(gc.mem_free()/1024)+"KB"
output += "Python version:\t\t"+sys.version+'\n'
output += "CPU Freq:\t\t"+mhz+"MHz\n"
output += "Memory free:\t\t"+freeram+" KB free\n"
output += "Memory alloc:\t\t"+usedram+" KB allocated\n"
output += "Flash:\t\t\t"+freedisk+" KB free\n"
return(output)
print(sys_stats())
Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号
执行时间: 0.0095221996307373 seconds