A C# library for the Waveshare UART fingerprint sensor (C), running on .Net Framework 4.7 (Mono) on a Raspberry Pi
This library is tested using a Raspberry Pi Zero (hence the use of Mono)
but should work on any Raspberry.
It should also be easily portable to any device that supports Mono
or an equivalent (.Net Core).
- First install it from nuget
Then you only need to start the sensor
// PrimarySerialPort refers to /dev/ttyAMA0
// SecondarySerialPort refers to /dev/ttyS0
// You need to choose it according to your Raspberry
// Check the table below
var sensor = new FingerprintSensor(FingerprintSensor.PrimarySerialPort);
sensor.Start();
// Do any command
// Example: get the user count
if (sensor.TryGetUserCount(out ushort count))
{
Console.WriteLine($"User count: {count}");
}
Here is a table of which serial port to use on which Raspberry Pi, it may be different for you
Model | Port |
---|---|
Pi Zero | Primary (/dev/ttyAMA0) |
Pi Zero W | Secondary (/dev/ttyS0) |
Pi 1 | Primary (/dev/ttyAMA0) |
Pi 2 | Primary (/dev/ttyAMA0) |
Pi 3 | Secondary (/dev/ttyS0) |
Pi 4 | Secondary (/dev/ttyS0) |
The Secondary UART is disabled by default, you an activate it in
raspi-config
Source
You can find a sample app which shows basic usages of this library and may help you to understand how to use it
If you have a feature idea or want to report a bug, don't hesitate to create a new Issue or do a Pull Request
WaveshareUARTFingerprintSensor library is licensed under the MIT License.
Unosquare.Raspberry.IO library is under the MIT License.