Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MessdatenSilo
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Kloock
MessdatenSilo
Commits
d2f8b86a
Commit
d2f8b86a
authored
3 years ago
by
SirWalross
Browse files
Options
Downloads
Patches
Plain Diff
Fix #3
parent
09796c45
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/write.bash
+5
-8
5 additions, 8 deletions
scripts/write.bash
with
5 additions
and
8 deletions
scripts/write.bash
+
5
−
8
View file @
d2f8b86a
...
@@ -18,8 +18,7 @@ then
...
@@ -18,8 +18,7 @@ then
else
else
echo
-e
"
\x
1b[31mError: Something went wrong.
\x
1b[0m"
echo
-e
"
\x
1b[31mError: Something went wrong.
\x
1b[0m"
echo
-e
"Exiting"
echo
-e
"Exiting"
serial_dms
=
/dev/ttyACM1
exit
1
serial_temp
=
/dev/ttyACM0
fi
fi
echo
-e
"Info: DMS arduino:
$serial_dms
, Temp arduino:
$serial_temp
"
echo
-e
"Info: DMS arduino:
$serial_dms
, Temp arduino:
$serial_temp
"
...
@@ -27,22 +26,20 @@ echo -e "Info: DMS arduino: $serial_dms, Temp arduino: $serial_temp"
...
@@ -27,22 +26,20 @@ echo -e "Info: DMS arduino: $serial_dms, Temp arduino: $serial_temp"
echo
"Checking connected devices..."
echo
"Checking connected devices..."
device_list
=
$(
arduino-cli board list
)
device_list
=
$(
arduino-cli board list
)
connected_devices
=
$(
echo
$device_list
|
grep
"^
\(\(
$serial_dms
\)\|\(
$serial_temp
\)\)
.*
$fqbn
.*
$core
"
|
wc
-l
)
connected_devices
=
$(
echo
"
$device_list
"
|
grep
"^
\(\(
$serial_dms
\)\|\(
$serial_temp
\)\)
.*
$fqbn
.*
$core
"
|
wc
-l
)
if
[[
$connected_devices
!=
"2"
]]
if
[[
$connected_devices
!=
"2"
]]
then
then
echo
-e
"
\x
1b[31mError: not all arduino devices are connected, only found:
$connected_devices
.
\x
1b[0m"
echo
-e
"
\x
1b[31mError: not all arduino devices are connected, only found:
$connected_devices
.
\x
1b[0m"
echo
-e
"Connected devices are:
\n
$device_list
"
echo
-e
"Connected devices are:
\n
$device_list
"
echo
-e
"Exiting."
echo
-e
"Exiting."
exit
1
fi
fi
echo
"Checking installed cores..."
echo
"Checking installed cores..."
core_list
=
$(
arduino-cli core list
)
core_list
=
$(
arduino-cli core list
)
core_list_installed
=
$(
echo
$core_list
|
grep
"
$core
"
)
core_list_installed
=
$(
echo
"
$core_list
"
|
grep
"^
$core
"
)
echo
$core_list
echo
$core_list
|
grep
"
$core
"
if
[[
-z
$core_list_installed
]]
if
[[
-z
$core_list_installed
]]
then
then
...
@@ -61,7 +58,7 @@ then
...
@@ -61,7 +58,7 @@ then
arduino-cli core
install
$core
arduino-cli core
install
$core
core_list
=
$(
arduino-cli core list
)
core_list
=
$(
arduino-cli core list
)
core_list_installed
=
$(
echo
-e
$core_list
|
grep
"^
$core
"
)
core_list_installed
=
$(
echo
"
$core_list
"
|
grep
"^
$core
"
)
if
[[
-z
$core_list_installed
]]
if
[[
-z
$core_list_installed
]]
then
then
...
...
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