siblues
Posts: 26
Joined: Sun Oct 22, 2017 1:26 am

Gpio question?

Tue Nov 28, 2017 12:28 pm

OK I am having a weird issue with my Gpio's. I am using a plug in that uses RPi gpio and it can trigger all of the relays through the gpio. The issue I am having is they will not trigger or open and close when I try to use them any other way other than the plug in. Any ideas

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Gpio question?

Tue Nov 28, 2017 12:34 pm

Which plugin?
Also post a (simple) example of code that does not work for you (use code tags!)

pcmanbob
Posts: 9612
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Gpio question?

Tue Nov 28, 2017 1:14 pm

Post your code that works and post the code that does not work, also tell us which relay board you have or a link to were you got it.

and please use code tags

Add [code] at the top



and [/code] at the bottom.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

siblues
Posts: 26
Joined: Sun Oct 22, 2017 1:26 am

Re: Gpio question?

Tue Nov 28, 2017 11:56 pm

The plugin that actually works with the GPIO's is PSU control in Octoprint.The Yaml Patcher plugin also works because the buttons show up on the top of Octoprint after I paste the code into theconfig.yaml folder but the gpio's don't work with anything but the PSU control plugin.Here is the code that I manually paste into the folder

Code: Select all

system:
  actions:
  - action: lights on
    command: gpio -g write 32 1
    name: Turn on the lights
  - action: lights off
    command: gpio -g write 32 0
    confirm: You are about to turn off the lights.
    name: Turn off the lights
The Yaml patcher code is

Code: Select all

[["append", "system.actions", {"action": "lights on", "command": "gpio -g write 32 1", "name": "Turn on the lights"}], ["append", "system.actions", {"action": "lights off", "command": "gpio -g write 32 0", "name": "Turn off the lights", "confirm": "You are about to turn off the lights."}]]
I didn't come up with the code myself they were two examples listed on each of the plugin pages as examples that work.I just changed the GPIO number and the name of what I was turning on and off.I even tried with and without the -g.I know the GPIO numbering I am using is the right pin number because when I change the pin number in the PSU control settings page the pin I switch to activates the relay no problem.They just don't seem to work any other way besides with the plugin.

This is the link to the Octoprint relay control page

https://github.com/foosel/OctoPrint/wik ... m-your-RPi

This is the link to the psu control plugin page

https://github.com/kantlivelong/OctoPrint-PSUControl

And this is the link to the Yaml Patcher plugin page

https://github.com/OctoPrint/OctoPrint-Yamlpatcher

I have had a few problems setting up my first Raspberry but with the help I got on here and just trying stuff I have researched online has seemed to work up until this point.I am overwhelmed with this issue at the moment.I can't seem to figure it out.Any help would be greatly appreciated.

siblues
Posts: 26
Joined: Sun Oct 22, 2017 1:26 am

Re: Gpio question?

Fri Dec 01, 2017 1:40 am

Just checking in again I haven't been able to figure out how to get this to work.

siblues
Posts: 26
Joined: Sun Oct 22, 2017 1:26 am

Re: Gpio question?

Tue Dec 05, 2017 9:50 pm

I still haven't been able to figure out what is going on does anyone have any ideas?

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Gpio question?

Wed Dec 06, 2017 9:26 am

Given that this is an OctoPrint thing, maybe you should ask for support from them?
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

pcmanbob
Posts: 9612
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Gpio question?

Wed Dec 06, 2017 11:50 am

As scotty101 said as this is not a supported Operating system here try asking at https://plus.google.com/communities/102 ... 9328485741
which is the support for OctoPrint.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

siblues
Posts: 26
Joined: Sun Oct 22, 2017 1:26 am

Re: Gpio question?

Thu Dec 07, 2017 7:17 am

I have tried a bunch of forums with no luck.What would be the correct way to activate a single gpio pin and what I mean by that is let's say I am trying to turn on a relay what would be the code or command needed to do that when using RPI.Gpio?

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: Gpio question?

Thu Dec 07, 2017 9:26 am

Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Return to “General discussion”