Simple Access Control System: Use Barcode Scanner RTMU86 Control The Lock Directly, Without Use Access Control Panel.

RTMU86 uploads the scan data to the server and controls the door lock

In most cases, the composition of the access control system is like this: barcode scanner / NFC reader + access control panel + lock + control software/server.

However, if you use our RTMU86, we can make the system more simple.

Firstly, connect use RTMU86 scanner with the lock, and then connect RTMU86 to the server via Ethernet. The scanned content is sent to the server through the Ethernet. After the server verifies the content and sends the unlock command to the RTMU86, the RTMU86 directly controls the lock to be opened. So the solution becomes:

barcode scanner / NFC reader+ lock + control software/server.

Through this solution, we do not need to use the access control panel, thereby reducing the cost and greatly simplifying the difficulty of system integration. So

Tips:

  1. If you use this solution, customers need to develop/build their own access control management software.
  2. In this article, we introduce a solution without the use of an access controller, but you can also use the RTMU86 to work together with the access controller and then connect with the lock. To learn more about this solution, please read:  https://www.rtscan.net/wiegand-barcode-scanner-and-zkteco-access-control-system/

Below, we describe the hardware connection and scanner configuration in detail.

1. Hardware connection

(1) RTMU86 connection with a lock

12V is connected to the RTMU86 com terminal input, and NO is connected to the positive pole of the electromagnetic lock power supply. After mu86 receives the unlock command, the com and no ports are turned on, and the electromagnetic lock is energized and unlocked.

Door lock connection diagram

(2) RTMU86 network port connection

The RTMU86 Ethernet version (the other version is the Wiegand version) directly leads out four network cable pins, which can be connected to four of the standard eight-core network cables according to the color. The network cable adopts the 568B connection method. Please refer to the table for wiring according to the color.

RTMU86 pinsPin4Pin3Pin2Pin1
Network cable colorOrangeOrange whiteGreenGreen white
Network cable color icon

 

2.RTMU86 Configuration

(1).Select RTMU86

Click next

(2)Setup work mode

work mode:Develop,

Output: Ethernet

Development:Protocol

WIFI/Ethernet/2G output: TCP

(3) Set NET

SuccessAction:flash Green (Optional)

FailAction:flash red(Optional)

Set the service address and port to which the data is uploaded (*necessary settings)

Address: server address, such as 192.168.4.1

Port num: server port

IP mode setting

Dynamic IP: dynamic IP, IP address is automatically assigned by the router

Static IP: manually specify the IP address, when set to static IP, you must specify the IP address, Subnet mask, Gateway, the format is as follows

(4) Device scan code configuration

Click config code to generate configuration code. Device scan code configuration code to complete the configuration

For detailed usage of the configuration tool, please refer to “ScannerConfig Configuration Tool User Manual”.

After the configuration is complete, the device automatically connects to the specified server, and then reports the scan data after scanning the code.

 

3. Connect to the server

As a client, the MU86 scanner can establish a long TCP connection to the server and process the response returned by the server. The interface specification is defined as follows

TCP/TCP protocol

The format of the requested TCP/IP server IP address is: xxx.xxx.xxx.xxx

The format of the requested TCP/IP server port is: 0-65535

The scanner sends the original scanned data to the server

server:

4. Register account and control door lock

Use the server to build TCP server, accept the data reported by the scanner, determine the uploaded data, and issue the unlock command

Relay control command: (command is a hexadecimal array)

Command headerCommand wordData lengthByte 1Byte 2Check word
2Byte1Byte2Byte1Byte1Byte1Byte
0X55 0XAA0x2a0X02 0X00

0x01 On

0x00 Off

Duration (unit: 50MS) 0x00: Default time 

E.g:

55 aa 2a 02 00 01 02 d4 Relay on 100ms

55 aa 2a 02 00 00 02 d5 off relay

More instructions reference<>

In this test, the server side uses python to build tcpsever, reads the data uploaded by the device, and judges whether it meets the registered id and is in compliance with the issued unlock instruction

Run py

The device establishes a connection

Uploaded data received

ID is the same as the saved id, issue the unlock command

Reference source code

import binascii
from quopri import HEX
from socket import *
from time import ctime

HOST = '192.168.4.1'
PORT = 8888
BUFSIZ = 1024
ADDR = (HOST, PORT)

tcpSerSock = socket(AF_INET, SOCK_STREAM)
tcpSerSock.bind(ADDR)
tcpSerSock.listen(5)

id_list = ["12345678", "abcdefg"]

def calculate_bbc(data, len):
bbc = 0
for i in range(len):
bbc ^= data[i]
return bbc

def detection_id(data):
data_len = len(data)

if data_len &lt; 8:
return 0

if data[0] == 0x55 and data[1] == 0xaa and data[2] == 0x30 and data[3] == 0x00:
bbc = calculate_bbc(data, data_len - 1)
if bbc == data[data_len - 1]:
id_len = data[4] + data[5] * 256
id = data[6:6+id_len]
print("read id=", id)
for cid in id_list:
if id == cid.encode("UTF-8"):
return 1

print("Id not registered:", id)
return 0
else:
return 0

def send_lock_open(client, ms):
buf = [0x55, 0xaa, 0x2a, 0x02, 0x00, 0x01, 0x00, 0x00]
if ms &lt; 50: ms = 50
buf[6] = int(ms / 50)
buf[7] = calculate_bbc(buf, 7)
# print("send:", bytes(buf))
client.send(bytes(buf))

recv = client.recv(BUFSIZ)
if not recv:
return -1
# print(recv)
if recv == b'\x55\xaa\x2a\x00\x00\x00\xd5':
return 1
else:
return 0

def send_lock_close(client):
buf = [0x55, 0xaa, 0x2a, 0x02, 0x00, 0x00, 0x00]
buf[6] = calculate_bbc(buf, 6)
client.send(bytes(buf))

while True:
print('waiting for connection...')
tcpCliSock, addr = tcpSerSock.accept()
print('...connnecting from:', addr)

while True:
data = tcpCliSock.recv(BUFSIZ)
if not data:
break
# print(data)
if detection_id(data):
print('open the door')
if send_lock_open(tcpCliSock, 1000):
print('open the door success')

tcpCliSock.close()
tcpSerSock.close()

Related Products:


For any questions, please consult our sales engineer sales@rtscan.net or support team support@rtscan.net.

Thanks!

10523 View