Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2019-2020
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
Container registry
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matteo Cucchi
2019-2020
Commits
593b2557
Verified
Commit
593b2557
authored
May 20, 2020
by
Andrea Trentini
Browse files
Options
Downloads
Patches
Plain Diff
prima versione monitor studenti
parent
6a9676dc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
compilaEflash.sh
+5
-1
5 additions, 1 deletion
compilaEflash.sh
monitorStudenti.sh
+59
-0
59 additions, 0 deletions
monitorStudenti.sh
with
64 additions
and
1 deletion
compilaEflash.sh
+
5
−
1
View file @
593b2557
#!/bin/bash
COM
=
/dev/ttyACM0
echo
"(suppone board agganciata a
$COM
)"
if
test
$#
-ne
1
then
...
...
@@ -8,4 +12,4 @@ then
fi
arduino-cli compile
--fqbn
arduino:avr:uno
$1
arduino-cli upload
-p
/dev/ttyACM0
--fqbn
arduino:avr:uno
$1
arduino-cli upload
-p
$COM
--fqbn
arduino:avr:uno
$1
This diff is collapsed.
Click to expand it.
monitorStudenti.sh
0 → 100755
+
59
−
0
View file @
593b2557
#!/bin/bash
# parametro: nome dir (senza path)
# 1) "osserva" (in realtà cicla su) la dir studenti
# 2) compila e flasha il più recente
# 3) pubblica (via MQTT?) un feedback (e.g., dalla seriale)
# 4) attende un po' (1 minuto?) prima di passare al prossimo
# [nel frattempo la cam può essere puntata sull'oggetto]
if
test
$#
-ne
1
then
echo
Usage:
$0
'<sketch dir (without path)>'
exit
1
fi
SKETCH
=
$1
COM
=
/dev/ttyACM0
echo
"(suppone board agganciata a
$COM
)"
sudo stty
-F
$COM
115200
DIR
=
Studenti
echo
"(dir studenti:
$DIR
)"
TOUT
=
"15.0s"
echo
"(timeout:
$TOUT
)"
compila
(){
echo
___
$1
___
if
arduino-cli compile
--fqbn
arduino:avr:uno
$1
then
if
arduino-cli upload
-p
$COM
--fqbn
arduino:avr:uno
$1
then
echo
SUCCESS, lanciare monitor con
timeout
mqtt
$dir
/running
timeout
$TOUT
cat
$COM
|
tee
$dir
/
$SKETCH
.run
#cat $COM
fi
fi
}
mqtt
(){
mosquitto_pub
-h
atrent.it
-t
SistEmbed/arduino-cli
$2
-m
"
$1
"
}
while
echo
===
$(
date
)
===
do
for
dir
in
$(
find
$DIR
-type
d |grep
$SKETCH
|grep
-v
'\.st'
)
do
echo
+++
$dir
+++
compila
$dir
#mqtt senzatopic
#mqtt "contopic sadlkjasldk asldj asldj alskdj" /TOPIC
done
done
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