Raspberry Pi control over SSH

414 Views Asked by At

I have raspbery which is controlling LEDs in the room, I made a command which I can send over SSH (using iPhone shortcuts). This code is running and animates LEDs, to turn all LEDs off I need to ctrl+c. Is there any way I can do this also over SSH, even I headed it has some problems I'd you reconnect to wifi after sending 1st command because it doesnt track already active commands?

I can share code also.

Kind Regards, Thanks

1

There are 1 best solutions below

5
On BEST ANSWER

If you just need to kill the process, you can do that either with killall nameoftheprocess, or if you know the process id, using kill pid.

Here is the manpage for kill: https://man7.org/linux/man-pages/man2/kill.2.html

Assuming you start the command with a bash script, you should be able to get the pid using $!, you could then write that to a temporary file from which you can read for killing the process.

If you want more detail, it would be helpful if you shared your code.