Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Led don't work #16

Open
F8ASB opened this issue May 20, 2024 · 0 comments
Open

Led don't work #16

F8ASB opened this issue May 20, 2024 · 0 comments

Comments

@F8ASB
Copy link

F8ASB commented May 20, 2024

Hello,

I'm testing this script but i have some problems.

1/ Gpio 27 no accepted:

My command line:
sudo python3 /usr/local/bin/unipagerled.py --hostname localhost --gpioRun 27 --gpioConn 22 --gpioTX 23 --debug

gpio27 isn't accepted:

File "/usr/local/bin/unipagerled.py", line 168, in
with Statusleds("ws://%s:%s/" %(hostname, port), runled, connled, txled) as setter:
File "/usr/local/bin/unipagerled.py", line 47, in init
GPIO.setup(abs(self.runled), GPIO.OUT)
ValueError: The channel sent is invalid on a Raspberry Pi

2/ No action on Led:
I remove gpio27 to test led status

On debug statut led change:
Setting led 23 to 0
Setting led 23 to 1

With the debug i have the status change but the led does no light up.

-----debug-----

sudo python3 /usr/local/bin/unipagerled.py --hostname localhost --gpioConn 22 --gpioTX 23 --debug

Debug enabled
Led not present
Resp:
{
    "Status": {
        "connected": true,
        "transmitting": false,
        "timeslots": [
            false,
            true,
            false,
            false,
            false,
            false,
            true,
            false,
            false,
            false,
            false,
            true,
            false,
            false,
            false,
            false
        ],
        "timeslot": 2,
        "queue": 0,
        "master": "dapnet.afu.rwth-aachen.de",
        "version": "1.0.3",
        "calls_tx": 3276,
        "calls_rx": 3276
    }
}
Setting led 22 to 1
Setting led 23 to 0
Other message, ignoring
Resp:
{
    "StatusUpdate": [
        "timeslot",
        3
    ]
}
Other message, ignoring
StatusUpdate:
3
Resp:
{
    "StatusUpdate": [
        "timeslot",
        4
    ]
}
Other message, ignoring
StatusUpdate:
4
Resp:
{


i write a small script in Python to test gpio and is ok:

import RPi.GPIO as GPIO
import time

# Pin Configuration
GPIO.setmode(GPIO.BCM)  # Utilisation des numéros de broches BCM
GPIO.setwarnings(False)

# Pin as output
GPIO.setup(27, GPIO.OUT)
GPIO.setup(22, GPIO.OUT)
GPIO.setup(23, GPIO.OUT)

try:
    while True:
    # Allumer les LEDs
        GPIO.output(27, GPIO.HIGH)
        GPIO.output(22, GPIO.HIGH)
        GPIO.output(23, GPIO.HIGH)

        time.sleep(1)  # Attendre 1 seconde

        # Éteindre les LEDs
        GPIO.output(27, GPIO.LOW)
        GPIO.output(22, GPIO.LOW)
        GPIO.output(23, GPIO.LOW)

        time.sleep(1)  # Attendre 1 seconde

except KeyboardInterrupt:
# Nettoyer les réglages GPIO en cas d'interruption
    GPIO.cleanup()


Wiring gpio: OK
GPIO configuration: OK
Websocket connexion: OK

Do you have an idea of what the problem might be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant