Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
battery_monitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
drivers
battery_monitor
Commits
8b4ec403
Commit
8b4ec403
authored
5 years ago
by
Alejandro Lopez Gestoso
Browse files
Options
Downloads
Patches
Plain Diff
Moved ftdi scripts to comm package
parent
1882c024
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/unbind_ftdi_udev.sh
+0
-57
0 additions, 57 deletions
scripts/unbind_ftdi_udev.sh
scripts/undo_unbind_ftdi_udev.sh
+0
-43
0 additions, 43 deletions
scripts/undo_unbind_ftdi_udev.sh
with
0 additions
and
100 deletions
scripts/unbind_ftdi_udev.sh
deleted
100755 → 0
+
0
−
57
View file @
1882c024
#!/bin/sh
echo
"--- unbind_ftdi_udev.sh ---"
# VENDOR=${1:-0403}
# PRODUCT=${2:-6001}
# SERIAL=${3:-A600eB1Y}
# FILE=${4:-99-ftdi.rules}
VENDOR
=
"0403"
PRODUCT
=
"6001"
SERIAL
=
"A600eB1Y"
FILE
=
"99-ftdi-unbind-by-serial.rules"
# SERIAL DABO: A600eB1Y
# SERIAL TIBI: A600eByq
# SERIAL TEO: A900WSG1
usage
()
{
echo
"Usage:
$0
[-v <vendor>] [-p <product>] [-s <serial>] [-f <file> ]"
echo
" -v specify vendor id. Default 0403"
echo
" -p specify product id. Default 6001"
echo
" -s specify serial number. Default A600eB1Y"
echo
" -f specify udev file. Default 99-ftdi-unbind-by-serial.rules"
exit
1
}
while
getopts
":hv:p:s:f:"
arg
;
do
case
$arg
in
v
)
VENDOR
=
$OPTARG
;;
p
)
PRODUCT
=
$OPTARG
;;
s
)
SERIAL
=
$OPTARG
;;
f
)
FILE
=
$OPTARG
;;
h
)
usage
;;
*
)
usage
;;
esac
done
shift
$((
OPTIND-1
))
FILE
=
/etc/udev/rules.d/
$FILE
FILE
=
/etc/udev/rules.d/
$FILE
echo
" Add udev rule so VENDOR:PRODUCT:SERIAL=
${
VENDOR
}
:
${
PRODUCT
}
:
${
SERIAL
}
devices do not load ftdi_sio driver."
echo
" Adding new lines to udev rule file:
${
FILE
}
"
LINE0
=
"#The following 2 lines make VENDOR:PRODUCT:SERIAL=
${
VENDOR
}
:
${
PRODUCT
}
:
${
SERIAL
}
devices not load ftdi_sio driver"
LINE1
=
"ATTRS{idVendor}==
\"
${
VENDOR
}
\"
, ATTRS{idProduct}==
\"
${
PRODUCT
}
\"
, ATTRS{serial}==
\"
${
SERIAL
}
\"
, MODE:=
\"
0666
\"
"
LINE2
=
"ATTRS{idVendor}==
\"
${
VENDOR
}
\"
, ATTRS{idProduct}==
\"
${
PRODUCT
}
\"
, ATTRS{serial}==
\"
${
SERIAL
}
\"
, RUN+=
\"
/bin/sh -c 'echo
\$
kernel > /sys/bus/usb/drivers/ftdi_sio/unbind'
\"
"
sudo touch
$FILE
grep
-qF
--
"
$LINE0
"
"
$FILE
"
||
echo
"
$LINE0
"
|
sudo tee
-a
"
$FILE
"
>
/dev/null
grep
-qF
--
"
$LINE1
"
"
$FILE
"
||
echo
"
$LINE1
"
|
sudo tee
-a
"
$FILE
"
>
/dev/null
grep
-qF
--
"
$LINE2
"
"
$FILE
"
||
echo
"
$LINE2
"
|
sudo tee
-a
"
$FILE
"
>
/dev/null
sudo
service udev restart
echo
" Need to unplug-plug devices for changes to take effect"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/undo_unbind_ftdi_udev.sh
deleted
100755 → 0
+
0
−
43
View file @
1882c024
#!/bin/sh
# SERIAL=${3:-A600eB1Y}
# FILE=${4:-99-ftdi.rules}
SERIAL
=
"A600eB1Y"
FILE
=
"99-ftdi.rules"
# SERIAL DABO: A600eB1Y
# SERIAL TIBI: A600eByq
# SERIAL TEO: A900WSG1
usage
()
{
echo
"Usage:
$0
[-v <vendor>] [-p <product>] [-s <serial>] [-f <file> ]"
echo
" -s specify serial number. Default A600eB1Y"
echo
" -f specify udev file. Default 99-ftdi.rules"
exit
1
}
while
getopts
":hv:p:s:f:"
arg
;
do
case
$arg
in
s
)
SERIAL
=
$OPTARG
;;
f
)
FILE
=
$OPTARG
;;
h
)
usage
;;
*
)
usage
;;
esac
done
shift
$((
OPTIND-1
))
FILE
=
/etc/udev/rules.d/
$FILE
echo
"Undo addition of udev rule so VENDOR:PRODUCT:SERIAL=
${
VENDOR
}
:
${
PRODUCT
}
:
${
SERIAL
}
devices do not load ftdi_sio driver."
echo
"Removing all lines containing SERIAL=
${
SERIAL
}
from file:
${
FILE
}
"
LINE0
=
${
SERIAL
}
sudo sed
-i
"/
${
LINE0
}
/d"
$FILE
sed
-i
-E
"/idVendor.*
$VENDOR
.*idProduct.*
$PRODUCT
.*serial.*
$SERIAL
.*MODE.*0666
\"
/d"
$FILE
sed
-i
-E
"/idVendor.*
$VENDOR
.*idProduct.*
$PRODUCT
.*serial.*
$SERIAL
.*RUN.*ftdi_sio
\/
unbind/d"
$FILE
sudo
service udev restart
echo
"Need to unplug-plug devices for changes to take effect"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment