Mercurial > code > home > repos > pi_mqtt
changeset 5:492eef562a88
more log detail
author | drewp@bigasterisk.com |
---|---|
date | Sat, 23 Mar 2024 16:53:08 -0700 |
parents | 759f0ba7d345 |
children | 7ea01e3d6a06 |
files | pi_mqtt.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pi_mqtt.py Sat Mar 23 16:15:34 2024 -0700 +++ b/pi_mqtt.py Sat Mar 23 16:53:08 2024 -0700 @@ -22,6 +22,7 @@ def health(request: Request) -> PlainTextResponse: if time.time() - lastSuccessfulPoll > 10: + log.info('failing health check') return PlainTextResponse('err', status_code=500) return PlainTextResponse('ok', status_code=200) @@ -46,7 +47,10 @@ def main(): - garage = pigpio.pi(host='garage5', port=8888) + host = 'garage5' + log.info(f'connecting to {host=} - if this hangs, garage5 wg maight be missing ip addr') + garage = pigpio.pi(host=host, port=8888) + log.info('connected') poller = Poller(garage) garage.set_mode(4, pigpio.INPUT) @@ -62,4 +66,4 @@ return app -uvicorn.run(main, host="0.0.0.0", port=8001, log_level=logging.INFO, factory=True) +uvicorn.run(main, host="0.0.0.0", port=8001, log_level=logging.DEBUG, factory=True)