EverythingSmartHome / fingerprint-mqtt

Fingerprint sensor with MQTT support based on Adafruit Fingerprint Sensor Library
GNU General Public License v3.0
24 stars 14 forks source link

Support for R503 FPS and watchdog #18

Closed unseemlycoder closed 1 year ago

unseemlycoder commented 2 years ago

The adafruit fingerprint library supports FPM10A (optical) and R30x/R50x (Capacitive) Fingerprint sensors. However, the Capacitive fingerprint sensors (FPS) do not support the following function:

finger.fingerFastSearch();

The above line throws "Unknown Error" on Serial Monitor via switch-case logic. but instead use

finger.fingerSearch();

The R-series FPS have an LED ring around the sensor that can be used to indicate various states via

finger.LEDcontrol(uint8_t control, uint8_t speed, uint8_t coloridx, uint8_t count=0)

I have also noticed that certain microcontrollers (ESP32xx family) get stuck and do not publish mqtt messages, even though broker and wifi are available. I am yet to ascertain the issue via logs as this bug appears only when microcontroller is on power (for an extended period of time - days) and not connected to a system for serial monitor. Currently using a watchdog to raise a hardware interrupt and reboot the device on such a scenario.

Hardware WatchDog Timer - ESP32xx Stuck WiFi

unseemlycoder commented 2 years ago

19 Pull request created.

unseemlycoder commented 2 years ago

20 Pull request created (Updated an if condition).

unseemlycoder commented 1 year ago

Turns out when the WiFi access point switches channels or the microcontroller loses connection to the AP, there isn't a reconnection strategy in the code for WiFi. Only MQTT reconnect is implemented. The current watchdog solution works as a reconnection strategy but can be done using the native WiFi library. Will take a look into this.

Reference: https://github.com/knolleary/pubsubclient/issues/629

unseemlycoder commented 1 year ago

https://user-images.githubusercontent.com/56648438/204137989-b1632940-75c9-49b1-ab0c-8f52e61a050d.mp4

Been stable for the last month. Closing this issue.