https://github.com/vshapovalov/rfid-reader-service
RFID reader with mqtt communication(Drivers: M302, RFIDLIb)
https://github.com/vshapovalov/rfid-reader-service
mqtt-client rfid-reader
Last synced: 5 months ago
JSON representation
RFID reader with mqtt communication(Drivers: M302, RFIDLIb)
- Host: GitHub
- URL: https://github.com/vshapovalov/rfid-reader-service
- Owner: vshapovalov
- Created: 2022-09-22T07:53:23.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-02T17:56:41.000Z (about 3 years ago)
- Last Synced: 2024-06-21T13:06:07.122Z (about 2 years ago)
- Topics: mqtt-client, rfid-reader
- Language: Go
- Homepage:
- Size: 2.07 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Remote rfid-reader service
Use connected rfid communication reader to read and send cards numbers to the server via mqtt broker.
### Configuration
`id` - unique identifier of reader service
`device.driver` - `M302` or `RFIDLib`
```json
{
"id": "workstation-1-reader-1",
"isDebugModeEnabled": true,
"reverseCardNumber": false,
"useBuzzerOnRead": true,
"device": {
"driver": "M302",
"M302Settings": {
"port": "COM1",
"baud": 9600,
"readTimeout": 1,
"size": 8
}
},
"mqttBroker": {
"uri": "tcp://localhost:1883",
"username": "user",
"password": "secret"
}
}
```
### Broker communications
When cards are read, service sends message to the broker with topic `reader/{readerId}/card` and payload with cards numbers.
```json
{
"cardNumbers": ["1234567890"],
"readerId": "workstation-1-reader-1"
}
```
When service starts, it sends message to the broker with topic `reader/{readerId}/status` and payload with status.
```json
{
"status": "online",
"readerId": "workstation-1-reader-1"
}
```
When service stops, it sends message to the broker with topic `reader/{readerId}/status` and payload with status.
```json
{
"status": "offline",
"readerId": "workstation-1-reader-1"
}
```
To use buzzer on reader module, send message to the broker with topic `reader/{readerId}/buzzer` and payload with
status.
```json
{
"count": 1
}
```
### RFIDLib driver
Can be used only on windows x64, because uses windows dynamic libraries
This drivers library supports list of readers:
- M201
- MR113R
- RD120M
- RD201
- RD242
- SSR100
- RD5100
- RD5200
- RL8000
- RPAN
in device config section should be specified RFIDLIB driver and RFIDLibSettings settings, last one describes library devices driver, `RPAN` for example, and comunication settings
```
{
"driver": "RFIDLIB",
"RFIDLibSettings": {
"libDriver": "RPAN",
"communication": {
"type": "USB",
"settings": {
"serialNumber": "2072190002"
}
}
}
}
```
All allowed settings you can find in `config.example.json` file