Skip to content

Commit

Permalink
Update config files and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
trappitsch committed Jan 11, 2024
1 parent f6eb137 commit e96d9b1
Show file tree
Hide file tree
Showing 15 changed files with 340 additions and 15 deletions.
32 changes: 32 additions & 0 deletions controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,38 @@ Here you can configure if you want the status of channels to be automatically re
and how often (in seconds) this should be done.
When you are done, hit "Ok" to save the settings.

## Lockouts

The GUI does not behave differently depending on which lockout is active.

### Interlock safety

If enabled in the firmware,
the interlock safety -- if triggered --
will disable sending commands to the hardware from any input method.
The GUI will change its behavior to reflect this and,
after reading the hardware,
gray out all interaction buttons.

If the interlock safety is triggered,
all channels will turned off and stay off.
Neither the software,
nor the remote can overwrite this.

### Software lockout

The remote can be configured to have a software lockout button,
see firmware notes.
If enabled,
the GUI will change its behavior to reflect this and,
after reading the hardware,
gray out all interaction buttons.

If the software lockout is triggered,
the software will not be allowed to change the state of any channel.
However, the remote can still change the state of the channels.


## Saving your configuration file / loading a configuration file

The "File" entry in the menu bar allows you to save the current configuration
Expand Down
7 changes: 5 additions & 2 deletions controller/release_text.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
This is the first version of the DigOutBox controller.
This is DigOutBox controller `gui_v0.2.0`.

