GithubHelp home page GithubHelp logo

octoprint-gpiocontrol's People

Contributors

catgiggle 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

octoprint-gpiocontrol's Issues

Off Button is almost not visible

Hello,
The plugin works fine but the off button is almost not visible on the browser.
I try with chrome on pc and mobile. The issue is the same.
I don't try with firefox or edge.

Screenshot_2021-02-20-10-27-10-048_com android chrome

Screenshot_2021-02-20-10-26-08-051_com android chrome

Feature - oneshot button

A single button , not toggle, that can output a a timed pulse, for latched relays or other one shot triggers.

Plugin fails to load if another GPIO plugin is enabled

I had another GPIO plugin installed (OctoLight) and wanted to try this one out. It failed to load completely with the following stack trace:

2021-02-16 19:40:20,546 - octoprint.plugin.core - ERROR - There was an error loading plugin gpiocontrol
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugin/core.py", line 1526, in load_plugin
    plugin.load()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_gpiocontrol/__init__.py", line 150, in __plugin_load__
    __plugin_implementation__ = GpioControlPlugin()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_gpiocontrol/__init__.py", line 19, in __init__
    GPIO.setmode(GPIO.BCM)
ValueError: A different mode has already been set!

Disabling the other plugin allowed this to load, but maybe an error on the plugin settings page or something would be better.

Request - Navbar Buttons

Any chance of adding the GPIO Controls to the navbar? I know there are some already out there for navbar, but they only control one gpio or type of thing, like psu or lights and requires installing 2 different plugins. I have been waiting for someone to make a simple add X many gpio plugin.

Also it would be neet if you could make the icons change color or look when on or off. Like when you turn the power or light off, it would turn to a dark icon. And when on it would turn to a light or colored icons.

Configuration issues.

I am running Octopi 0.18.0 and GPIO Control 1.0.7.

When I add pin assignments on the configuration they are shown on the main Octoprint screen with ON and OFF buttons greyed out.

When I go into the configuration screen again and delete the original pin assignment (and save) the original assignment is still on the main Octoprint screen.

I have tried restarting Octoprint and rebooting the system. The problem remains.

Am I dong something wrong?

All the best,

Simon.

feature request: remove section header

I have a lot of stuff on my sidebar and I need to scroll down frequently. The "GPIO Control" header doubles the amount of vertical space for my one switch. And I can't think of how it is useful. It would be nice if an option was added to hide the header.

[feature request] New API for OctoPod integration

Hi,

I'm the developer of OctoPod app and I got a request to add support for this plugin. I was looking at the source code of the plugin and it seems like there are APIs for turning on/off GPIO pins and to gather status. I was wondering if it would be possible to add the following:

  1. New API that returns json with pin id, pin label, pin status
  2. Publish via websockets (i.e. plugin message) when a change to pin configuration was made or when pin status was changed via web UI

Request 1 will let me fetch all info I need from OctoPod and I will use existing APIs to control pins. Request 2 will let OctoPod know when to refresh the UI whenever a change was made from OctoPrint web UI.

Thanks,
Gaston

Side bar buttons are too bug

image

<div id="sidebar_plugin_gpiocontrol" class="accordion-body collapse in ">
                                    <div class="accordion-inner" data-test-id="sidebar-sidebar_plugin_gpiocontrol-content">
                                        <div data-bind="foreach: gpioButtons">
    <div class="gpiocontrol-button-row fluid-row">
        <div class="gpiocontrol-button-label span7">
            <i data-bind="class: icon" class="fas fa-power-off"></i>
            <span data-bind="text: name">Printer</span>
        </div>
        <div class="gpiocontrol-button-controls input-prepend input-append span5">
            <button class="btn" data-toggle="dropdown" data-bind="click: $parent.turnGpioOn, attr : {'disabled' : current_state != 'off'}">ON</button>
            <button class="btn" data-toggle="dropdown" data-bind="click: $parent.turnGpioOff, attr : {'disabled' : current_state != 'on'}" disabled="true">OFF</button>
        </div>
    </div>
</div>
                                    </div>
                                </div>

Is this configurable on my end?

Only admin can toggle a GPIO

I noticed in version 1.0.4 (probably was similar before but I never used an earlier version) that only an admin is allowed to toggle a GPIO. After updating to 1.0.7 this has not changed. Is there a particular setting that will enable the buttons for operators or is this by design?
FYI OctoLight can be operated by operator level.

Is it Python 3 compatible?

I'm running OctoPrint 1.5.3 on Python 3.9.1.
plugins.octoprint.org says it should run below python 4.
Is this plugin not compatible or is something in my setup broken?

Feature request: use modern permissions

GPIO Control is a really neat and useful plugin, however using it with multiple users and varying access levels seems to be cumbersome. Case in point, in the current version the plugin effectively requires that all users to be in the "Operator" group in order to control GPIO.

