Raspberry Pi no se puede conectar a pigpio en localhost (8888)

Raspberry Pi pigpio informa que no se puede conectar a pigpio en localhost (8888)

Can't connect to pigpio at localhost(8888)

Did you start the pigpio daemon? E.g. sudo pigpiod

Did you specify the correct Pi host/port in the environment
variables PIGPIO_ADDR/PIGPIO_PORT?
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888

Did you specify the correct Pi host/port in the
pigpio.pi() function? E.g. pigpio.pi('soft', 8888)

Solución:

Uno: llamar a la biblioteca del sistema operativo en el archivo

import pigpio
import time
import os
open_io="sudo pigpiod"
os.system(open_io)
time.sleep(1)
pi = pigpio.pi()  # 初始化 pigpio库`

Dos: abrir manualmente en el terminal LX

Ingrese el comando sudo pigpiod para iniciar pigpio daemon

sudo pigpiod

Supongo que te gusta

Origin blog.csdn.net/hehehehehahe/article/details/115266739
Recomendado
Clasificación