recently i have brought this relay board:
I have connected to my RPi, I have setup the Output in Enclosure plugin setup with GPIO pin 24, it show correctly in the plugin but it don't work. If i manually set the GPIO to output with gpio -g mode 19 out the relay work but not with the plugin.
Can anyone help me please?
Thanks a lot
Is the relay able to switch at 3.3V?
Yes if i use the SSH the relay works great.
edit: i have passwordless for sudo
Wiring pi is deprecated so I wouldn't rely on it for long.
You mention GPIO24 in Enclosure but then 19 w/
gpio. So which is it? What happens when you test with the same pin?
Yes GPIO 24 is 19 in BCM so, if you use in Enclosure plugin without BCM mode you have to write 24, but in SSH with gpio command you have to use BCM number.
A part of octoprint.log, here you can see the plugin write on pin 24 by manually trigger the button.
2021-05-13 17:01:19,165 - octoprint.plugins.enclosure - DEBUG - Writing on GPIO: 24 value True
2021-05-13 17:01:19,582 - octoprint.plugins.enclosure - DEBUG - Writing on GPIO: 24 value False
2021-05-13 17:01:20,011 - octoprint.plugins.enclosure - DEBUG - Writing on GPIO: 24 value True
2021-05-13 17:01:20,418 - octoprint.plugins.enclosure - DEBUG - Writing on GPIO: 24 value False
2021-05-13 17:01:23,275 - octoprint.plugins.enclosure - DEBUG - Temperature SI7021 cmd: sudo python /home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/SI7021.py 0x40 1
2021-05-13 17:01:24,328 - octoprint.plugins.enclosure - DEBUG - SI7021 result: b'21.4 | 54.8\n'
If i test w/ gpio via SSH it works, with the Enclosure plugin no result
-g flag indicates you are using BCM mode not physical pin number.
PIN 24 <=> GPIO 8
GPIO 24 <=> PIN 18
PIN 19 <=> GPIO 10
GPIO 19 <=> PIN 35
Make sure you are using the right mode and specify the right number for said mode.
So perhaps an off by 1 mistake
Sorry, I probably explained myself wrong, I'm using GPIO not BCM mode, but when I try via SSH it works and in Enclousure it doesn't.
This is my settings:
I'm using the Board pin Numbrer not BCM numbers
Did you already this:
And you may try with SUDO off.
Right so you tested with
gpio -g 19. That is not the BCM equivalent of PIN24 according to pinout.xyz for the 40 pin header.
The BCM equivlant of PIN24 is GPIO8. You tested with GPIO19.
in my config tab i have unchecked "Use Board Pin #" to use BCM numbers, but the setup window don't save this option and i have to use the Board pin #. Now it works perfectly.
Thanks to all for help.
Great! So could you please:
All topics you create in this category can be marked as "Solved" by clicking the little
icon under the post that contains the solution:
Please make heavy use of it. Marking a topic as solved allows others to quickly see that a solution has been found and also displays the solution prominently right in the start post so that others with the same problem may find it easier, without having to scan through the whole thread.