Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify udev rule for USBtin to make can_up.sh unnecessary #4

Open
wants to merge 2 commits into
base: motorControllerRedesign
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions studierbot/interface/can/77-evo-slcand.rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# USBtin module
ACTION=="add", ENV{SUBSYSTEM}=="tty", GROUP="dialout", MODE="0666", ATTRS{product}=="USBtin", RUN+="/usr/bin/logger [udev] USBtin detected, creating symlink ttyEvoCan ", SYMLINK+="ttyEvoCan"
ACTION=="remove", ENV{ID_SERIAL_SHORT}=="A0212656", RUN+="/usr/bin/pkill slcand"
ACTION=="add", ENV{SUBSYSTEM}=="tty", GROUP="dialout", MODE="0666", ATTRS{product}=="USBtin", RUN+="/usr/bin/logger [udev] USBtin detected, creating symlink ttyEvoCan ", SYMLINK+="ttyEvoCan", ENV{SYSTEMD_WANTS}="slcand.service"
#ACTION=="remove", ENV{ID_SERIAL_SHORT}=="A0212656", RUN+="/usr/bin/pkill slcand"
10 changes: 10 additions & 0 deletions studierbot/interface/can/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all:
echo 'No rule for make all existing. Please run "sudo make install" to install the udev rule and systemd service.'

install:
install -D -m644 77-evo-slcand.rules /etc/udev/rules.d/77-evo-slcand.rules
install -D -m644 slcand.service /etc/systemd/system/slcand.service

remove:
remove /etc/udev/rules.d/77-evo-slcand.rules
remove /etc/systemd/system/slcand.service
10 changes: 10 additions & 0 deletions studierbot/interface/can/slcand.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
BindsTo=dev-ttyEvoCan.device
After=dev-ttyEvoCan.device

[Service]
Type=simple
ExecStart=/usr/bin/slcand -F -f -s6 -o -c /dev/ttyEvoCan
ExecStartPost=/bin/ip link set slcan0 up
User=root
Group=root