You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possible Bug: The script in start.sh uses iwgetid -r to check if WiFi is connected, but does not handle different exit statuses which might not be reliable across all environments or might fail silently.
Enhancement Suggestion: Consider adding error handling or a more robust method to verify the WiFi connection status.
Add a check to ensure the SSID is set before starting WiFi Connect
Add a check for the SSID environment variable before attempting to start the WiFi Connect. This ensures that the SSID is set and prevents the script from failing if it's not provided.
if [ $? -eq 0 ]; then
printf 'Skipping WiFi Connect\n'
+elif [ -z "$SSID" ]; then+ printf 'Error: SSID is not set.\n'+ exit 1
else
printf 'Starting Earth Defenders Toolkit Hotspot and Captive-Portal\n'
./wifi-connect --portal-ssid "$SSID"
fi
Suggestion importance[1-10]: 9
Why: This suggestion adds a crucial check for the SSID environment variable, which prevents potential runtime errors if the SSID is not set. This is a significant improvement in terms of robustness and reliability.
9
Best practice
Pin the version of the Debian base image to ensure consistent builds
Pin the version of the base image to ensure consistent, reproducible builds. Using a specific version helps avoid unexpected changes due to updates in the base image.
Why: Pinning the base image version is a best practice that ensures consistent and reproducible builds, reducing the risk of unexpected changes due to updates in the base image.
8
Add a version specification to the Docker Compose file
Specify a version for the Docker Compose file to ensure compatibility and predictable behavior across different versions of Docker Compose.
Why: Adding a version specification to the Docker Compose file is a good practice that ensures compatibility and predictable behavior, although it is not as critical as some other changes.
7
Use direct test command for checking iwgetid -r output
Replace the use of $? with a direct test command to check the output of iwgetid -r for a more reliable and readable condition check.
Why: Using a direct test command for checking iwgetid -r output improves readability and reliability, but it is a minor improvement compared to other suggestions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Python wifi isn't maintained anymore and is having problems.
Use latest wifi-connect instead of python-wifi.
PR Type
Enhancement, Configuration changes
Description
start.shto skip WiFi Connect if already connected.wifi-connectwith the new arguments.balena.ymlfrom 0.5.0 to 0.5.4.python-wifi-connecttowifi-connectindocker-compose.ymland updated the service configuration.python-wifi-connect.wifi-connectwith architecture-specific handling and latest version fetching.Changes walkthrough 📝
start.sh
Add connection check and update WiFi Connect usageservices/wifi-connect/start.sh
wifi-connectwith the new arguments.docker-compose.yml
Switch to wifi-connect and update service configurationdocker-compose.yml
python-wifi-connecttowifi-connect.wifi-connect.Dockerfile.template
Add Dockerfile template for wifi-connectservices/wifi-connect/Dockerfile.template
wifi-connect.balena.yml
Update application version to 0.5.4balena.yml
Dockerfile
Remove old Dockerfile for python-wifi-connectservices/wifi-connect/Dockerfile
python-wifi-connect.