Skip to content

Commit 0590f60

Browse files
committed
Updated Create 3 curl commands
Move wifi and create update scripts to /usr/local/bin
1 parent c15b605 commit 0590f60

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

scripts/create_update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Help()
77
{
8-
echo "Create 3 update script for robots running G.1.1 or higher"
8+
echo "Create 3 update script for robots running G.2.1 or higher"
99
echo
1010
echo "usage: bash create_update.sh /path/to/image.swu [-h]"
1111
echo "options:"

scripts/turtlebot4_setup.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,12 @@ ros2 run robot_upstart install turtlebot4_bringup/launch/$model.launch.py --job
9898

9999
sudo systemctl daemon-reload
100100

101-
# Copy Wifi script to home directory
102-
sudo cp $SETUP_DIR/scripts/wifi.sh ~/
101+
# Copy Wifi and Create 3 Update scripts to local bin
102+
chmod +x $SETUP_DIR/scripts/wifi.sh
103+
sudo cp $SETUP_DIR/scripts/wifi.sh /usr/local/bin
104+
105+
chmod +x $SETUP_DIR/scripts/create_update.sh
106+
sudo cp $SETUP_DIR/scripts/create_update.sh /usr/local/bin
103107

104108
read -p "Installation complete, press enter to reboot."
105109

scripts/wifi.sh

100644100755
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ Help()
2121
}
2222

2323
ap=0;
24+
create3=0;
2425

25-
while getopts "s:p:c:r:ha" flag
26+
while getopts "s:p:cr:ha" flag
2627
do
2728
case "${flag}" in
2829
s) ssid=${OPTARG};;
@@ -98,7 +99,7 @@ echo -e "network: \n\
9899

99100
# Add regulatory domain
100101

101-
# If reg domain already exists, replace it
102+
If reg domain already exists, replace it
102103
if grep -Fq "REGDOMAIN=" /etc/default/crda
103104
then
104105
sudo sed -i "s/REGDOMAIN=.*/REGDOMAIN=$domain/g" /etc/default/crda
@@ -107,17 +108,30 @@ else
107108
fi
108109

109110

110-
# If country domain already exists, replace it
111+
If country domain already exists, replace it
111112
if grep -Fq "COUNTRY=" /etc/environment
112113
then
113114
sudo sed -i "s/COUNTRY=.*/COUNTRY=$domain/g" /etc/environment
114115
else
115116
echo "COUNTRY=$domain" | sudo tee -a /etc/environment
116117
fi
117118

119+
create3_domain=ETSI;
120+
121+
case $domain in
122+
123+
AS|CA|FM|GU|KY|MP|PR|TW|UM|US|VI)
124+
create3_domain=FCC
125+
;;
126+
127+
JP)
128+
create3_domain=Japan
129+
;;
130+
esac
131+
118132
if [ $create3 -eq 1 ]
119133
then
120-
curl -X POST -d "ssid=$ssid&passwd=$password" "http://192.168.186.2/cgi-bin/provisioning"
134+
curl -X POST -d "ssids=$ssid&pass=$password&countryids=$create3_domain" "http://192.168.186.2/wifi-action-change"
121135
fi
122136

123137
sudo netplan generate

0 commit comments

Comments
 (0)