Open Platform
Skip to content

This document outlines the complete operating procedure for the Demo:

‑ Makes the card‑issuing Demo accessible to non‑developers.

‑ Enables developers to grasp the full card‑issuing workflow.

Prerequisites ​

Download card encoder demo:https://gitee.com/sciener/cardencoderdemo

image-20261015093032092

Data Preparation ​

1.Add Locks via TTHotel application, you need to set up buliding number, floor number(location of a room) to a lock during addition

2.On the TTHotel desktop client: Go to Settings → Lock Integration. (Application is required for first‑time access)

Please note it's TTHotel, not TTHotel Pro, TTHotel pro is not supported for integration yet.

Obtain the following two sets of data, which will be used in subsequent steps:

  1. Integration credentials: client id and client secret
  2. Export lock data

image-20261015093306200

Procedure ​

1.Launch the Demo ​

Unzip the downloaded Demo file. Navigate to the path: cardencoderdemo-master\Release\CardEncoderDemo.exe and launch the executable.

The interface will appear as shown in the figure below:

image-20261015094528468

2.Get hotelInfo ​

Paste the client_id and client_secret obtained from the TTHotel desktop client into the corresponding input fields in the Demo. Then click "Get hotelInfo (1)". If the result displays as shown in the figure below, the first‑step execution is successful.

image-20261015095030501

3.Check the serial port used by the card encoder ​

After connecting the card encoder to your PC, press the shortcut key Win + X → open Device Manager, then check the serial port number under Ports.

⚠️ Note: Close other applications that may occupy this serial port, such as TTHotel and third‑party PMS systems.

The Win key is the function key located between the Ctrl and Alt keys at the bottom‑left corner of your computer keyboard.

If this serial port entry does not appear, the driver may be missing. Please refer to: Issues of card encoding

For the E5 card encoder, the displayed port information will differ from what is shown in the screenshot.

image-20261015095455353

4.Connect the Card Encoder ​

Fill in the serial port number into the corresponding field in the Demo, then click "Connect Device Port (2)".

If a connection‑failure prompt appears, the serial port may be occupied by another application. Close other applications, replug the card encoder, and retry within the Demo.

image-20261015095540163

5.Configure the Card Encoder ​

After successful connection, check whether the current card‑encoder sectors (displayed in the Demo) match the sectors used in TTHotel.

You can view the hotel‑used sectors by clicking Hotel → Hotel Information on the top menu bar of the TTHotel desktop client.

TTHotel uses sectors 12, 13, 14, 15, 16 by default. Accordingly, set the sector parameter to 0000000000011111 via this configuration method. (A value of 1 represents an active sector in use.)

  • If the displayed sectors match, as shown in the figure below, simply click "Configure Card Encoder (3)".

    image-20261015104218824

  • If they do not match, enter the correct sector value in the "Sectors to be set" input field. For example, use the TTHotel default sector value 0000000000011111. Next, click "Set Sectors to be used (4)". After the setting completes successfully, click "Configure Card Encoder (3)", as shown in steps 1, 2 and 3 in the figure below.

    image-20261015103225081

6.Initialize card as hotel card ​

Place a blank card on the card encoder, then click "Initialize card as hotel card (5)". This operation initializes and encrypts the blank card into a hotel‑specific card.

  • Encoding a hotel‑specific card for the first time requires encrypting the blank card as a hotel card. If the card has already been encrypted with the current hotel’s information, you may skip "Encode Hotel‑Specific Card (5)" and proceed directly to card‑encoding or card‑reading operations.

  • If error code 106 is returned, the card has already been encrypted for another hotel and is no longer a blank card. You need to restore it to a blank card using the other hotel’s credentials first, then encrypt it with the current hotel’s information.

7.**The above steps are mandatory!!! ** ​

  • After completing all the above steps, you may proceed with operations such as card‑issuing and card‑reading.

  • Once configuration succeeds, you do not need to perform Steps 1‑6 for every subsequent card‑issuing operation.

8. Issue Cards ​

View the lock information for each room from the lock‑data file exported on the TTHotel integration page. Note: Use building and floor numbers, not building or floor names. Pass the validity end time as a timestamp with second‑level precision.

  • The added unlock data is appended instead of overwriting existing data, so multiple unlock‑data entries can be added.

  • Each sector can store 4 pieces of unlock information. The maximum capacity is (4 × number of sectors) entries in total.

Exported lock data (example):

image-20261015103942209

Write data (example):

Note: Write building and floor numbers, not building or floor names.

For testing purposes by non‑programmers, the timestamp shown in the figure 4102301533 corresponds to an expiry date of 2099‑12‑30. You may use this value directly.

image-20261015103419258

9. Read cards ​

Card‑reading can read detailed unlock data stored on the card, such as building number, floor number and MAC address.

If you integrate with a third‑party PMS system and encounter the issue: cards can be issued but cannot unlock locks, while the master card works normally.

Troubleshooting method: Issue the card via PMS first, then perform the card‑reading operation to compare data written on the card with exported lock data. The written lock information (building number, floor number, MAC address) must match the information from the exported lock data.

image-20261015103511347

10.Revoke Lost Cards ​

Enter the "IC card number need to be cancelled (Card A)" and "expire time of cancel card". Place Card B on the card encoder, then click "Issue cancel card (6)".

After the revocation information for Card A is written to Card B, use Card B to unlock the device, so that the revocation information can be synced into the device.

Note: When the revocation operation is executed via the DLL, the configured revocation expiry time will be automatically extended by five years by default.

image-20261015103604791

How to restore a revoked card:

Perform the same operation used for revoking a card, but the setting for revocation expiry time is slightly different.

As mentioned above: when the revocation operation is executed via the DLL, the configured revocation expiry time will be automatically extended by five years by default. Therefore, for restoration, you need to set the revocation expiry time six years earlier.

Example: If the revocation expiry date is 2025‑09‑25, set the timestamp to a year such as 2019 or 2018 for restoration.

FAQs ​

Please refer to:FAQs

CopyRight © 2012-2026 TTLock.All Rights Reserved