-
Notifications
You must be signed in to change notification settings - Fork 231
Lua RTOS & board status
The Lua RTOS & board status functions provides information about the operation system and board status. This functions are provided as an extension of the Lua os module.
Get information about your board.
Arguments: nothing
Returns: the board type, the board subtype, and the board brand. Board subtype and board brand can be empty.
-- Get board information
type, subtype, brand = cpu.board();
-- Print to screen
print("Type: "..type)
print("Subtype: "..subtype)
print("Brand: "..brand)
Get the CPU name and CPU revision number, installed in your board.
Arguments: nothing
Returns: a string, with the CPU name installed on your board.
-- Get the CPU model
cpu = os.cpu();
-- Print to screen
print("CPU: "..cpu)
CPU: ESP32 rev 0
Get Lua RTOS version installed in your board.
Arguments: nothing
Returns: the operating system name (Lua RTOS), the version number,the system build time (expressed in EPOCH time) and the commit's hash (from github) used in build.
-- Get operating system name and version
oss, version, build, commit = os.version();
-- Print to screen
print("OS: "..oss..", version: "..version..", build: "..build..", commit: "..commit)
OS: Lua RTOS, version: beta 0.1, build: 1495574689, commit: 4d92804451cbec7d3ad545c66a92ffab35c63871
Get the reset reason.
Arguments: nothing Returns: reset reason.
Get the EUI from Winbond SPI FLASH chips. This EUI is read in the Lua RTOS boot process if the Lua RTOS -> General -> Read SPI flash EUI setting is enabled in Kconfig.
Arguments: nothing. Returns: the SPI FLASH EUI or nil if EUI is not available in your board.
/ > os.flashEUI()
cb6254185b430e2e
Show the Lua RTOS up time on the console, or return a table with the Lua RTOS up time information.
Arguments:
- table (optional): if true, the up time information is returned in a Lua table, if false the up time information is printed on the console.
Returns:
-
if table is false: nothing or an exception.
-
if table is true: a Lua table with up time information, or an exception, with the following fields:
- current: a string with the current time in %H:%M format
- days: up time days
- hours: up time hours
- mins: up time minutes
- secs: up time seconds