Made timeout countdown without os.time() because on Raspberry Pi it cause immediate shutdown on boot.