Please read the readme file for more information on how to set up and use this program. You can find it [here](https://github.com/galactic-forensics/DigOutBox/tree/main/controller).

Fixes/enhancements in this minor version `gui_v0.1.1`:
**Important**: This version of the GUI needs the DigOutBox firmware version `v0.2.0` or higher and requires CLI version `v0.2.0` or higher.

Fixes/enhancements in this version:

- Software lockout functionality has been added to the GUI. If software lockout is activated via the remote, the GUI will not be able to change the state of the channels. The GUI will still be able to read the state of the channels.
- Extended help via tooltips
23 changes: 11 additions & 12 deletions firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ this should be fairly straightforward.
However,
you might need to detect and register new remotes.

There are currently two types of firmware available.

- `DigoutBox_fw_v*.ino`: This is the default firmware for the DigOutBox.
- `DigoutBox_interlocked_fw*.ino`: This is the firmware for an interlocked version of the DigOutBox.
In order to control channels, you need to short the interlock/trigger channel to ground.
The interlock channel on the existing boxes and in the hardware design is currently called `TRIG`.
If this channel is open or at 5V, all channels are off and cannot be turned on.

The firmware is written in `C` and uses the Arduino framework.
You can find the current version `v0.1.0`
You can find the current version `v0.2.0`
in the respectively labeled sub folders.
Old firmware can be found in the `old` folder.
There are two files:
- `*fw*.ino`: This is the main file that contains the firmware.
- `config.h`: This file contains the configuration of the firmware.
Expand Down Expand Up @@ -53,7 +46,7 @@ It contains the following variables:
- `fw_version`: The firmware version.
- `hw_version`: The hardware version.

### User setupcd
### User setup

This section contains the user setup.
If you have a box with an existing setup,
Expand All @@ -63,15 +56,21 @@ The section contains the following variables:
- `debug`: If set to `true`, the Arduino will print debug messages to the serial port.
This is mainly used to set up new remotes (see below).
- `rf_delay`: Set the delay time after accepting a second remote control command in ms.
- `InterlockIn`: (Only used on `interlocked` firmware version)
- `InterlockPin`:
The number of the digital input pin that is connected to the interlock/trigger channel.
If this pin is open or at 5V, all channels are off and cannot be turned on.
Note that the channel must be an interrupt pin (default: `3`).
- `EnableInterlock`: If set to `true`, the interlock is enabled.
If set to `false`, the interlock is disabled and `InterlockPin` functionality has no meaning.
- `SoftwareLockoutDoubleClickTime`: Sets the time in ms on how fast a double click on the remote
has to take place in order to deactivate the software lockout.
Note that the second click has to come after the `rf_delay` time window!
- `RFChannels`: Array that maps the buttons of the remote control to the channels of the DigOut Box.
This array has `numOfRemoteButtons` elements.
Each element is an integer that maps the button to a channel.
"Channel" `-1` means that this button will turn all channels off.
"Channel" `-2` means that this button is unused.
"Channel" `-2` means that this button will be used to toggle the software lockout.
"Channel" `-3` means that this button is unused.
- `DOutInvert`: Array that defines the "off-state" of a channel.
This array has `numOfChannels` elements.
Each element is either `0` or `1` and defines the "off-state" of a channel.
Expand Down
5 changes: 5 additions & 0 deletions firmware/configs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Config files for "supported" boxes

This folder contains config files for boxes that I actively support.
You can generally ignore the content of this folder,
unless I tell you otherwise.
143 changes: 143 additions & 0 deletions firmware/configs/gfl002_fw_v020.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
* Configuration for DigOutBox.
* This file sets the DigOutBox up for your specific system.
*/

// **************************
// DIGOUTBOX HW CONFIGURATION
// **************************

// Initial output for the following serial numbers:
// - llnl001, gfl002

// Channels and remote control buttons
const int numOfChannels = 16;
const int numOfRemoteButtons = 10;

// hard- and firmware versions
const char fw_version[7] = "v0.2.0";
const char hw_version[7] = "v0.1.0";


// **********
// USER SETUP
// **********



// Debug mode, additional comments aside from SCPI commands are sent over serial
const bool debug = false;

// Set delay in ms after valid RF press
const int rf_delay = 500;

// Interlock pin
const int InterlockPin = 3;

// Turn interlock mode on (true) or off (false)
const bool EnableInterlock = true;

// Software lockout time window (in ms) for double click (second click has to come after `rf_delay`!)
const unsigned long SoftwareLockoutDoubleClickTime = 3000;

// Associate remote buttons with channels, -1 for ALL OFF, -2 for software lockout toggling, -3 for None
const int RFChannels[numOfRemoteButtons] = {
0,
1,
2,
3,
4,
5,
8,
9,
-2,
-1
};

// Define the "off-state" of all channels?
// 0: LOW / 1: HIGH
const int DOutInvert[numOfChannels] = {
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
};

// *****************************
// BOARD & REMOTE SPECIFIC SETUP
// *****************************

// Channels: A, B, C, D, E, F, G, H, 1, 2, 3, 4, 5, 6, 7, 8

// Setup of pins for the digital outputs
const int DOut[numOfChannels] = {
36,
34,
32,
30,
28,
26,
24,
22,
52,
50,
48,
46,
44,
42,
40,
38
};

// Setup of pins for LEDs
const int LedPins[numOfChannels] = {
37,
35,
33,
31,
29,
27,
25,
23,
53,
51,
49,
47,
45,
43,
41,
39
};

// Interrupt the RF Receiver is connected to (NOT pin number!)
const int RFInterrupt = 0; // Which interrupt does the R receiver sit on? NOT pin!

// Number of remotes
const int numOfRemotes = 2;

// RF codes for Remotes, number must be defined before
const long RFRemoteCodes[numOfRemoteButtons][numOfRemotes] {
{4543795, 349491},
{4543804, 349500},
{4543939, 349635},
{4543948, 349644},
{4544259, 349955},
{4544268, 349964},
{4545795, 351491},
{4545804, 351500},
{4551939, 357635},
{4551948, 357644}

};
Binary file added firmware/configs/gfl002_fw_v020.xlsx
Binary file not shown.
143 changes: 143 additions & 0 deletions firmware/configs/llnl001_fw_v020.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
* Configuration for DigOutBox.
* This file sets the DigOutBox up for your specific system.
*/

// **************************
// DIGOUTBOX HW CONFIGURATION
// **************************

// Initial output for the following serial numbers:
// - llnl001, gfl002

// Channels and remote control buttons
const int numOfChannels = 16;
const int numOfRemoteButtons = 10;

// hard- and firmware versions
const char fw_version[7] = "v0.2.0";
const char hw_version[7] = "v0.1.0";


// **********
// USER SETUP
// **********



// Debug mode, additional comments aside from SCPI commands are sent over serial
const bool debug = false;

// Set delay in ms after valid RF press
const int rf_delay = 500;

// Interlock pin
const int InterlockPin = 3;

// Turn interlock mode on (true) or off (false)
const bool EnableInterlock = true;

// Software lockout time window (in ms) for double click (second click has to come after `rf_delay`!)
const unsigned long SoftwareLockoutDoubleClickTime = 3000;

// Associate remote buttons with channels, -1 for ALL OFF, -2 for software lockout toggling, -3 for None
const int RFChannels[numOfRemoteButtons] = {
0,
1,
2,
3,
4,
5,
8,
9,
-2,
-1
};

// Define the "off-state" of all channels?
// 0: LOW / 1: HIGH
const int DOutInvert[numOfChannels] = {
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
};

// *****************************
// BOARD & REMOTE SPECIFIC SETUP
// *****************************

// Channels: A, B, C, D, E, F, G, H, 1, 2, 3, 4, 5, 6, 7, 8

// Setup of pins for the digital outputs
const int DOut[numOfChannels] = {
36,
34,
32,
30,
28,
26,
24,
22,
52,
50,
48,
46,
44,
42,
40,
38
};

// Setup of pins for LEDs
const int LedPins[numOfChannels] = {
37,
35,
33,
31,
29,
27,
25,
23,
53,
51,
49,
47,
45,
43,
41,
39
};

// Interrupt the RF Receiver is connected to (NOT pin number!)
const int RFInterrupt = 0; // Which interrupt does the R receiver sit on? NOT pin!

// Number of remotes
const int numOfRemotes = 2;

// RF codes for Remotes, number must be defined before
const long RFRemoteCodes[numOfRemoteButtons][numOfRemotes] {
{4543795, 349491},
{4543804, 349500},
{4543939, 349635},
{4543948, 349644},
{4544259, 349955},
{4544268, 349964},
{4545795, 351491},
{4545804, 351500},
{4551939, 357635},
{4551948, 357644}

};
Binary file added firmware/configs/llnl001_fw_v020.xlsx
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e96d9b1

Please sign in to comment.