Project Deadlock

or

How big doors can be opened by small ideas

We will talk about...

What is it?

How does it work?

What advantages does it have?

What is it

A system for unlocking doors. And more.

Embedded

Hardware

+

// __attribute__((OS_main)) tells the compiler that this function never
// returns and saves us precious space
__attribute__((OS_main)) int main(void) {

    hal_init(&comm_byte_received_callback);

    // This is the main handling loop
    // It handles all packets that can arrive in the Normal mode
    while (1) {
        if (comm_wait_for_packet(&p[current_packet]) == 0) {
            switch (p[current_packet].id) {
                case packet_GET_STATUS:
                    sendACK();
                    break;
                case packet_RFID_SEND:
                    // We will send data from this packet, and replace them
                    // in-place with what we receive
                    hal_spi_begin_transaction();
                    for (uint8_t i = 0; i < p[current_packet].length; i++) {
                        p[current_packet].data[i] =
                            hal_spi_transfer(p[current_packet].data[i]);
                    }
                    hal_spi_end_transaction();
                    // And suddenly, we are a response packet :)
                    p[current_packet].id = packet_RFID_SEND_COMPLETE;
                    transmit_and_flip();
                    break;
                case packet_RX_ERROR:
                    // Retransmit the last packet
                    comm_transmit_packet(&p[current_packet ^ 1]);
                    break;
                default:
                    // Unacceptable packet was received in this mode
                    p[current_packet].id = packet_INVALID_PACKET;
                    p[current_packet].length = 0;
                    transmit_and_flip();
                    break;

Software

But we already have this system

Bad technical status, the vendor has disappeared

New deployment is not possible. Pain in the neck to maintain the current one

System can't support future changes in ISICs and can't be extended

How does it work?

System architecture

Server

Controller

Reader

Reader

  • Reads ID from an ISIC card
  • Blinks and beeps :)
  • Uses our custom interface or USB
  • ARM Cortex M0 MCU
  • Programmed in C (+ ChibiOS)

Controller ↔ Reader

  • Our custom interface
  • Simple to setup from available components
  • Power + communication
  • Based on RS-232

Controller

  • Controls single door
      - Searches database and grants access
      - Sends logs to the server
  • (optional) Power over Ethernet
  • ARM Cortex M0 MCU
  • Programmed in C (+ ChibiOS)

Server ↔ Controller

  • Utilizes existing network
  • Power over Ethernet
  • UDP-based communication protocol
  • Encrypted communication

Server

  • "One server to rule them all"
  • Manages access database
  • Distributes access database to doors
  • Provides support functions for embedded devices (logs, firmware upgrades)

What advantages does it have over the old system?

Price

An order of magnitude cheaper than commercial alternative

Open source &

Open hardware

No vendor lock-in

Built from available components

Easy to setup and maintain

Plug-and-play setup

Extensibility of deployment

HW can be easily replaced

Future-proof

Modular architecture

Ready to support future changes in ISICs

Conclusion

What is it?

How does it work?

What advantages does it have?

Thank you for your attention!

https://github.com/fmfi-svt-deadlock

svt.fmph.uniba.sk        fmfi-svt@googlegroups.com