Im trying to run a script that opens and closes a relay when the ALARM message goes off. RSUDP recognizes the code and everything but when it tries to run it, the client throws the following error:
import RPi.GPIO as GPIO
import time
RELAY_PIN = 22
GPIO.setmode(GPIO.BCM)
GPIO.setup(RELAY_PIN, GPIO.OUT)
GPIO.output(RELAY_PIN, GPIO.HIGH)
time.sleep(2)
GPIO.output(RELAY_PIN, GPIO.LOW)
GPIO.cleanup()
If someone recognizes my mistake or why does this error pops up id really apreciate some help as ive already tried everything that my limited knowledge in coding let me. I tried running the script by itself and it runs without problems, i also wrote a script using the exec() function to see if that could be the problem but again, it worked without any trouble.
Im trying to run a script that opens and closes a relay when the ALARM message goes off. RSUDP recognizes the code and everything but when it tries to run it, the client throws the following error:
2023-08-01 14:59:07 [Custom] Got ALARM message... 2023-08-01 14:59:07 [Custom] Executing code from file: /home/matiasrodriguez/customrele.py 2023-08-01 14:59:07 [Custom] Code execution failed. Error: invalid syntax (, line 1)
The python script is the follownig:
If someone recognizes my mistake or why does this error pops up id really apreciate some help as ive already tried everything that my limited knowledge in coding let me. I tried running the script by itself and it runs without problems, i also wrote a script using the exec() function to see if that could be the problem but again, it worked without any trouble.