HMS and Instrumentation
We've been asked a few time by other spaces about deploying HMS and these are some notes I wrote a while back 'RepRap' Matt |
The following are some notes on what HMS and Instrumentation are and how they go together to form a huge part of Nottinghack.
Terms
Lets start with some names
- HMS (Hackspace Member System) is the name for just the website portion of our membership and RFID systems
We tend to group all the systems with physical components together under the tile Hackspace Instrumentation, this includes some things like
- Gatekeeper is the RFID door access system
- nh-tool covers the RFID tools access
- nh-vend covers the RFID vending machines and cash acceptors
- nh-lighting covers the light control in our space
History
This all started 8 years ago when we moved into our current location and I ('RepRap' Matt) built the first Gatekeeper door control hardware (Arduino, network shield, RFID reader, keypad, lcd, maglock etc)
Others helped by adding a basic database and a single web page to add member names & a pin number to that database
The pin was then used with Gatekeeper to add cards to the database and tie them to a name
A year later we had the first version of HMS, which could handle member sign up, taking in the usual details, sending the a bank payment reference and generating that pin for Gatekeeper
Over the years we just kept adding more features to HMS and Instrumentation.
HMS 2.0 is complete rewrite of the original HMS 1 website
When we took on the downstairs space we redesigned Gatekeeper as well to be our current two reader design
HMS and the Instrumentation project are heavily interdependent, they use the same under lying DB
HMS is basically a php website with a DB. Setup just needs a linux box with nginx,, php-fpm and MariaDB
The instrumentation projects are generally two parts the physical hardware and a server side process
For the physical side we use Arduino’s (these days complete custom PCB’s designed by 'RepRap' Matt)
Server side we have long running C++ processes (thought nh-lighting is written in Swift)
These processes use MQTT to talk over the network
Setup for Instrumenting device to HMS is normally
Arduino + RFID + Wiznet
<> MQTT <> Instrumentation process
<> Stored Procedure
<> DB tables
<> hms2
Most of our code and hardware files are on https://github.com/NottingHack/
Quick pointers to code
- HMS 2.0 https://github.com/NottingHack/hms2
- Instrumentation C++ code is in instrumentation https://github.com/NottingHack/instrumentation
- Database schema is managed by HMS2 but a copy of the table schema and the stored procedures / views are in https://github.com/NottingHack/database
- Arduino code https://github.com/NottingHack/instrumentation-arduino
- nh-lighting code https://github.com/NottingHack/instrumentation-lighting
- Gatekeeper PCB and enclosure https://github.com/NottingHack/Gatekeeper-eagle
Adopting for another Space
Unfortunately we don’t have much in a way of documentation around setting any of this up from scratch
Though HMS and instrumentation have vagrant dev environments that could be used to work out some of it
Building a set of Gatekeeper hardware would need PCB’s ordering and building. Enclosures are laser cut, then there are various other bits of hardware (plastic enclosures, mag locks, etc) require to complete the setup, but again its nothing we really have documented.
A lot of how HMS and instrumentation works under the hood is built around how Nottinghack runs its membership. As you may be aware we run a pay what you like, pay what you use system for our membership fee, payments are made by members into our bank account using standing order with a unique reference
Sign up starts with a prospective member visiting the space during an open hack night where they get a tour of the space and a run down of how we do things, they then registering their interest via HMS (enter an email address).
They then complete the process by entering the usual details, one of our membership team reviews these details and approves them, members then get an email with our bank details and there unique payment reference.
We have some custom code that scrapes our bank accounts website ever weeknight and uploads new transactions into HMS, HMS then does an audit of members, anyone that has not paid in 1.5 months is sent notice, anyone not paid in 2 months is made an ex member.
New members who have now made their first payment are sent a membership complete email and they can visit on the next Wednesday open night to collect an RFID card form one of our membership team ( this is still registered onto the system using the PIN number and the keypad on our original GateKeper hardware)