Code Monkey home page Code Monkey logo

uhppoted-mqtt's Introduction

build

uhppoted implements a set of cross-platform building blocks for access control systems based on the UHPPOTE UT0311-L0x TCP/IP Wiegand access control boards. Currently available components include:

The components supplement the manufacturer supplied application which is 'Windows-only' and provides limited support for integration with other systems.

FYA, after much discussion it has been decided that uhppoted is pronounced u-hop-id-ay-d (juː hɒp ɪt eɪd).

Operating systems

Supported operating systems:

  • Linux
  • MacOS
  • Windows
  • ARM and ARM7 (e.g. RaspberryPi)

Language Bindings

The primary development language for this repository is Go, but code generated native bindings for the following languages also exist:

shared-lib/dylib/DLL

uhppoted-dll implements a shared-lib/DLL for interop with languages other than Go. The implementation includes bindings to:

  • C
  • C++
  • C#
  • Python
  • Clozure Common Lisp

3rd party integrations

Compatible Hardware

As per this issue [Question] Compatible Hardware, UHPPOTE appears to be a specific branding (or distributor) for the access control boards manufactured by Shenzhen Wiegand Industrial Co., Ltd.

The software in this repository has been tested and is known to work with these specific boards:

Source Item
Amazon UHPPOTE Professional Wiegand 26-40 Bit TCP IP Network Access Control Board with Software For 4 Door 4 Reader
AliExpress TCP/IP RFID ACCESS CONTROL SYSTEM Wiegand 26

Firmware versions

