1

I have a GPS receiver connected to a Pi, with 1PPS input connected to GPIO4. This GPS module does not have a PPS or lock LED, so I would like to have it indicate with the activity LED. Based on the output of cat /sys/devices/platform/leds/leds/led0/trigger I see that "gpio" is a trigger option, but I don't see how to declare which GPIO is used!

I have been looking through ledtrig-gpio.c to figure out what syntax it wants but I haven't made any progress so far.

For what it's worth, I am using a Pi 3b+ with DietPi (Debian Buster).

Thanks!

millerjs
  • 31
  • 3
  • Read through /boot/overlays/README and search for act_led_gpio – Jaromanda X Feb 09 '21 at 21:57
  • Hm, I don't think this is what I am looking for - act_led_gpio seems to be the GPIO pin that you redirect the "activity" behavior to a GPIO pin so you could use an external LED instead of the onboard one. What I want to do is have the activity LED reflect the state of a GPIO pin (e.g. GPIO high = LED lit). – millerjs Feb 11 '21 at 00:13
  • Oh, I misunderstood – Jaromanda X Feb 11 '21 at 00:27
  • No worries - I know what I'm asking is a little bit strange, but according to the documentation, it can be done! – millerjs Feb 12 '21 at 01:01
  • according to the documentation - which documentation? – Jaromanda X Feb 12 '21 at 01:13
  • No official documentation that I have been able to find because this feature doesn't seem to be well understood. The output of cat /sys/devices/platform/leds/leds/led0/trigger lists all of the available triggers. They are also listed in this post here: https://raspberrypi.stackexchange.com/a/69759/130291 – millerjs Feb 13 '21 at 02:57
  • the description for trigger=gpio is Flash when a certain GPIO is high??? ... which "certain" GPIO? I see people setting trigger to gpio, then in code setting brightness to 0 or 1 to turn the LED off/on ... but you can achieve the same with trigger=none, so ... Since reading this question, I've realised I would also like to drive the LED from GPIO (without writing code to toggle it) - so, been searching too, and found nothing useful – Jaromanda X Feb 13 '21 at 03:36

0 Answers0