abudden / octoprint-usbrelaycontrol Goto Github PK
View Code? Open in Web Editor NEWPlugin for OctoPrint for controlling HID-based USB relays
License: GNU Affero General Public License v3.0
Plugin for OctoPrint for controlling HID-based USB relays
License: GNU Affero General Public License v3.0
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?
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 !
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
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.
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
Is it possible to have a g-code command switch the relays on/off?
Added address on dev and still cannot get buttons to show up. Any support?
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!
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 :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.