diff --git a/config/config.inc.php b/config/config.inc.php
index 2c3140dc9..42327dcc0 100644
--- a/config/config.inc.php
+++ b/config/config.inc.php
@@ -229,9 +229,12 @@
// R E M O T E B U Z Z E R
-$config['remotebuzzer']['enabled'] = false;
+$config['remotebuzzer']['usebuttons'] = false;
$config['remotebuzzer']['userotary'] = false;
$config['remotebuzzer']['enable_standalonegallery'] = false;
+$config['remotebuzzer']['rotaryclkgpio'] = 27;
+$config['remotebuzzer']['rotarydtgpio'] = 17;
+$config['remotebuzzer']['rotarybtngpio'] = 22;
$config['remotebuzzer']['picturebutton'] = true;
// collagetime controls the time to distinguish picture from collage in seconds
$config['remotebuzzer']['collagetime'] = '2';
diff --git a/faq/faq.md b/faq/faq.md
index c7edadc5b..ba0cafacd 100644
--- a/faq/faq.md
+++ b/faq/faq.md
@@ -116,12 +116,12 @@ Follow the steps mentioned here: [How to Fix NGINX 413 Request Entity Too Large
Yes, the **Hardware Button** feature enables to control Photobooth through hardware buttons connected to Raspberry GPIO pins . This works for directly connected screens and as well for WLAN connected screen (i.e. iPad). Configuration takes place in the admin settings - Hardware Button section.
The Hardware Button functionality supports two separate modes of operation (select via admin panel):
-- **Button Mode**: Distinct hardware buttons can be connected to distinct GPIOs. Each button will trigger a separate functionality (i.e. take photo).
-- **Rotary Mode**: A rotary encoder connected to GPIOs will drive the input on the screen. This enables to use the rotary to scroll through the Photobooth UI buttons, and click to select actions.
+- **Buttons**: Distinct hardware buttons can be connected to distinct GPIOs. Each button will trigger a separate functionality (i.e. take photo).
+- **Rotary Encoder**: A rotary encoder connected to GPIOs will drive the input on the screen. This enables to use the rotary to scroll through the Photobooth UI buttons, and click to select actions.
-Modes can not be combined.
+Both buttons and rotary encoder controls can be combined.
-In any mode, Photobooth will watch GPIOs for a PIN_DOWN event - so the hardware button needs to pull the GPIO to ground, for to trigger. This requires the GPIOs to be configured in PULLUP mode - always.
+Photobooth will watch GPIOs for a PIN_DOWN event - so the hardware button needs to pull the GPIO to ground, for to trigger. This requires the GPIOs to be configured in PULLUP mode - always.
Troubleshooting / Debugging:
@@ -135,7 +135,7 @@ Troubleshooting / Debugging:
- GPIOs may not be configured as PULLUP. The configuration for this is done in fie `/boot/config.txt` by adding the GPIO numbers in use as follows - you **must reboot** the Raspberry Pi in order to activate changes in this setting.
```
- gpio=16,20,21,26=pu
+ gpio=16,17,20,21,22,26,27=pu
```
- For the Shutdown button to work, `www-data` needs to have the necessary sudo permissions. This is done by the `install-raspian.sh` script or can be manually added as
@@ -149,10 +149,10 @@ Troubleshooting / Debugging:
As of Photobooth v3, hardware button support is fully integrated into Photobooth. Therefore the `button.py` script has been removed from the distribution. In case you are using this script and for continued backward compatibility please do not activate the Remote Buzzer Hardware Button feature in the admin GUI. Please note that continued backward compatibility is not guaranteed and in case of issues please switch to the integrated functionality.
-***************
-**Button Mode**
-***************
-The server supports up to three connected hardware buttons for the following functionalities:
+******************
+**Button Support**
+******************
+The server supports up to four connected hardware buttons for the following functionalities:
1) **Picture Button**
@@ -183,24 +183,43 @@ Note:
- Hold the button for a defined time to initiate the shut down (defaults to 5 seconds). This can be adjusted in the admin settings.
- The shutdown button will only trigger if there is currently no action in progress in Photobooth (picture, collage).
+4) **Print Button**
+
+- Defaults to GPIO26
+- This button will initiate a print of the current picture either from the results screen or the gallery.
+
+
After any button is triggered, all hardware button remain disabled until the action (picture / collage) completed. Once completed, the hardware buttons re-arms / are active again.
-***************
-**Rotary Mode**
-***************
-In rotary mode a rotary encoder (i.e. [KY-040](https://sensorkit.en.joy-it.net/index.php?title=KY-040_Rotary_encoder)) is connected to the GPIOs. Turning the rotary left / right will navigate through the currently visible set of buttons on the screen. Button press on the rotary will activate the currently highlighted button in Photobooth.
+The wiring layout is
+
+```
+Button Raspberry
+
+Picture --- GPIO 21
+Collage --- GPIO 20
+Shutdown --- GPIO 16
+Print --- GPIO 26
+All --- GND
+```
+
+
+******************
+**Rotary Encoder**
+******************
+A rotary encoder (i.e. [KY-040](https://sensorkit.en.joy-it.net/index.php?title=KY-040_Rotary_encoder)) is connected to the GPIOs. Turning the rotary left / right will navigate through the currently visible set of buttons on the screen. Button press on the rotary will activate the currently highlighted button in Photobooth.
The wiring layout is
```
-Button Rotary Encoder
-Mode Raspberry Mode
+Rotary
+Encoder Raspberry
-Picture --- GPIO 21 --- DT
-Collage --- GPIO 20 --- CLK
-Shutdown --- GPIO 16 --- SW
- 3V3 --- +
- GND --- GND
+CLK --- GPIO 27
+DT --- GPIO 17
+BTN --- GPIO 22
++ --- 3V3
+GND --- GND
```
Known limitations:
@@ -215,7 +234,7 @@ Other Remote Trigger (experimental)
**************
The trigger server controls and coordinates sending commands via socket.io to the photobooth client. Next to a hardware button, any socket.io client can connect to the trigger server over the network, and send a trigger command. This gives full flexibility to integrate other backend systems for trigger signals.
-- Channel: `photobooth-socket`
+- Channel: `photobooth-socket`
- Commands: `start-picture`, `start-collage`
- Response: `completed` will be emitted to the client, once photobooth finished the task
diff --git a/install-raspbian.sh b/install-raspbian.sh
index c63b13d37..f50d2d8ca 100755
--- a/install-raspbian.sh
+++ b/install-raspbian.sh
@@ -347,7 +347,7 @@ fi
sed -i '/Photobooth/,/Photobooth End/d' /boot/config.txt
cat >> /boot/config.txt << EOF
# Photobooth
-gpio=16,20,21,26=pu
+gpio=16,17,20,21,22,26,27=pu
# Photobooth End
EOF
# add configuration required for www-data to be able to initiate system shutdown
@@ -356,6 +356,9 @@ cat >> /etc/sudoers.d/020_www-data-shutdown << EOF
# Photobooth Remotebuzzer shutdown button for www-data to shutdown the system
www-data ALL=(ALL) NOPASSWD: /sbin/shutdown
EOF
+
+# update artifacts in user configuration from old remotebuzzer implementation
+sed -i '/remotebuzzer/{n;n;s/enabled/usebuttons/}' $INSTALLFOLDERPATH/config/my.config.inc.php
fi
# remotebuzzer config depending on version end
diff --git a/lib/configsetup.inc.php b/lib/configsetup.inc.php
index da3a0306d..9ddb7bc49 100644
--- a/lib/configsetup.inc.php
+++ b/lib/configsetup.inc.php
@@ -1329,11 +1329,11 @@
'remotebuzzer' => [
'view' => 'advanced',
'platform' => 'linux',
- 'remotebuzzer_enabled' => [
+ 'remotebuzzer_usebuttons' => [
'view' => 'advanced',
'type' => 'checkbox',
- 'name' => 'remotebuzzer[enabled]',
- 'value' => $config['remotebuzzer']['enabled'],
+ 'name' => 'remotebuzzer[usebuttons]',
+ 'value' => $config['remotebuzzer']['usebuttons'],
],
'remotebuzzer_userotary' => [
'view' => 'advanced',
@@ -1341,13 +1341,6 @@
'name' => 'remotebuzzer[userotary]',
'value' => $config['remotebuzzer']['userotary'],
],
- 'remotebuzzer_enable_standalonegallery' => [
- 'view' => 'expert',
- 'type' => 'checkbox',
- 'name' => 'remotebuzzer[enable_standalonegallery]',
- 'value' => $config['remotebuzzer']['enable_standalonegallery'],
- ],
-
'remotebuzzer_picturebutton' => [
'view' => 'advanced',
'type' => 'checkbox',
@@ -1422,6 +1415,33 @@
'range_step' => 1,
'unit' => 'seconds',
],
+ 'remotebuzzer_rotaryclkgpio' => [
+ 'view' => 'expert',
+ 'type' => 'hidden',
+ 'placeholder' => $defaultConfig['remotebuzzer']['rotaryclkgpio'],
+ 'name' => 'remotebuzzer[rotaryclkgpio]',
+ 'value' => $config['remotebuzzer']['rotaryclkgpio'],
+ ],
+ 'remotebuzzer_rotarydtgpio' => [
+ 'view' => 'expert',
+ 'type' => 'hidden',
+ 'placeholder' => $defaultConfig['remotebuzzer']['rotarydtgpio'],
+ 'name' => 'remotebuzzer[rotarydtgpio]',
+ 'value' => $config['remotebuzzer']['rotarydtgpio'],
+ ],
+ 'remotebuzzer_rotarybtngpio' => [
+ 'view' => 'expert',
+ 'type' => 'hidden',
+ 'placeholder' => $defaultConfig['remotebuzzer']['rotarybtngpio'],
+ 'name' => 'remotebuzzer[rotarybtngpio]',
+ 'value' => $config['remotebuzzer']['rotarybtngpio'],
+ ],
+ 'remotebuzzer_enable_standalonegallery' => [
+ 'view' => 'expert',
+ 'type' => 'checkbox',
+ 'name' => 'remotebuzzer[enable_standalonegallery]',
+ 'value' => $config['remotebuzzer']['enable_standalonegallery'],
+ ],
'remotebuzzer_logfile' => [
'view' => 'expert',
'type' => 'hidden',
diff --git a/lib/services_start.php b/lib/services_start.php
index 09c4c05dc..bc170faf1 100644
--- a/lib/services_start.php
+++ b/lib/services_start.php
@@ -15,7 +15,7 @@ function processIsRunning($pName, $pidFile) {
return count($output) - 1 ? true : false; // true if process is active
}
-if ($config['remotebuzzer']['enabled']) {
+if ($config['remotebuzzer']['usebuttons'] || $config['remotebuzzer']['userotary']) {
$connection = @fsockopen('127.0.0.1', $config['remotebuzzer']['port']);
if (!is_resource($connection)) {
diff --git a/livechroma.php b/livechroma.php
index 13e95e8c0..e8b3b13b1 100644
--- a/livechroma.php
+++ b/livechroma.php
@@ -173,5 +173,10 @@
+
+
+