5 Replies Latest reply on Apr 2, 2017 2:45 PM by johnrellis

    How to send lightroom data to arduino?


      Has anyone done this?


      I'm an industrial design student working on a project in school and I want a two way communication with lightroom. I want to have physical output (LED's, turning knobs) that sits on your desk next to your computer. Send commands from arduino is not a problem, i've done that already but i want output as well

      has anyone any advice where to begin, or anyone could help me out?

      I can program in arduino pretty good, and have some basics in python




        • 1. Re: How to send lightroom data to arduino?
          johnrellis Most Valuable Participant

          (If you haven't already, download the LR 5 SDK, which includes complete documentation.)


          There are a few documented mechanisms for LR plugins to send data to external programs:


          - The LrHTTP module lets plugins invoke URLs with GET or POST commands.  Your external program could implement a local HTTP server to receive those GETs and POSTs from your LR plugin.


          - Your LR plugin could write to a log a file, which your external program could poll continuously for changes.  While this might offend those with more delicate architectural sensibilities, with a little tuning you can make this pretty responsive without costing too much in CPU.


          - Your plugin could invoke an external program via LrTasks.  If the external program is reasonably lightweight, you can do this perhaps several times a second without consuming excessive CPU.


          For receiving data into your LR plugin from an external program:


          - Your plugin can establish a URLHandler that will receive HTTP requests to "lightroom://" URLs made from local programs on your computer.


          - The plugin can poll the external program using LrHTTP using GET and POST commands.  The external program only responds when it has data to send, so the CPU overhead is low.


          - Your plugin could poll a log file written by the external program.  I haven't tried this direction, but it might be harder to tune such polling in this direction, given the limited capabilities of the LR SDK.

          1 person found this helpful
          • 2. Re: How to send lightroom data to arduino?
            johnrellis Most Valuable Participant

            Also, there is an undocument SDK module LrRemoteCommunication that appears to set up a simple two-way pipe with an external program, but no one has posted here how to use it.

            • 3. Re: How to send lightroom data to arduino?
              jarnoh Level 1

              If you are just prototyping, the easiest way might be to use separate layer for MIDI, since there is also easy solutions for using MIDI data on Arduino.  Several MIDI plugins and solutions exist for Lightroom, so you don't even need any Lua development skiils.

              • 4. Re: How to send lightroom data to arduino?

                Actually, while making LR module with Lua, you may use funcitons from io package, such as open a file and write to it.


                Try it out - may be there is a way to associate file with a serial port and write into it, so Arduino catches these submissions and react as you want?

                • 5. Re: How to send lightroom data to arduino?
                  johnrellis Most Valuable Participant

                  LR 6 added LrSocket, which provides Unix-like sockets for communicating with local processes.