Follow

Triggers/API

For technical users who would like to have certain events that occur in dslrBooth trigger an external action, dslrBooth offers Triggers.

Triggers are useful for integrating lights, sounds and other applications with dslrBooth. This will have dslrBooth call an application or a URL when certain events happens. You can set Triggers under: Settings > General > Triggers.

Event Types

The following event types are currently sent:

  • session_start [booth_mode] - When session starts.
  • countdown_start [seconds] - When countdown first starts.
  • countdown [percent_complete] - Updates with percentage of countdown complete.
  • capture_start - When app tells camera to capture a photo.
  • file_download [name_of_file_from_camera] - When a file is received from the camera.
  • processing_start [original_photo_filenames]? [final_file] - When processing of template, gif, boomerang, or video starts after capture is complete. For video/gif/boomerang session, only the final video filename is available.
  • sharing_screen - When sharing screen is displayed.
  • printing [file] [num_copies] [printer_name] - When application is starting to print.
  • file_upload [file] [url] [file_type] [album_name] - When a file is uploaded to fotoshare.co cloud hosting site.
  • session_end - When sharing screen completes and start screen is about to display.

Here are some sample events that you can receive:

16:20:7.287 { event_type: 'session_start', param1: 'PrintAndGIF' }
16:20:7.839 { event_type: 'countdown_start', param1: '5' }
16:20:12.624 { event_type: 'countdown', param1: '20' } 16:20:12.624 { event_type: 'countdown', param1: '50' } ... 16:20:12.624 { event_type: 'countdown', param1: '100' } 16:20:12.626 { event_type: 'capture_start' } 16:20:13.626 { event_type: 'file_download', param1: '20180202_162013_455.jpg' } 16:20:17.559 { event_type: 'processing_start' } 16:20:30.576 { event_type: 'sharing_screen' }
16:20:30.576 { event_type: 'file_upload', param1: 'c:\booth\Videos\encoded\file.mp4', param2: 'https://fotoshare.co/xxxx', param3: 'video', param4: 'Album Name' } 16:19:47.130 { event_type: 'printing', param1:'c:\booth\Prints\file.jpg', param2:'1', param3:'DS-RX1' }
16:19:57.130 { event_type: 'session_end' }

Triggers to URL

dslrBooth will call a URL that you define under settings with different events during a guest's session. Your URL will receive and event type as well as a list of parameters with details on the event. During your development, you can use a site such as request catcher to view the generated events and their properties.

The previous log was generated using this NodeJS but you can do the same in any programming language:

const express = require('express')
const app = express()

app.get('/', function(req, res){
  var today = new Date();
  var time = today.getHours() + ":" + today.getMinutes() + ":" + today.get
Seconds() + "." + today.getMilliseconds();
  console.log(time, req.query);
  res.send('Parameters received: '+ JSON.stringify(req.query));
});
app.listen(3000) ;

Triggers to Application

Similarly, the trigger can execute an application with command line arguments.

[appname.exe] [EventType] [param1?] [param2?] [param3?] ...

Dos Batch File Example

You can use the following batch file to get you started which will receive the event sent from dslrBooth and append it to a text file.

:: contents of test.bat - make sure temp directory exists
@echo off
echo Batch File Started: %date% %time% >> c:\temp\status.txt 
:: Optionally log the received event and params for event types echo Batch file started >> c:\temp\status.txt echo Received event: %~1 >> c:\temp\status.txt echo Received param1: %~2 >> c:\temp\status.txt echo Received param2: %~3 >> c:\temp\status.txt
echo Received param2: %~4 >> c:\temp\status.txt

:: Log the received event and params for a specific event type. IF "%~1"=="countdown_start" ( 
echo "Countdown Started" >> c:\temp\countdown_only.txt
)

:: Optionally log the current date and time echo Completed: %date% %time% >> c:\temp\status.txt
Was this article helpful?
0 out of 2 found this helpful
Have more questions? Submit a request

