Commit 2056d0e396140d62517be4b90a2db0b97cecad97
1 parent
99eaf848
MAJ Capteur
Showing
4 changed files
with
27 additions
and
3 deletions
Show diff stats
site/fichiersRPI/Makefile
... | ... | @@ -7,8 +7,8 @@ export CFLAGS = -Wall -I. -DF_CPU=16000000 -Os #-pedantic -std=c99#-g |
7 | 7 | export LDFLAGS = -g $(TARGET_ARCH) -lm -Wl,--gc-sections # -Os |
8 | 8 | |
9 | 9 | TARGET = main |
10 | -TERM0 = /dev/ttyACM0 | |
11 | -TERM1 = /dev/ttyACM1 | |
10 | +TERM0 = /dev/ttyPR0 | |
11 | +TERM1 = /dev/ttyPR1 | |
12 | 12 | CPPFLAGS = -mmcu=$(MCU) |
13 | 13 | #PGMER = -c stk500v1 -b 57600 -P $(TERM) |
14 | 14 | ... | ... |
site/fichiersRPI/Rpi_to_server.py
site/fichiersRPI/fichiersRPI.zip
No preview for this file type
... | ... | @@ -0,0 +1,24 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +data=$(dmesg | grep ttyACM | cut -f 7 -d " " | cut -f 1 -d : ) | |
4 | +code=$(echo $data | cut -f 1 -d " ") | |
5 | +#echo $code | |
6 | +port=$(pwd | cut -c 17) | |
7 | +let port-- | |
8 | +#echo $port | |
9 | +dev="/dev/ttyACM" | |
10 | +name="$dev$port" | |
11 | +commande=$(udevadm info --name=$name --attribute-walk | egrep "idVendor|idProduct|serial") | |
12 | +idProduct=$(echo $commande | cut -f 1 -d " ") | |
13 | +idVendor=$(echo $commande | cut -f 2 -d " ") | |
14 | +serial=$(echo $commande | cut -f 3 -d " ") | |
15 | +#echo $idProduct | |
16 | +#echo $idVendor | |
17 | +#echo $serial | |
18 | +newdev="ttyPR" | |
19 | +newname="$newdev$port" | |
20 | +#echo $newname | |
21 | +rule="SUBSYSTEM==\"tty\", $serial, $idVendor, $idProduct, SYMLINK+=\"$newname\"" | |
22 | +#echo $rule | |
23 | +echo $rule > /etc/udev/rules.d/usb-serial.rules | |
24 | +udevadm trigger | ... | ... |