GithubHelp home page GithubHelp logo

lwgboy / rest2sacn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from localleon/rest2sacn

0.0 1.0 0.0 11 KB

Translating HTTP Requests via a REST Api to sACN DMX Signals.

License: MIT License

Go 100.00%

rest2sacn's Introduction

project_logo

rest2sacn

Translator to send DMX Data over sACN via a simple HTTP Request.

This is a simple translator for devices that are not able to send sACN Data on their own. If you want to send some simple DMX Data over the network you can just send an HTTP Request with a super simple syntax to this API and the server will send out the corresponding DMX Data.

This project currently only supports sACN Unicast. It is not intended for high throughput applications (use a native sACN device for this). If you just want to control a single channel, this is fine. Latency is also not too bad.

Concept

The original idea that lead to the creation of this project was the following: I needed a way to press some executors on my grandMA2 Lighting Desk via my Win10 Computer. I wanted to press an executor on my MA2, if I press one key on my computer. Because I was heavily invested into the AutoHotKey ecosystem, I just wanted to integrate this thing into one of my existing macros. The Simplest way was to do this via sending an HTTP Request from the AutHotKey Macro. This results in the following workflow:

                     +----------------------+  UDP sACN     +-------------------------+
HTTP Request  +----> |      rest2sacn       | +-----------> |      Lighting Desk or   |
                     |  Translating.....    |               |      Lamp, DMX Fixture  |
                     +----------------------+               +-------------------------+

Config File

The server is configured via a YAML config file. An example file is included and looks like the following:

# Simple config to control which universes should be translated/sent.

universe: [69,70]   # Universes that should be available to control.
ip: "127.0.0.1:8080" # On which IP should rest2sacn listen?
destination: "127.0.0.1"    # IP of the device the sACN data should be transmitted.

The configuration parameters are pretty self explanatory. Here you should list all universes that you want to control via the REST API. If a universe is not listed in the config file it can't be controlled via the API.

API

The REST API of this project is very straight forward. It does not use any sort of authentication as it is intended to be run only on localhost or on protected Networks.

These are the following endpoints:

/sacn/reset/{universe}
/sacn/send/{universe}/{channel}/{value}

/sacn/send/{universe}/{channel}/{value}

This is the Endpoint that is responsible for sending all the data. It takes the 3 typical DMX Parameter. They should be in the following number range:

  • universe: 1-63999
  • channel: 1-512
  • value: 0-255

If you send a request with these parameters the program immediately sets the corresponding channel to the sent value. The data doesn't change till the next requests is received.

/sacn/reset/{universe}

Takes an Universe Number and sets the output of the universe to 0 on all Channels

Copyright / Stuff

This Project is under the MIT License by @localleon 2019. Contributions or Questions are welcome.

rest2sacn's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.