Version Notes
6.56 Minimum firmware version (cf. carbonsphere/UHPPOTE
6.62 Lowest firmware version in use
8.92 Latest tested firmware version

Notes:

  1. Firmware v6.62 sends anomalous listen events with 0x19 as the start of message identifier. This appears to have been fixed in later firmware versions but patches to support these events are included in:

Readers

Almost any reader with a Wiegand-26 interface should probably work (there have been reports of offbrand readers that don't) but the readers below are in active use:

Reader Notes
HID ProxPoint Plus 6500 Old stock and/or refurbished readers are often available on ebay
IKeys barcode and QR code scanner Ref. Put Card - Date with Time
Newland FM430L barcode and QR code scanner Ref. Put Card - Date with Time

Release Notes

Current Release

v0.8.8 - 2024-03-28

  1. Added uhppoted-app-home-assistant experimental Home Assistant integration.
  2. restore-default-parameters function across all subprojects.
  3. Added public Docker images for uhppote-simulator, uhppoted-rest, uhppoted-mqtt, and uhppoted-httpd to ghcr.io.
  4. Bumped Go version to 1.22.
  5. Reworked uhppoted-app-wild-apricot member/group resolution logic.

Modules

Module Description
uhppote-core core library, implements the UP interface to UT0311-L0x controllers
uhppoted-lib common utility function library
uhppote-simulator UT0311-L04 simulator for development use
uhppote-cli command line interface
uhppoted-rest daemon/service with REST API for remote access to UT0311-L0x controllers
uhppoted-mqtt daemon/service with MQTT endpoint for remote access to UT0311-L0x controllers
uhppoted-app-s3 cron'able utility to download/upload access control lists from/to AWS S3
uhppoted-app-sheets cron'able utility to download/upload access control lists from/to Google Sheets
uhppoted-app-db cron'able utility to download/upload access control lists from/to a SQL DB
uhppoted-app-wild-apricot cron'able utility to manage access control lists from Wild Apricot
uhppoted-app-home-assistant Home Assistant custom component
node-red-contrib-uhppoted NodeJS nodes for Node-RED low code environment
uhppoted-nodejs Standalone NodeJS module
uhppoted-python Standalone Python package for PyPI
uhppoted-dll shared-lib/DLL for cross-language interop
uhppoted-codegen Model based code generator for native language bindings
uhppoted-tunnel UDP tunnel for remote access

Integrations

Module Description
uhppoted-app-db cron'able utility to download/upload access control lists from/to a SQL DB
uhppoted-app-s3 cron'able utility to download/upload access control lists from/to AWS S3
uhppoted-app-sheets cron'able utility to download/upload access control lists from/to Google Sheets
uhppoted-app-wild-apricot cron'able utility to manage access control lists from/t Wild Apricot
uhppoted-app-home-assistant Home Assistant custom component
node-red-contrib-uhppoted NodeJS nodes for Node-RED low code environment
kBrausew/ioBroker.wiegand-tcpip ioBroker

UI

Module Description
uhppote-cli Command line interface
uhppoted-httpd HTML browser interface

Installation

Binaries for Linux, Windows, MacOS and Raspbian/ARM7 are distributed in the tarball for each release. To install the binaries, download and extract the tarball to a directory of your choice.

The NodeRED, NodeJS and Python packages are installable from the public repositories:

Building from source

uhppoted is the parent project for the individual components which are referenced as git submodules - to clone the entire source tree:

git clone --recurse-submodules https://github.com/uhppoted/uhppoted.git

The supplied Makefile has targets to build binaries for all the supported operating systems:

make build

or

make release

To pull upstream changes for all submodules:

git submodule update --remote

Donations

If you like the project and you really want to 🙂:

References and Related Projects

  1. carbonsphere/UHPPOTE PHP
  2. carbonsphere/DoorControl PHP
  3. andrewvaughan/uhppote-rfid Python
  4. tachoknight/uhppote-tools: Go
  5. jjhuff/uhppote-go: Go
  6. pawl/Chinese-RFID-Access-Control-Library
  7. Dallas Makerspace:Reverse Engineering RFID Reader
  8. wemakerspace/wiegand-daemon
  9. wemakerspace/weigeng-js
  10. realashleybailey/DoorControl
  11. kBrausew/ioBroker.wiegand-tcpip
  12. TCP/IP Wiegand Access Controller (Zutrittskontrolle)
  13. YouTube: UHPPOTE 2 door basic set-up
  14. wouterdebie/uhppote-rs

uhppoted-mqtt's People

Contributors

andre1becker avatar dependabot[bot] avatar irvintim avatar twystd avatar uhppoted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uhppoted-mqtt's Issues

MQTT

Hi, I just found your project its really great i just dont find anywhere the info on where to config the mqtt connection to my broker is there any info that i could have not found.
Thanks in advance and have a good day !

Add mqtt.acl.verify option to uhppoted.conf

Discussed in uhppoted/uhppoted#17

Originally posted by irvintim September 24, 2022
Hi:

So, my project has been moving along slowly, the next thing I want to accomplish is to be able to load up the ACLs (cards) via a Lambda job. I'm storing the card data in DynamoDB, and then when that is updated I trigger a Lambda to grab the latest list of cards, generate a new *.acl file and tar that up and upload it to S3. Then send an "acl:download" MQTT message with the URL for this S3 file. Everything is working great until I get the following:

{
  "message": {
    "error": {
      "client-id": "test",
      "error": {
        "code": 400,
        "debug": ": no RSA public key",
        "message": "Error downloading ACL"
      },
      "method": "acl:download",
      "nonce": 6,
      "request-id": "AH1635G3",
      "server-id": "uhppoted"
    }
  },
  "hmac": "xxxx"
}

I found the instructions in the repo on how to create the RSA signed acl files, but I'd rather not have to do that (it's already hard enough to create a gziped tar file in a python-based Lambda job without writing anything to disk). Is there a way to turn this "feature" off?

I am running uhppoted-mqtt v0.8.1-beta

Tim

Rework events handling

cf. #Issue15: old event published on each card swipe

The current events handling in uhppoted-mqtt is less than ideal - it was originally conceived as a 'reliable' events stream and if uhppoted-mqtt had been offline for a while would post small batches of events to the events topic until it had caught up the backlog to the latest event in the controller.

Which is less than intuitive when expecting to see the latest event on a card swipe - the events handling needs be separated into events and historical streams:

  • controller events would be published to the events topic on receipt from the controller
  • on startup a limited number of unpublished events (or possibly the events in a limited time frame?) would be published to the events topic
  • the historical stream would make a 'best attempt' at ensuring that all controller events are published to the historical events topic, but could lag behind the current event if there was a significant backlog

TODO

  • Move events listening from uhppoted-lib to uhppoted-mqtt
  • Rework existing events handling to publish controller events on receipt from the controller
  • Rework existing events handling to publish up to e.g. most recent 16 events (or last 30 minutes ?) of unpublished events
  • Implement 'trickle feed' for historical events that publishes backlogged controller events in small batches at e.g. 5 minute intervals to a historical topic
  • (maybe) make the default historical topic null or disabled by default
  • events and historical topics should be configurable in uhppoted.conf
  • Unit tests
  • Integration tests
  • CHANGELOG
  • README

strange mqtt issue

I use the uhppoted-mqtt component on a Raspberry Pi to send mqtt messages to Home Assistant. Everything was working fine.
Suddenly, I stop receiving mqtt messages. After a reboot, I receive all old mqtt messages but no new messages. I need to reboot to get these messages.
Do you have any idea to solve this issue ?
My conf file is there uhppoted.txt

Docker build?

I was wondering if there is any prebuilt docker containers for this package? I am running it directly on my hardware now without issues, but trying to build the docker container seems like I need to figure out a bunch of dependencies, and before I bothered I was wondering if a repository of that is maintained anywhere.

Create documentation for MQTT messages

From e-mail:

The system is running fine but I need a documentation on topics and messages I was unable to find.
BTW, how not to encrypt mqtt messages ?

[bug?] old event published on each card swipe

I'm not sure if this is a configuration issue on my end, but every time I swipe a card or enter a code uhppoted-mqtt first sends the previous event that it saw and only after that the current event (look at timestamps and receive dates).

the event being resent can be hours old.

No other mqtt topic shows this behavior.

Version: uhppoted-mqtt_v0.8.6/linux

2023/10/28 12:47:16 [client]   enter Publish
2023/10/28 12:47:16 [client]   sending publish message, topic: wiarus/gateway/events
2023/10/28 12:47:16 [net]      obound msg to write 26
 ... sent 64 bytes to 192.168.1.123:60000

2023/10/28 12:47:16 [net]      obound wrote msg, id: 26
2023/10/28 12:47:16 [net]      outgoing waiting for an outbound message
 ... request
 ...          00000000  17 b0 00 00 6a 08 4e 0d  d1 00 00 00 00 00 00 00  |....j.N.........|
 ...          00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 ...          00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 ...          00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 ...          

 ... received 64 bytes from 192.168.1.123:60000
 ... response
 ...          00000000  17 b0 00 00 6a 08 4e 0d  d1 00 00 00 01 01 01 01  |....j.N.........|
 ...          00000010  6f 5a 25 00 20 23 10 28  12 47 11 01 00 00 00 00  |oZ%. #.(.G......|
 ...          00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 ...          00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 ...          
2023/10/28 12:47:16 [client]   enter Publish
2023/10/28 12:47:16 [client]   sending publish message, topic: wiarus/gateway/events
2023/10/28 12:47:16 [net]      obound msg to write 27
2023/10/28 12:47:16 [net]      obound wrote msg, id: 27
2023/10/28 12:47:16 [net]      outgoing waiting for an outbound message
2023/10/28 12:47:16 [net]      startIncoming Received Message
2023/10/28 12:47:16 [net]      startIncomingComms: got msg on ibound
2023/10/28 12:47:16 [store]    memorystore del: message 26 was deleted
2023/10/28 12:47:16 [net]      startIncomingComms: received puback, id: 26
2023/10/28 12:47:16 [net]      logic waiting for msg on ibound
2023/10/28 12:47:16 [net]      startIncoming Received Message
2023/10/28 12:47:16 [net]      startIncomingComms: got msg on ibound
2023/10/28 12:47:16 [store]    memorystore del: message 27 was deleted
2023/10/28 12:47:16 [net]      startIncomingComms: received puback, id: 27
2023/10/28 12:47:16 [net]      logic waiting for msg on ibound
2023/10/28 12:47:18 INFO   watchdog     OK
2023/10/28 12:47:19 [pinger]   ping check 2.858216454
2023/10/28 12:47:23 INFO   watchdog     OK
2023/10/28 12:47:24 [pinger]   ping check 7.857553456
2023/10/28 12:47:28 INFO   watchdog     OK

image

uhppoted-mqtt disconnection

Discussed in uhppoted/uhppoted#32

Originally posted by liviom June 28, 2023
Dear All

I have the following errors

`o@UbuntuOH-Data:/opt/uhppoted/uhppoted_v0.8.5$ sudo ./uhppoted-mqtt --console --config /etc/uhppoted/uhppoted.conf --console
[sudo] password di livio:
2023/06/29 02:14:51 INFO uhppoted-mqtt service v0.8.x - Linux (PID 357369)
2023/06/29 02:14:51 INFO START
2023/06/29 02:14:51 WARN auth open /var/uhppoted/mqtt.hotp.counters: no such file or directory
2023/06/29 02:14:51 WARN auth open /var/uhppoted/mqtt.nonce: no such file or directory
2023/06/29 02:14:51 WARN auth open /var/uhppoted/mqtt.nonce.counters: no such file or directory
2023/06/29 02:14:51 WARN open /etc/uhppoted/mqtt/cards: no such file or directory
2023/06/29 02:14:51 INFO mqttd listening on 192.168.0.90:60001
2023/06/29 02:14:51 INFO mqttd publishing events to uhppoted/gateway/events
2023/06/29 02:14:51 INFO listen Fetching unretrieved events for device ID 423133701
2023/06/29 02:14:51 INFO mqttd connected to tcp://192.168.0.90:1883
2023/06/29 02:14:51 INFO mqttd subscribed to uhppoted/gateway/requests
2023/06/29 02:14:51 [store] memorystore del: message 1 not found
2023/06/29 02:14:51 INFO listen No unretrieved events for device ID 423133701
2023/06/29 02:14:51 INFO listen Initialising event listener
2023/06/29 02:14:51 INFO listen Listening
2023/06/29 02:14:56 INFO watchdog OK
2023/06/29 02:15:01 INFO watchdog OK
2023/06/29 02:15:01 [client] Connect comms goroutine - error triggered EOF
2023/06/29 02:15:01 [client] BUG BUG BUG reconnection function is nil
2023/06/29 02:15:01 ERROR mqttd connection to MQTT broker lost (EOF)
2023/06/29 02:15:01 INFO mqttd DISCONNECT 1 of 10 in 5m0s
2023/06/29 02:15:06 INFO watchdog OK
2023/06/29 02:15:06 INFO health-check refreshing interface IP address list
2023/06/29 02:15:09 INFO health-check OK
2023/06/29 02:15:09 WARN monitoring no connection to MQTT broker
2023/06/29 02:15:11 INFO watchdog OK
2023/06/29 02:15:11 INFO mqttd retrying connection to MQTT broker tcp://192.168.0.90:1883
2023/06/29 02:15:11 INFO mqttd connected to tcp://192.168.0.90:1883
2023/06/29 02:15:11 INFO mqttd subscribed to uhppoted/gateway/requests
2023/06/29 02:15:11 [store] memorystore del: message 2 not found
2023/06/29 02:15:16 INFO watchdog OK
2023/06/29 02:15:21 INFO watchdog OK
2023/06/29 02:15:21 [client] Connect comms goroutine - error triggered EOF
2023/06/29 02:15:21 [client] BUG BUG BUG reconnection function is nil
2023/06/29 02:15:21 ERROR mqttd connection to MQTT broker lost (EOF)
2023/06/29 02:15:21 INFO mqttd DISCONNECT 2 of 10 in 5m0s
2023/06/29 02:15:24 INFO health-check OK
2023/06/29 02:15:24 WARN monitoring no connection to MQTT broker
2023/06/29 02:15:26 INFO watchdog OK
2023/06/29 02:15:31 INFO watchdog OK
2023/06/29 02:15:31 INFO mqttd retrying connection to MQTT broker tcp://192.168.0.90:1883
2023/06/29 02:15:31 INFO mqttd connected to tcp://192.168.0.90:1883
2023/06/29 02:15:31 INFO mqttd subscribed to uhppoted/gateway/requests
2023/06/29 02:15:31 [store] memorystore del: message 3 not found
2023/06/29 02:15:36 INFO watchdog OK
2023/06/29 02:15:39 INFO health-check OK
2023/06/29 02:15:41 INFO watchdog OK
2023/06/29 02:15:41 [client] Connect comms goroutine - error triggered EOF
2023/06/29 02:15:41 [client] BUG BUG BUG reconnection function is nil
2023/06/29 02:15:41 ERROR mqttd connection to MQTT broker lost (EOF)
2023/06/29 02:15:41 INFO mqttd DISCONNECT 3 of 10 in 5m0s
2023/06/29 02:15:46 INFO watchdog OK
2023/06/29 02:15:51 INFO watchdog OK
2023/06/29 02:15:51 INFO mqttd retrying connection to MQTT broker tcp://192.168.0.90:1883
2023/06/29 02:15:51 INFO mqttd connected to tcp://192.168.0.90:1883
2023/06/29 02:15:51 INFO mqttd subscribed to uhppoted/gateway/requests
2023/06/29 02:15:51 [store] memorystore del: message 4 not found
2023/06/29 02:15:54 INFO health-check OK
2023/06/29 02:15:56 INFO watchdog OK
2023/06/29 02:16:01 INFO watchdog OK
2023/06/29 02:16:01 [client] Connect comms goroutine - error triggered EOF
2023/06/29 02:16:01 [client] BUG BUG BUG reconnection function is nil
2023/06/29 02:16:01 ERROR mqttd connection to MQTT broker lost (EOF)
2023/06/29 02:16:01 INFO mqttd DISCONNECT 4 of 10 in 5m0s
^C2023/06/29 02:16:04 INFO interrupt
2023/06/29 02:16:04 INFO mqttd closing connection to tcp://192.168.0.90:1883
2023/06/29 02:16:04 [client] status is already disconnected
2023/06/29 02:16:04 INFO mqttd closed connection to tcp://192.168.0.90:1883
2023/06/29 02:16:04 INFO exit
livio@UbuntuOH-Data:/opt/uhppoted/uhppoted_v0.8.5$

`

and after 10 disconnection it stops the app.
this happens also if it is executed out of the console with command "systemctl start uhppoted-mqtt.service"

how can I solve?

thanks in advance for your help

Is it possible to get the "User ID" from uhppoted/gateway/events/live ??

Hello,

Everything seems to be running smoothly so far, but I was curious to know if I can get the "User ID" as a payload (not sure of the terminology) from the events.

Here is was I get from the uhppoted-mqtt:

{
"message": {
"event": {
"event": {
"access-granted": true,
"card-number": 2035825,
"device-id": 425035700,
"direction": 1,
"direction-text": "in",
"door-id": 1,
"event-id": 35,
"event-reason": 2,
"event-reason-text": "swipe open",
"event-type": 1,
"event-type-text": "card swipe",
"timestamp": "2023-12-05 20:54:14 EST"
}
}
},

I could identify the User by using the card-number, but it would be easier to identify by "User ID".

Thank you for your work!

Config not loaded properly from default folder /etc/uhppoted/uhppoted.conf

Hello,
First time writing in Github, so I'm not 100% sure if it's at the right place. Sorry in advance if it's the case.

I've installed uhppoted-core, uhppoted-cli, uhppoted-lib and now uhppoted-mqtt.
I've modified the uhppoted.conf to specifiy my MQTT broker, but everytime I run the uhppoted-mqtt, it seems to use the 127.0.0.1 instead of the specified address in the conf file.
In short, I've modified the mqtt broker address to 192.168.77.51:1883 instead of 127.0.0.1:1883 in the conf file, but it doesn't seem to be using it when it's runned.

Here is some print screens attached. Could you help me out with that problem?

Regards,

Printscreen 1
Printscreen 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.