I was having the same issue using python, Executing shell script in PHP etc
so the solution is Enable python scripts on apache 2 using this guide: https://www.server-world.info/en/note?os=Debian_9&p=httpd&f=5
then go to:
Application Menu > Preferences > Raspberry Pi Configuration > Interfaces > Enable Remote GPIO
And then type the address to the ...
Pin 1 is 3.3V power, and can supply up to 800mA (although it is inadvisable to connect a pump to the supply - particularly without any protection).
Pin 3 is a GPIO - if programmed as an output it can supply a maximum of 16mA. By default it will supply ~2mA (because it has a 1.8kΩ pullup) - neither is capable of running any kind of motor. Also connecting any ...
Yes, as long as the signal is 3V3 compatible.
You could use the Pi's UART RX pin (pin 10, GPIO 15) and the standard Linux serial software. That will handle standard baud rates (say up to 1 Mbps).
Alternatively you can use a general GPIO (any other GPIO on the extension header) and software serial. That should be good up to 19k2 bps or so.
DO NOT connect a "variable power supply" to the Pi! Most (laboratory grade supplies excepted) are poorly regulated.
DEFINITELY DO NOT connect any power supply to the 5V rail of a powered Pi. (It is acceptable to power the Pi through the Header pins - provided the power supply meets the Foundation recommendations.) Your confusion between series/parallel is a ...
All the advice I have seen says no. Use the Pi's power supply via the microUSB or use your own power supply via the 5V and ground pins. If you use both they will "fight" with each other and cause problems.
Why not power your external kit with the external 5V supply? You can still share the grounds if the external kit has logic which needs controlling ...
On all Pis with the 40 pin expansion header pin 29 is connected to GPIO 5.
GPIO 5 defaults to a pull-up at power up.
The pulls are quite weak (about 50k ohms) so they can easily be overridden by an external voltage.
The table you linked shows GPIO 5 as defaulting to pull-up.
GPIO 28/29 are not brought out to the 40-pin expansion header.
On the first RPi :
In a first terminal : (create FIFO)
In a second terminal : (Write datas into FIFO)
readfifo-writeUART.py : pyserial short-intro
with serial.Serial() as ser:
ser.baudrate = 19200
Only GPIO the sysfs has been asked to control will be listed in /sys/class/gpio.
The GPIO not mentioned (i.e. other GPIO in the range 0-27) are not being controlled by sysfs.
Without knowing details of the operation of the OnOffShim we can't say if the absence of GPIO 4/17 is significant or not.
See my answer to another question here regarding the use of an interposing relay.
In the answer I posted I made mention to use a pull down resistor, and a current limiting resistor in series with the GPIO. This would look something like this.
simulate this circuit – Schematic created using CircuitLab
R2 serves to limit the current going to the ...
pigpio will probably let you do what you want using waves.
The following command line example uses pigs to set GPIO 4 high for 7 seconds.
pigs m 4 w # set GPIO 4 to mode output
pigs wvag 16 0 7000000 0 16 0 # wave to switch GPIO 4 high for 7 seconds, then off
pigs wvcre # create wave (should return wave 0)
pigs wvtx 0 ...
Your question can not be answered in a useful way because you have not given enough basic information. Specifically, you've not stated what the "signal" is between the thermostat and the heater. For example, is the "signal" a contact closure via mercury switch inside the thermostat? Or, is it, as some have guessed, an "active signal" of 24v, or even mains/ac ...
You need to use an interposing relay. This is simply a mechanical or solid state relay that has a 12Vdc coil and at least one contact (typically a form C contact, aka single pole double throw). Wire 3.3Vdc from your Pi to one side of the contact and the other to a GPIO input. Ensure you use a pull down resistor with the relay contact and a current ...
I read the program a second time and found the following things:
(1) This statement:
seems to call function "updateGPIOstatuses()" with two arguments
"gpioCheckerInterval" and "pins". I guess "pins" means a list of GPIO pin
numbers, eg 19, 8, 3, etc.
I bought a SMAKN Dc/dc converter to step down the 12v to 3.3v
DO NOT do this!
These devices are for converting power NOT logic levels!
You could use a voltage divider provided the circuits share a common ground.
I would NOT directly connect a foreign voltage source to a Pi (or any other logic circuit) without protection. NOTE you do NOT need 3.3V - ...
If you know the voltage (is it always 12V or is it sometimes 14V) you could have used a pair of suitable resistors as a voltage divider.
As long a your DC converter or whatever circuit you end up using constrains the voltage at the Pi to 3V3 or less you will be fine.
In any case I don't see how you could damage your alarm by tapping its 12V output (unless ...
Move the code that reads the log into your while True: loop. Don't start a new while True: for each LED as it will never terminate.
Now that I'm home and have had a chance to look at this deeper (with a Raspberry Pi to test it on) I've re-written it to use RPi.GPIO (which works).
import RPi.GPIO as g
from time import sleep
If unconfigured GPIO pins are Inputs, so safe for a logic input 0 - 3.3V
If Output and opposite voltage is applied they can be damaged - which is why you should use a series resistor to limit current to a safe level.
12V pump will require 12V PSU. 20LPM is a pretty reasonable flow rate for a small pump so your pump PSU will need to have enough power to drive the pump - check the max current draw on startup (which will be higher than the running power draw) and size the PSU accordingly.
Check the contact handling voltage/current for your relays.
"5V" relays (as ...
If you only connect to header pins with the power off and/or use insulated dupont connectors there is no problem.
If you aren't using the power pins just put an insulated connector on the power pins. There is little risk using the actual GPIO pins (you have to connect 2 outputs of different levels), but even there connect with the power off.
Most people ...
The Pi's 3V3 (pins 1/17) and 5V (pins 2/4) pins are NOT GPIO, they are part of the power supply rails.
If you connect the 5V power supply rail to the 3V3 power supply rail you will destroy the Pi. There is no protection.
Here is some working code which waits for a sysfs interrupt.
Please note the preconditions assumed by the code which are noted in the comments.
As an aside please note that the sysfs interface is deprecated and has been removed from some Linux kernels. If you are writing a new library I suggest you use the /dev/gpiochip interface instead.