Elegant way to kill previous gpioset?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






Different bash scripts from different servers
ssh to Raspberry and set GPIO line:

        /dev/gpiochip2, pin number 7.

with such command:

        gpioset -b -msignal /dev/gpiochip2 7=1



If another script tries:

      gpioset -b -msignal /dev/gpiochip2 7=0

then it gets:

      gpioset: error setting the GPIO line values: Device or resource busy



So every bash script kills previous instance
before setting gpio line:

     pkill -ef "^gpioset .* /dev/gpiochip2 7=[01]$"
     gpioset -b -msignal /dev/gpiochip2 7=0



Pkill is bad solution:

1. it is very slow, because it has to grep full command lines.

2. it doesn't work if one of bash scripts
used little bit different command, for example:

     gpioset -b -msignal /dev/gpiochip2 7=0 5=2
     gpiomon             /dev/gpiochip2 7



Is there a better way to kill o replace
previous instance of running gpioset?













[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux