ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
305 stars 18 forks source link

Latest version of PiOS has broken LED control #157

Closed ebaauw closed 1 year ago

ebaauw commented 1 year ago

The latest PiOS kernel 6.1.19-v8+ #1637 (both 32-bit and 64-bit) has renamed the file to control the power LED to /sys/class/leds/PWR/brightness from /sys/class/leds/led1/brightness.

Consequently, Homebridge RPi and rpi can no longer retrieve nor control the power LED. On the local Pi, you'll see the following error:

[Mar 18 10:50:21] [RPi] pi4: warning: heartbeat error: /sys/class/leds/led1/brightness: cannot open: ENOENT no such file or directory

For a remote Pi, the LED will silently be reported as off. You will see an error, when trying to change the LED:

[Mar 18 10:04:05] [RPi] pi1 Power LED: On: changed to true (from false)
[Mar 18 10:04:05] [RPi] pi1 Power LED: On: warning: set: FO (104): no permission to access file (-137)

While the fix is easy enough, it needs to be applied to Raspberry Pi being monitored remotely by Homebridge RPi, as it involves updating both /opt/pigpio/access and /opt/pigpio/cgi/getState.

ebaauw commented 1 year ago

Fixed in v1.8.0.

JurgenLB commented 1 year ago

In your README you specify; "This script needs to be installed to /opt/pigpio/cgi/getState" and "/opt/pigpio/access" but now you speak about "/opt/pigpiod/..." . This last directory is also not on my system.

ebaauw commented 1 year ago

Typo, sorry.

Ogdla commented 1 year ago

Sorry I steel have this issue . How to correct it ? I have change sudo sh -c 'cat - > /opt/pigpio/access' <<+ /sys/class/leds/PWR/brightness w

ebaauw commented 1 year ago

Are you on the latest PiOS kernel? In that case, you need to specify the PWR file, not the led1 file. If not, you need Homebridge RPi before v1.8.0 (or update PiOS and reboot).

Ogdla commented 1 year ago

J'Cordialement / Best Regards / ﺍﺍﺴﻼﻢﻋﺍﯾﮑﻡ / 此致敬意ERIC GAGOUMSent from my iPhone XII Pro MaxOn 9 May 2023, at 18:57, Erik Baauw @.***> wrote: Are you on the latest Pi OS kernel?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Ogdla commented 1 year ago

I got it . My PI Os was very hold .Just updated it and now your plugins is swiping . But my Pi have restored twice i do not know why .

On 9 May 2023, at 20:19, ERIC G @.***> wrote:

J'

Cordialement / Best Regards / ﺍﺍﺴﻼﻢﻋﺍﯾﮑﻡ / 此致敬意 ERIC GAGOUM

Sent from my iPhone XII Pro Max

On 9 May 2023, at 18:57, Erik Baauw @.***> wrote:



Are you on the latest Pi OS kernel?

— Reply to this email directly, view it on GitHub https://github.com/ebaauw/homebridge-rpi/issues/157#issuecomment-1540618168, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7TKAUSC3XLZDPGW6BN376TXFKAPFANCNFSM6AAAAAAV7LLRNY. You are receiving this because you commented.