Add startup delay script for the roboRIO
The network was slow to come up. So we now wait until we can ping the
pi's before starting up message bridge client.
Change-Id: I3f4d055b6fcdad1ee08aff3f1286ec1eef72fb14
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2022/BUILD b/y2022/BUILD
index 83438ec..9e80b5f 100644
--- a/y2022/BUILD
+++ b/y2022/BUILD
@@ -10,6 +10,7 @@
],
data = [
":aos_config",
+ ":message_bridge_client.sh",
"@ctre_phoenix_api_cpp_athena//:shared_libraries",
"@ctre_phoenix_cci_athena//:shared_libraries",
],
diff --git a/y2022/message_bridge_client.sh b/y2022/message_bridge_client.sh
new file mode 100755
index 0000000..c81076a
--- /dev/null
+++ b/y2022/message_bridge_client.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+while true;
+do
+ ping -c 1 pi1 -W 1 && break;
+ sleep 1
+done
+
+echo Pinged
+
+exec /home/admin/bin/message_bridge_client "$@"
diff --git a/y2022/y2022_pi_template.json b/y2022/y2022_pi_template.json
index 3dff81e..4e47b07 100644
--- a/y2022/y2022_pi_template.json
+++ b/y2022/y2022_pi_template.json
@@ -324,6 +324,7 @@
{
"name": "message_bridge_client",
"executable_name": "message_bridge_client",
+ "args": ["--rt_priority=16"],
"nodes": [
"pi{{ NUM }}"
]
diff --git a/y2022/y2022_roborio.json b/y2022/y2022_roborio.json
index 6e14bae..fa3406e 100644
--- a/y2022/y2022_roborio.json
+++ b/y2022/y2022_roborio.json
@@ -471,8 +471,8 @@
]
},
{
- "name": "message_bridge_client",
- "executable_name": "message_bridge_client",
+ "name": "roborio_message_bridge_client",
+ "executable_name": "message_bridge_client.sh",
"args": ["--rt_priority=16"],
"nodes": [
"roborio"