Giter Site home page Giter Site logo

abudden / octoprint-usbrelaycontrol Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 2.0 77 KB

Plugin for OctoPrint for controlling HID-based USB relays

License: GNU Affero General Public License v3.0

Python 72.23% CSS 1.28% JavaScript 12.82% Jinja 13.67%

octoprint-usbrelaycontrol's People

Contributors

abudden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hackerseal odohu

octoprint-usbrelaycontrol's Issues

Any reason this plugin wouldnt work with Octo4A?

Is there any reason this plugin wouldn't work with the Android app port of Octoprint, Octo4a?
I have reason to think the Android app has a way of communicating HID interface information to the server and back, since that is how the printer is connected.
As long as I put the correct information in the configuration for VID and PID, will this still work?

Unable to activate a button in side bar

Hello,

I've been receive my USB relay board. I've been connected it into my Raspberry Pi with octoprint. In SSH I've find the vendor code and the vendor product which are good 16c0 and 05dF.

I've configure my first action for my Led bar, as ACTIVE : HIGH / DEFAULT : OFF / RELAY No : 1

I've been restart my RaspberryPi and in the side bar both button ON and OFF are not enable to click it ...

Any idea ?

Thanks !

RGB Controll for different status

Hello
Would like to Love to manage RGB USB Leds to underline the different Status of a printer with color
Cold is blue heating is red Printing is White Pause is yellow ....
Thanks in advance

[Feature Request] Action Command Support

It would be nice if this plugin supported the Action Command feature of GCODE. This would allow more things to control the relays connected via this plugin, such as other plugins or some printers themselves. Combined with the Action Commands plugin, this would allow relays to be triggered via GCODE M118, which would address #3.

Details and an example of implementing hook handlers can be found here:
https://docs.octoprint.org/en/master/plugins/hooks.html#sec-plugins-hook-comm-protocol-action
What I don't understand, is how to account for the warning on not doing I/O in the handler. I don't know if the current implementation is blocking or non-blocking.

I would also like the thank you for making an I/O plugin that does not depend on using a Raspberry Pi. Every other one seems to.

Feature request: Automatic On/Off sensing

Hi!

Great plugin - very intuitive and works as needed, bar automation.

In an ideal world, I'd love it if this plugin was capable of turning a relay off upon print completion.

Would be great if the backend of this was ported into a child plugin for PSU control, or alternatively the automation/running detection features from that plugin ported into your plug-in.

Couldn't think of a way to reach out better than GitHub. Feel free to close this issue post-haste if it's beyond your appetite for developing this tool further.

Thanks

on off buttons grey

Hi, I have tried to connect a usb relay. I have put the good idVendor and IdProduct, but the buttons stay grey when I save. I have tried to install the hidapi and create a rules file, but it is still not working.
image
image

Cannot Connect

Added address on dev and still cannot get buttons to show up. Any support?

Install fail. Device Privileges

Hi!
I wanted to set the device privileges. I couldn't find the 99-usbrelay.rules file, and I couldn't create it either, due to the denial of root privileges. How can this be done? The plugin does not work without this. Thanks for the help!

Fails to install in docker container

Unfortunately this plugin fails to install when using Octoprint 1.6.1 in Docker. It seems to be requiring libusb inside the docker container, which is understandable. The relevant bit of the installation log is...


Created wheel for OctoPrint-USBRelayControl: filename=OctoPrint_USBRelayControl-1.0.0-py2.py3-none-any.whl size=37660 sha256=a460d7740b7eca7ec08a8495b05e2258419f2e51cb3fb82f26c6c5f86c9e0970
Stored in directory: /tmp/pip-ephem-wheel-cache-a6bw93sy/wheels/84/78/6c/b2d17f5dbce1c9ef3818a6d7d2844500db890bc89d73a70564
Building wheel for hidapi (setup.py): started
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ziihwxpx
cwd: /tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/
Complete output (19 lines):
running bdist_wheel
running build
running build_ext
skipping 'hid.c' Cython extension (up-to-date)
cythoning hidraw.pyx to hidraw.c
/tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/.eggs/Cython-0.29.28-py3.8.egg/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/hidraw.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'hid' extension
creating build
creating build/temp.linux-armv7l-3.8
creating build/temp.linux-armv7l-3.8/hidapi
creating build/temp.linux-armv7l-3.8/hidapi/libusb
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/local/include/python3.8 -c hid.c -o build/temp.linux-armv7l-3.8/hid.o
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/local/include/python3.8 -c hidapi/libusb/hid.c -o build/temp.linux-armv7l-3.8/hidapi/libusb/hid.o
hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
#include <libusb.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for hidapi
Building wheel for hidapi (setup.py): finished with status 'error'
Running setup.py clean for hidapi
Successfully built OctoPrint-USBRelayControl
Failed to build hidapi
Installing collected packages: hidapi, OctoPrint-USBRelayControl
Running setup.py install for hidapi: started
Running setup.py install for hidapi: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-tp2574a4/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /octoprint/plugins/include/python3.8/hidapi
cwd: /tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/
Complete output (17 lines):
running install
running build
running build_ext
skipping 'hid.c' Cython extension (up-to-date)
skipping 'hidraw.c' Cython extension (up-to-date)
building 'hid' extension
creating build
creating build/temp.linux-armv7l-3.8
creating build/temp.linux-armv7l-3.8/hidapi
creating build/temp.linux-armv7l-3.8/hidapi/libusb
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/local/include/python3.8 -c hid.c -o build/temp.linux-armv7l-3.8/hid.o
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/local/include/python3.8 -c hidapi/libusb/hid.c -o build/temp.linux-armv7l-3.8/hidapi/libusb/hid.o
hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
#include <libusb.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pe4bup6w/hidapi_c1ae9878b0dd4a439704078caff1fca2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-tp2574a4/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /octoprint/plugins/include/python3.8/hidapi Check the logs for full command output.
Error!
Could not parse output from pip, see plugin_pluginmanager_console.log for generated output

This problem may go away in later versions of Octoprint - I haven't upgraded from 1.6.1 yet. Please just close this issue if that's the case :-)

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.