Coder Social home page Coder Social logo

nerddisco / webusb-dmx512-controller Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 1.0 1.08 MB

Manage a DMX512 universe with an Arduino-based controller directly from the browser by leveraging WebUSB

Home Page: https://nerddisco.github.io/webusb-dmx512-controller

License: MIT License

C 2.31% C++ 88.04% JavaScript 9.65%
webusb arduino dmx512

webusb-dmx512-controller's Introduction

WebUSB DMX512 Controller

1.0.0

Manage a DMX512 universe with an Arduino-based controller directly from the browser by leveraging WebUSB.

πŸ‘‰ To fully understand the background of this module you should read the article How to build a WebUSB DMX512 Controller by using an Arduino. πŸ‘ˆ

Table of Contents


ES6 module

The module can be used in projects where you want to control a DMX512 controller over WebUSB. It's written in JavaScript and contains only one Class called Controller.

Install

Install the webusb-dmx512-controller module into your project:

npm install webusb-dmx512-controller

API Documentation

Can be found on API documentation.

Usage

import Controller from 'webusb-dmx512-controller/controller.js'

const controller = new Controller()
const activateButton = document.getElementById('activateWebUsb')

// Listen for click events on the activate button, because
// `controller.enable` must be triggered by a user gesture
activateButton.addEventListener('click', e => {

  // Enable WebUSB and select the Arduino
  controller.enable().then(() => {

    // Create a connection to the selected Arduino
    controller.connect().then(() => {

      // Update the 1 channel of the DMX512 universe with value 255
      controller.updateUniverse(1, 255)
    })
  })
})

Also make sure to take a look the code behind the demo to get more usage examples.

The module is also used in luminave in it's usb-dmx-manager component.

Browser Support

In order to use the module you have to use a browser that supports WebUSB:

  • Chrome 61 + 62: Behind flags
    • chrome://flags/#enable-experimental-web-platform-features
  • Chrome 63+: Native support

Demo

In order to test the WebUSB DMX512 Controller directly in the browser you can use the demo on GitHub. The code behind the demo can be found in the repository.

Run locally

  • Clone this repository
  • Install the dev dependencies by executing npm install inside the repository
  • Execute npm start to start the local web server
  • Open the demo on localhost:8080

Build your own controller

Check out the article "How to build a WebUSB DMX512 Controller by using an Arduino" as it provides a detailed explanation on how to use the content of this repository to build your own WebUSB DMX512 Controller:

Arduino Leonardo with DMX512 shield attached

Hardware

webusb-dmx512-controller's People

Contributors

semantic-release-bot avatar timpietrusky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dominickolbe

webusb-dmx512-controller's Issues

Demo gives 404 errors

Issue description

When opening the demo the following error is thrown:

Failed to load resource: the server responded with a status of 404 (): webusb-dmx512-controller.js 

Steps to reproduce

Version

  • Chrome 65
  • webusb-dmx512-controller 1.0.0-rc.6

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Fixture Generator

Create a fixture yourself using a generator or auto generate fixture.

-> Demo!

DOMException: Unable to claim interface

Issue description

Instead of throwing an error when the DMX512 controller is already used by another browser, the error is caught, which makes it impossible for the user to handle the error themselves.

Steps to reproduce

  • Open your browser and call connect()
  • Open an incognito session and call connect()

Versions

  1. Browser: Chrome 68
  2. webusb-dmx512-controller: 1.0.6

Add link to article

Issue description

The link to the not yet published article is missing in the README.md and the demo. Please add it.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

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.