2021 Oct 01, 03:00 AM
(2021 Sep 24, 07:04 PM)hugie Wrote:(2021 Sep 24, 02:47 PM)dan Wrote: It looks like it would be very easy to modify the cli_control plugin for this.
You would just need to install the pi_plates Python modules with pip and add a line to the cli_control.py file:
Then you could add the relay control commands on the plugin's set up page.Code:import piplates.RELAYplate as RELAY
However, the Pi_plates RELAYplate seems a bit pricey. You can get an 8 or 16 channel relay board from Amazon for about 6 to 15 dollars and use the relay_16 plugin with just some jumper wires.
Also astrogerard is working on a I2C plugin that will allow a very large number of relays to be connected to the pi with just a couple of wires. Take a look at his early docs:
[url=https://nosack.com/sipforum/member.php?action=profile&uid=310][/url]https://gitlab.com/seventer/pcf857x_plug...57x-doc.md
Those i2c IO extender boards only cost about $2.00.
Dan
Thanks so much Dan! I will follow your directions. One thing you do get with the pi-plates relay plate is what looks to be built in protection for working with dangerous voltages, and they are nicely stackable. But I agree with you, they are much more in cost. I will look at astrogerard's page.
John
Thanks again, Dan. I have made a good start at a pi_plates specific module. One issue is that the pi-plate library wants to put the gpio mode into it's own mode. Is there any way to prevent SIP from making GPIO calls? I have for now temporarily commented out lines in gpio_pins.py, but this is not very elegant. Do you have any suggestions?