This is because:

  • The GPIO Control plugin requires old-style "USER" permission in order to permit API calls.
  • The "USER" and "ADMIN" permissions were deprecated and linked to membership in the "Operator" and "Admin" groups respectively. Their future use is discouraged.
  • There is now a mechanism for registering and controlling custom plugin-specific permissions, which should be used for this purpose.

For this reason, all users in the "Operator" group have the "USER" permission necessary to use GPIO Control. However, in my application users (and groups) are populated from LDAP and their permissions are inherited -- unfortunately this has no effect, and neither such user is allowed to perform GPIO Control API calls on the grounds of insufficient permissions.

Feature request: I would like to propose that this plugin adopts the new way of declaring and controlling granular permissions. This would solve the problem by allowing arbitrary groups, possibly different from "Operator", to be allowed API access to GPIO Control.

GPIO inputs

Is it possible to add inputs for things like physical buttons for this? The enclosure plug-in already does this but I find it’s interface to be very clunky, and this plugin is a lot more polished to me.

GPIO always high

Hello Folks,
im tried your plugin on different gpio Pins.
When i do set an Pin, it will become High.
But when a Pin is configured, it stays high and cannot be toggled.

How can i fix this?
Im using a raspberry pi 2 (if this is nessessary to know)

Update GPIOs periodically

When the GPIO state is changed by an external source, this change is not reflected by the plugin. Check the state of the GPIOs from time to time.

Event listener

An ability to define "events" like enable while printing for given GPIOs.

Example: I would like to enable the "chassis fan" every time a print is running.

image

AttributeError: 'module' object has no attribute 'BCM'

Hi after setup one Pin to trigger Lights I have this i log and plugin doesn't work at all...

File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_gpiocontrol/init.py", line 200, in get_pin_number
if self.mode == GPIO.BCM:
AttributeError: 'module' object has no attribute 'BCM'

Loses settings on shutdown

I set up the Pi4 to control a 2 relay module. Worked fine during testing. Shut down the system to put the case back together and rebooted. Now the side menu shows the 2 switches but they are greyed out, no control. Only way I have found to bring tyhem back is to clean up data for plugin and then create the switches again. Once rebooted, backed to greyed out and no control. Any suggestions?

[Bug] Update loop with v1.0.5

Hi,

this mornig Octoprint notified me of an update to v1.0.5. It confirm the update and after the installation process the notification reappears and the previous installation (1.0.4) is valid.

use gcode

As user I want to can update the switch through gcode commands

GPIO 0 appears to not be controllable

I am trying to get what i so far had solved with octoprints config.yaml with this GpioControl plugin.
So far, this has worked for me:

    actions:
    -   action: printerOn
        command: gpio mode 7 out; gpio write 7 0
        name: Printer On
    -   action: printerOff
        command: gpio mode 7 out; gpio write 7 1
        name: Printer Off
    -   action: fanOn
        command: gpio mode 0 out; gpio write 0 1
        name: Fan On
    -   action: fanOff
        command: gpio mode 0 out; gpio write 0 0
        name: Fan Off

Trying to implement it with this plugin:
image

But the button is gray

image

what could be the problem?

Buttons are not working with orangepi

I use Octoprint with an Orange Pi Win plus (instead of a raspberry Pi). So instead of RPi.GPIO library I Changed to OPi.GPIO. Pinout should be the same as raspberry pi.

Plugin installs and you can configure it. However buttons are disabled and don't work. Internal error 500 is shown on the webbrowser console.

Should I change anything else? what could cause this?

According the log:

2022-02-06 13:38:47,995 - octoprint.plugin - ERROR - Error while calling plugin gpiocontrol
OSError: [Errno 16] Device or resource busy

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/OctoPrint/venv/lib/python3.8/site-packages/OPi/GPIO.py", line 472, in setup
sysfs.export(pin)
File "/home/user/OctoPrint/venv/lib/python3.8/site-packages/OPi/sysfs.py", line 38, in export
fp.write(str(pin))
OSError: [Errno 16] Device or resource busy

During handling of the above exception, another exception occurred:

OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/OctoPrint/venv/lib/python3.8/site-packages/octoprint/plugin/init.py", line 271, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/home/user/OctoPrint/venv/lib/python3.8/site-packages/octoprint/util/init.py", line 1737, in wrapper
return f(*args, **kwargs)
File "/home/user/OctoPrint/venv/lib/python3.8/site-packages/octoprint_gpiocontrol/init.py", line 109, in on_after_startup
GPIO.setup(pin, GPIO.OUT)
File "/home/user/OctoPrint/venv/lib/python3.8/site-packages/OPi/GPIO.py", line 477, in setup
sysfs.unexport(pin)
File "/home/user/OctoPrint/venv/lib/python3.8/site-packages/OPi/sysfs.py", line 45, in unexport
fp.write(str(pin))
OSError: [Errno 22] Invalid argument

turns off smart filament sensor

hi, nice plugin but is has some issues with the smart filament sensor plugin, it turns it off...
so sadly enough i can't use this plugin

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.