Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wait for diagnostics to be ready #113

Merged
merged 2 commits into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions start-gateway-config.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
#!/usr/bin/env sh

# Wait for the diagnostics app to be loaded
until wget -q -T 10 -O - http://localhost/json > /dev/null 2>&1
do
echo "Diagnostics container not ready. Going to sleep."
sleep 10
done

# Load dbus-wait script
. ./dbus-wait.sh

# Advertise on channels 37, 38 and 39
echo 7 > /sys/kernel/debug/bluetooth/hci0/adv_channel_map
# Send a beacon every 152.5 ms
# Send a beacon every 153 x 0.625ms = 95.625ms (244 is 152.5ms)
echo 153 > /sys/kernel/debug/bluetooth/hci0/adv_min_interval
echo 153 > /sys/kernel/debug/bluetooth/hci0/adv_max_interval

# Disable pairing

printf "pairable off\nquit" | /usr/bin/bluetoothctl

# Check dbus container is ready and then launch config
wait_for_dbus \
&& python gatewayconfig