Skip to main content

Locking and Unlocking the Bike

To prevent replay attacks, the lock and unlock commands use a locking counter. This counter resets to zero each time a new authorized connection is established. Therefore, the counter value for the first lock/unlock command after connecting must be 1 and should increment with every subsequent command, regardless of its success.

note

Unlocking via proximity or automatically is not available in the I LOCK IT sharing firmware. Please contact us if your application requires this functionality.

Additionally, a button-based unlock is possible if the user is authenticated and near the lock (only available if explicitly ordered).


Unlocking

To unlock the lock, send a 16-byte encrypted packet to the relevant characteristic. If unlocking while already unlocked, the I LOCK IT button will flash red as feedback.

  • On success, the button lights green for ~3 seconds and a status notification will be sent.
  • On failure (e.g. mechanical blockage or low battery), an error state will be notified after a timeout (~30 seconds).

Packet format (before encryption):

Byte 0Byte 1Byte 2Byte 3 ... 15
Counter LSBCounter MSB0x010x00 ... padding
  • Encrypt the block using key Ku (or Ka for admin).
  • Increment counter for every new command.

GATT Service Info:

  • Service: Lock Control
    UUID: 0000f00d-1212-efde-1523-785fef13d123
  • Characteristic: Activate Lock
    UUID: 0xBEEE

Locking

To lock the lock, send a 16-byte encrypted packet similar to unlocking. This works only if the lock is either currently unlocked or in an undefined state.

Locking behavior:

  • The lock checks for motion before starting.
  • If no motion, an acoustic signal plays, followed by another check. If still motionless, locking proceeds.
  • If motion is detected or bolt is blocked, an error is notified and a fallback unlock may be attempted.

Packet format (before encryption):

Byte 0Byte 1Byte 2Byte 3 ... 15
Counter LSBCounter MSB0x020x00 ... padding
  • Encrypt the block using Ku or Ka.
  • Counter must start at 1 and be incremented before each command.

GATT Service Info:

  • Same as above.

Unlocking the Chain (Only I LOCK IT PRO)

The plug-in chain/cable typically unlocks together with the main lock. If not, or if the chain is blocked, you may use a separate command:

Packet format (before encryption):

Byte 0Byte 1Byte 2Byte 3 ... 15
Counter LSBCounter MSB0x030x00 ... padding
  • Encrypt with Ku or Ka.

GATT Service Info:

  • Service: Lock Control
    UUID: 0000f00d-1212-efde-1523-785fef13d123
  • Characteristic: Activate Lock
    UUID: 0xBEEE

Locking the Chain (Only I LOCK IT PRO)

To lock the plug-in chain:

Packet format (before encryption):

Byte 0Byte 1Byte 2Byte 3 ... 15
Counter LSBCounter MSB0x040x00 ... padding
  • Encrypt with Ku or Ka.

GATT Service Info:

  • Same as above.

Lock Status

Status values can be read after a successful authentication. The device also sends notifications if the status changes:

ValueDescription
0x00Lock is open
0x01Lock is closed
0x02Lock state is unknown
0x03Lock could not close due to motion
0x04Lock could not open due to blockage
0x05Lock could not close due to blockage

Characteristic Info:

  • Service: Lock Control
    UUID: 0000f00d-1212-efde-1523-785fef13d123
  • Characteristic: Lock state
    UUID: 0xBAAA

Chain Status (Only I LOCK IT PRO)

Provides chain connection and lock state. The data is sent as two bytes:

ByteValueDescription
00x00Chain is not plugged in
0x01Chain is plugged in
10x00Chain is unlocked
0x01Chain is locked

Characteristic Info:

  • Characteristic: Chain state
    UUID: 0xBBBB