wake ==== .. py:module:: wake .. autoapi-nested-parse:: Wake a sleeping board through the maintenance switch, for the WLAN tools. The board sleeps between fetches and cannot be reached then. Setting the retained MQTT flag behind the "Maintenance mode" switch keeps it awake at its next fetch (within 10 to 60 minutes, depending on its mode); the flag is cleared again when the tool is done, also on errors. Attributes ---------- .. autoapisummary:: wake.ROOT wake.POLL_S Functions --------- .. autoapisummary:: wake.set_maintenance wake.board_awake Module Contents --------------- .. py:data:: ROOT .. py:data:: POLL_S :value: 10 .. py:function:: set_maintenance(config, value) Set the retained maintenance flag (MAINTENANCE_ON/OFF) via MQTT. .. py:function:: board_awake(host, probe, wait_min, switch=None, sleep=time.sleep, clock=time.time, out=_print) Yield what `probe` returns once the board answers. :param host: Host name, for messages. :param probe: Asks the board for something and returns it, or None if the board does not answer. :param wait_min: How long to wait for a sleeping board. :param switch: Sets the maintenance flag; `set_maintenance` with the local config by default. :param sleep: Function to wait a number of seconds. :param clock: Returns the current time in seconds. :param out: Prints progress. :raises SystemExit: If the board does not wake in time.