Runtime — Supervisor Runtime information

Get current status of runtime objects.

Usage:

import supervisor
if supervisor.runtime.serial_connected:
    print("Hello World!")
class supervisor.Runtime

You cannot create an instance of supervisor.Runtime. Use supervisor.runtime to access the sole instance available.

runtime.serial_connected

Returns the USB serial communication status (read-only).

runtime.serial_bytes_available

Returns the whether any bytes are available to read on the USB serial input. Allows for polling to see whether to call the built-in input() or wait. (read-only)

Note

SAMD: Will return True if the USB serial connection has been established at any point. Will not reset if USB is disconnected but power remains (e.g. battery connected)

Feather52 (nRF52832): Currently returns True regardless of USB connection status.