51 Comments

  • 0
    Avatar
    Mike

    Erik,

    You can use the sample dos batch file example above and use the session_end event to trigger your code.

  • 0
    Avatar
    Erik

    @ Mike - I really appreciate the super prompt response but I am not as clever as you are. any chance you could write out a .bat file with the EXE file being called test.exe?

     

     

  • 0
    Avatar
    Tobias Niepel

    Is the selected number of prints also available in the "printing" event? Is it given as number value via the "param1" GET parameter to a webservice?

    If not, would it be possible to add the number of prints to the trigger?

    (I want to count the prints using a small node webservice so that I can keep track of when the printer's mediakit needs to be replaced in advance)

  • 0
    Avatar
    Tobias Niepel

    Hi Florens! Actually, I would be happy to be enabled to do so myself as I am a software developer in my day job. ;-)
    To me it is important, that I can remotely control some thinks of my photo booth using a smartphone and a web browser. Actually, I could even trigger a session manually from the phone with the press of a button. That frontend should also be able to show a (resettable) print counter, and it would be awesome to have that feature supported in dslrBooth.

    (I assume the piece of software you referenced to is something like PaperCut?)

  • 0
    Avatar
    Mike

    Tobias, the number of prints is not yet available. Please add your suggestion here.

  • 0
    Avatar
    Nick Elia

    Hey everybody,

     

    This is all extremely new to me. I recently purchased a photo booth that came equipped with an ICT bill acceptor. The software we're currently using is terrible and we'd like to test out the dslrBooth.

    I would like to trigger the application to start a session after money has been inserted. But I have no idea where to start.

    My bill acceptor can work in pulse mode, but I don't understand how to write the commands to communicate with it.

    Any assistance will be greatly appreciated.

    Thank you

     

  • 0
    Avatar
    Erik

    ok, I'm back...

    In DSLR Booth, under Triggers I launch the file c:\test.bat (which is exactly where the bat file is - so far so good. 

    The Bat file has the following code: (copied and pasted from previous poster) and with Serialsend.exe on c:\ root directory 

    ---

     @echo off
    IF "%1"=="session_start" (
    start /b c:\serialsend.exe com3 /baudrate 9600 "%2"
    )

    ---

    When I start a session it triggers the arduino as desired - whoop whoop

    Unfortunately ..... I need to receive a trigger either when the session ends, or when printing starts.... The way I see it the session_start is the firstpossible trigger so it makes sense that it is picked up immediately .... i want the trigger 20 seconds into the session - by then, I assume my bat file is closed and forgotten? 

     

    anyone willing to throw in their 5c worth? I am about to give up completely

  • 1
    Avatar
    Mike

    @Erik

    IF "%1"=="session_start" (
    start /b c:\serialsend.exe com3 /baudrate 9600 "%2"
    )

    IF "%1"=="sharing_screen" (
    # send different command here
    )

  • 0
    Avatar
    Erik

    @Mike

     

    You rock

  • 1
    Avatar
    Julien Duijsens

    Hello,

    is it possible to create an event when the application start and when you close the application?

    it's important to initialize the lamps and I'm also using a Neo ring around the lens of the camera to get attention and catch the eye.

    thank you !

  • 0
    Avatar
    Mike

    Hey Julien, there's no event for start and close but you can suggest here.

  • 0
    Avatar
    Lars Wiczynski

    Hey Mike,

     

    can save the fotoshare link for every new picture with Trigger/api session ?

     

     

  • 0
    Avatar
    Mike

    Hey Lars, there's no event for the fotoshare link but you can suggest here.

  • 1
    Avatar
    ali edi

    Hi John it is posible to give me your code for the booth, to used with ws2812 and arduino.  It was very helpful for me.
    aliediz@gmx.de
    many thanks.
     
    edi

  • 0
    Avatar
    Giorgos Argyris

    Hello
    I want to program my led ring, so that all the leds are off when camera captures pictures.
    I have the following code to my led_ring.bat file:
    ......
    IF "%1"=="capture_start" (
    echo s 100 >COM3
    echo c 0x888888 >COM3
    echo b 15 > COM3
    echo m 26 > COM3
    .......

    I tried changing : "echo b 15 > COM3 to echo b 0 > COM3" so brightens is 0, but didn't work.
    Any ideas?

    Email: giorgos.argyris@hotmail.com

     

    Edited by Giorgos Argyris
  • 0
    Avatar
    Smart Magic Mirror

    Can Anyone provide us detail coding  to place ring light with audrino. I want the ring light to start on countdown and close when it displays 1 in countdown. I am not a programmer, if anyone could help, please mail to smartselfiebooths@gmail.com

  • 0
    Avatar
    Tim Kropp

    Hi there,

     

    I´ve created a batch file which is talking to an arduino to activate GPIOs...

    I´ve updated to the latest version 5.28 and I want to add the video start trigger but it doesn´t work I´ve tried 

    "session_start video"

    "session_start [video]"

    "session_start[video]"

    in photo mode everything is working but I cannot find the correct Trigger name I have to set, when I am starting video record...

    This is my batch file:

    @echo off
    IF "%1"=="session_start[video]" (
    start /b c:\Users\timkr\SerialSend.exe /baudrate 9600 /devnum 11 SwitchVideoOn
    exit
    )

    IF "%1"=="countdown_start" (
    start /b c:\Users\timkr\SerialSend.exe /baudrate 9600 /devnum 11 SwitchRelayON
    exit
    )

    IF "%1"=="session_end" (
    start /b c:\Users\timkr\SerialSend.exe /baudrate 9600 /devnum 11 SwitchRelayOFF
    exit
    )

     

    Please help.

    thanks in advance

    Tim

  • 0
    Avatar
    Smart Magic Mirror

    Hi Tim,

    Can you help me and provide coding with step by step guide to a layman for led ring light setup in photo mode. I have loaded to arduino a ring light ready made blink kind of coding through internet. I will be very thankful to you.

    smartselfiebooths@gmail.com

    Raghav

  • 0
    Avatar
    Mike

    @Tim,

    The first argument is "session_start" which will be stored in %1.

    The second argument for a video session would be "Video" which would be stored in %2

    IF "%1"=="session_start" (

        :: A session of type %2 started (Photo, Video, Gif, boomerang)

      IF "%2" == "Video" (

        :: Video session started

      )

    )

    Edited by Mike
  • 0
    Avatar
    Smart Magic Mirror

    Hi Tim,

    At least can you please share the relay model to be used to power arduino. Rest I have found and worked upon. smartselfiebooths@gmail.com.

    Any help regarding this would be apreciated.

     

  • 0
    Avatar
    Daniel Schwarz

    hi, i dont know what the "param1" Param2" etc means....could anyone explain?

Please sign in to leave a comment.