-
Notifications
You must be signed in to change notification settings - Fork 7
Detailed Installation
- Configuration Overview
- Configuring the Pins
- Configuring the Doors
- Configuring the Network Settings
- Connecting the Arduino to the PACS device
- Uploading the Door Controller Test Tool Software
- Viewing Debug Messages
Door Controller Test Tool allows for a flexible hardware setup. Before connecting your Arduino to a PACS device, you need to map the Arduino’s pins and assign a PACS function to them. Do this by editing two configuration files, pins.cfg and doors.cfg, which are stored in the /config folder on the sd card of the Arduino Ethernet Shield.
In the pins.cfg file (which is in JSON format), map each Arduino pin number (digital pins: 0-53, analog pins: A0-A15) to a 3-character ID. These IDs can be anything, but must be unique to the pin, exactly 3-characters long and can not be "N/A" (meaning pin is not used) or "RSV" (meaning pin is reserved for other Arduino functionality). In the example pins.cfg, the following IDs are used:
- DM1, DM2, …, DM6: Pool of six door monitors
- RX1, RX2, …, RX6: Pool of six REX devices
- R01, R02, …, R07: Pool of seven Wiegand reader data0
- R11, R12, …, R17: Pool of seven Wiegand reader data1
- GL1, GL2, …, GL7: Pool of seven green led feedback
- BP1, BP2, …, BP7: Pool of seven beeper feedback
- LK1, LK2, …, LK8: Pool of eight lock feedback
- IO1, IO2, …, IO8: Pool of eight I/O contacts
When editing the pins configuration file, keep the following in mind:
- The following pins are reserved on the Arduino Mega 2560 and must ALWAYS be set to "RSV": 0, 1, 4, 10, 50, 51, 52, 53.
- Locks should always be connected to a 5v voltage regulator.
Once you have given the Arduino pins a descriptive ID (essentially creating a "pool" of different input/output PACS peripherals), you can set up doors.
A door, as it is defined in Door Controller Test Tool, is a logical grouping of input and feedback peripherals and is defined in the doors.cfg file (which is also in JSON format).
The doors configuration file consists of:
- The door object, "DOORn", where n should start at 1 and be sequential up to 16, i.e. "DOOR1", "DOOR2", …, "DOOR16". Each door object contains:
- An ID field, "Id", so we can reference this particular door (16 characters maximum).
- A list of reader objects, "Reader", connected to this door. Each reader contains:
- A mandatory direction field, "DirectioN", which can be "In" or "Out", depending on which side of the door the reader is located (this only affects the placement of the visual elements in the Web GUI)
- A mandatory Wiegand object, "Wiegand", with:
- An ID field, "Id", to reference this particular Wiegand peripheral (16 characters maximum).
- Pin fields, "Pin0" and "Pin1", where you link the reader to the physical data0 and data1 pins. These should match entries in the pins.cfg file.
- An optional LED object, "GreenLED", for reading the reader LED feedback of the PACS device, with:
- Default peripheral fields
- An optional beeper object, "Beeper", for reading the reader beeper feedback of the PACS device, with
- Default peripheral fields
- A list of REX objects, "REX", connected to this door, for simulating a REX push button, containing:
- A mandatory direction field, "Direction", which can be "In" or "Out" (this only affects the placement of the visual elements in the Web GUI)
- Default peripheral fields
- A list of door monitor objects, "DoorMonitor", connected to this door, for simulating a door opening or closing, containing:
- Default peripheral fields
- A list of lock objects, "Lock", connected to this door, for reading the lock state of the PACS device, containing:
- Default peripheral fields
- A list of digital input objects, "Input", connected to this door, for activating and deactivating the input on the PACS device containing:
- Default peripheral fields
- A list of digital output objects, "Output", connected to this door, for reading the state of the output on the PACS device containing:
- Default peripheral fields
The default peripheral fields (referenced above) are:
- An ID field, "Id", so we can reference this particular peripheral. A string of at most 16 characters.
- A pin field, "Pin", where we bind the peripheral to a physical pin. This should match an entry in the pins.cfg file, i.e. a 3-character-long string.
- A level field, "ActiveLevel", where we specify at what digital level the peripheral is regarded as active. Can be "HIGH" or "LOW".
Note that even if you are not planning on having a certain peripheral-type in your hardware setup, you still need to include the peripheral object as an empty list in the doors configuration file. For example, if you are not configuring any REX devices, the REX object would look like this:
{
...
"REX": [],
...
}
See below for an example of a second door in a door configuration:
{
...
"DOOR2": {
"Id": "MainEntrance",
"Reader": [{
"Direction": "In",
"Wiegand":{
"Id": "rdrIn",
"Pin0": "R02",
"Pin1": "R12"
},
"GreenLED": {
"Id": "greenLedIn",
"Pin": "GL2",
"ActiveLevel": "LOW"
},
"Beeper":{
"Id": "beeperIn",
"Pin": "BP2",
"ActiveLevel": "LOW"
}
}],
"REX": [{
"Id": "rexOut",
"Direction": "Out",
"Pin": "RX2",
"ActiveLevel": "LOW"
}],
"DoorMonitor": [{
"Id": "doorMonitor",
"Pin": "DM2",
"ActiveLevel": "HIGH"
}],
"Lock": [{
"Id": "lock",
"Pin": "LK2",
"ActiveLevel": "LOW"
}],
"Input": [{
"Id": "Switch",
"Pin": "IO2",
"ActiveLevel": "LOW"
}],
"Output": [{
"Id": "Relay",
"Pin": "IO1",
"ActiveLevel": "LOW"
}]
}
...
}
How the Arduino connects to the local network is defined in the network.cfg file (also a JSON file). An example is provided below:
{
"DHCPEnabled": true,
"MAC": "AA:E9:FB:23:FB:00",
"IP": "192.168.1.15",
"Gateway": "192.168.1.254",
"Subnet": "255.255.255.0",
"DNS": "255.255.255.0",
"HTTPPort": 80,
"WebsocketPort": 8888
}
If the "DHCPEnabled" field is set to true, the "IP", "Gateway", "Subnet" and "DNS" fields are ignored. The DHCP-configured IP settings are printed to the serial port during when the Arduino starts up. To view these, open a serial connection to the Arduino. See "Viewing Debug Messages" for further details.
Otherwise, the fields are pretty much self-explanatory, so we won’t discuss them further here.
When connecting the Arduino pins to the ports of the PACS device, there are a few things to keep in mind:
- The analog inputs of the Arduino can only handle 5V, whereas the PACS device lock might output a higher voltage. Therefore, if the configuration is set up to use a lock peripheral, a 5V voltage regulator MUST be used, so as not to damage the Arduino.
- The Arduino and PACS device need to share a common ground. The ground pins on the Arduino are marked GND. Connect one of these to a ground pin on the PACS device. Not doing this will make the solution behave unpredictably.
- The Arduino needs power, which can be provided in three ways: * Using an Arduino Ethernet Shield with Power over Ethernet and connecting it to a PoE-enabled switch. * Connecting a pin on the PACS device which delivers 7-12V to the Vin pin on the Arduino (not tested). * Using a USB cable from the Arduino to a USB power source.
To upload the software to the Arduino, you need to use the Arduino IDE (the link to download it can be found under Requirements - Software). After installing the IDE, connect the Arduino with the USB cable. Before we upload, a few configuration steps are needed:
- Go to "Preferences" and set the Arduino sketchbook location to the root of the Door Controller Test Tool folder.
- Go to "Tools/Board" and choose the "Arduino Mega 2560 or Mega ADK" option in the list.
- Go to "Tools/Serial Port" and from the list, choose the port where the Arduino is connected.
Now press the "Upload" button. The sketch should compile and upload without errors.
Alternatively, if you just want to flash a binary provided under the "releases" page, you can use the upload script provided in the ./utils folder of the repository (note that this only works on Linux). Refer to the script's help pages for further details.
Information like network- and door-configuration, error messages, etc., is regularly printed to the Arduino serial port. To view these messages, simply connect to the Arduino serial port with a baud rate of 57600.
E.g. in the Arduino IDE:
- Go to "Tools/Serial Port" and from the list, choose the port where the Arduino is connected.
- Go to "Tools" and choose "Serial Monitor".
- In the serial monitor window that appears, choose "57600 baud" from the drop-down list in the bottom right corner.
It is recommended to keep an eye on the debug output during initial setup, so any errors in door/pin configuration, etc. are noticed.