Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

run program when usb connected to raspberry pi

$
0
0

I'm trying to run a program when I plug USB to my Raspberry Pi 3 model B.

I referenced below twohttps://hackaday.com/2009/09/18/how-to-write-udev-rules/https://unix.stackexchange.com/questions/65891/how-to-execute-a-shellscript-when-i-plug-in-a-usb-device

  1. write a *.rules file in /etc/udev/rules.d/ directory
sudo nano /etc/udev/rules.d/81-usb.rules
  1. fill with
KERNEL=="sda1", RUN+="echo Hello World > /home/pi/hello.txt"
  1. restart udev
sudo /etc/init.d/udev restart

I almost tried every variation, rebooted a lot, just in case I'm missing something. But nothing works.

Thanks for reading.


Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>