CuriousJames / DIYAC

Raspberry Pi Python code & PCB design project to control door access (access control) via a wiegand card and/or keypad reader, handles a doorbell too
6 stars 2 forks source link

PiGPIO Initialisation Exception #11

Closed CuriousJames closed 4 years ago

CuriousJames commented 4 years ago

Catch initialization exception of Pi GPIO.

Currently it dumps it's own message on screen, but this should be handled by our program and logged accordingly (then the program shutdown).

This is normally because the PiGPIO daemon is not running - so mention that in the logging.

I've been unable to work out how to catch the error at the initialization time (try does not catch it!) so we MAY have to do it on the next request to pi, but that is not ideal.

tame-lx-tech commented 4 years ago

sort of fixed - init function now tests whether pigpiod is running before pi=pigpio() Test connection afterwards is still there.