Git Product home page Git Product logo

octoprint-usbrelaycontrol's Introduction

OctoPrint USB Relay Control

USB Relay Control adds a sidebar with on/off buttons. You can add as many buttons as you want that will control each USB Relay connected to your Raspberry Pi.

Very useful if you want to add some electronic/improvements to your printer.

GpioControl GpioControl

Note that the layout of the settings in the plugin configuration menu is awful. If anyone knows their way round jinja2 and would like to help fix this, I'd very grateful!

Setup

Install via the bundled Plugin Manager or manually using this URL:

https://github.com/abudden/OctoPrint-USBRelayControl/archive/master.zip

The module depends on the hidapi module, which should be installed automatically. If you have any issues, try installing these packages before installing the plugin:

sudo apt-get install python3-dev libusb-1.0-0-dev libudev-dev

You'll also need to make sure that the USB relay can be controlled without root privileges.

For example, edit /etc/udev/rules.d/99-usbrelay.rules and add this line:

SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="05df", MODE="777"

Then restart your computer.

The vendor ID and product ID (which you'll also need in the octoprint configuration) can be found using the lsusb command. The easiest way to do this is to run lsusb, then plug your device in, then run lsusb again. One new line should have appeared and this will contain the ID XXXX:YYYY where XXXX is the vendor ID and YYYY is the product ID.

Configuration

Just add correct relay configuration:

  • select icon using icon picker (or typing manually) for better identification
  • type name for your device connected to the relay
  • Add the vendor ID and product ID for the relay (defaults to 16C0 and 05DF)
  • Add the relay number on the board
  • select whether relay active corresponds with turning your device on or off
    • active high means that device is on when the relay is activated
    • active low means that device is off when the relay is activated
  • select if device should be on or off by default eg. after startup

Note that there's very little in the way of error checking, so if you put incorrect values into any of the fields, it'll probably break something.

Credits

This plugin was created as a combination of two other excellent projects:

octoprint-usbrelaycontrol's People

Contributors

abudden 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.