SwapSafe – the solution to exchange physical keys

Just finished moving to Spain, working with the crypto guys and being pretty occupied in the important task of measuring the pool temperature, an old business associate “Kasper” phoned me to hear how the weather was. What he really wanted, was my opinion of building a little safe deposit box for exchanging keys between people, an idea he (and some others) reasently had.

He asked: “I know you are in love with those “Raspberry Pi computers”, is it possible to use one of those to open a number of doors in a safe, all controlled by users on a website?”

Obviously my plan of stressing off by the pool was ruined – I mean: “Of cause that should be possible”… “We put rovers on Mars”…

Many months, many many prototypes and lots and lots of sparetime later – we actually produced this solution. In April 2017 I chose to switch my focus to this project and worked on this until the beginning of 2018 as part owner and Server/System responsible. Unfortunately the project ran out of funding and was bought by Norwegian Sharebox.

After ditching the Raspberry Pi, the particle.io’s electron and other platforms, the solution ended up being based on a specialised custom made embedded computer “V1X” – Developed by Prevas. It is equipped with a 4G modem for communication with the grid and a 4,3″ capacitative LCD touchscreen for communicating with the users. The computer is running OE-lite Linux and facilitate overlay filesystem and full remote upgrading of the system, firmware and the running application that was build using QT. The locks are controlled by a RS485 controller and an RFID scanner enables reading the NFC Tags attached to the key bundles.

All communication between the box and the backend servers are done using OpenVPN tunnels through an array of VPN servers. The data is stored locally on the box in a SQLite Database, the messages are dispatched using eMQTT and GO-lang to the Backend server, intercepted by RabbitMQ, stored in a HA PostgreSQL database (chosen because of the need to use PostGIS to ease geo-location search) and the backend facilitate an API access to the frontend servers. An NginX / Rails server is used on Ubuntu platform in a virtual HA environment for the Backend.

The frontend is also based on Ubuntu Linux servers, running NginX, Passenger and Rails. The web applications is up to now build using Ruby on Rails but the API allows any REST and web-hook system to interact.

Monitoring and statistics of the system was build using ElasticSearch-LogStash-Kibana (ELK) – actually we had to build our own “stash” to allow the MQTT messages to be displayed correctly. Nagios and external monitoring is used to ensure alerting on system breakdown.

Administrative interfaces to the backend ensure flexibility of “who may use what” and a provisioning / burn-in test system was build to ease the production.

Besides the “SwapBox”, we used the same foundation to build the framework for “BeachBox” – a solution allowing beach guests to store their valuables in a little “luggage compartment” on the beaches of Marbella. It is unknown if this solution will ever get the funding needed but the allowance from the municipal is ready.

Also the SwapBox got a “Big Tough Brother” – The “SafeBox”. The system we build seems pretty attractive also for handling Car keys. However the disadvantage of a modern Car Key is, that by pressing a button, the car will blink back to you opposite the house keys that could fit anywhere. We build a weapons grade and insurance approved solution to facilitate that problem.

We also asked another old partner “Carsten” if he could design and build a solution for managing the keys found in the Real Estate and Property Managers offices. They have a lot of them so we thought we might assist them in ensuring the whereabouts by building a system to track the keys. This is still being developed and have grown from being a “simple solution” to a “bring any problem on” solution that may well be used as base for all future needs for exchanges.

An interesting and challenging project to be part of.

My role was/is:

  • Prototyping
  • System / solution analysis
  • System Design
  • Implementation – I fail to be an expert Ruby-on-Rails shark but assist in the development as coordinator and tester.
  • System description
  • Documentation
  • Support
  • The problem fixer
  • Spanish / Danish company liaison
  • Assistant manager with our local CEO “Guillermo”.

Follow the project here