Update enable-wifi to read PSK input from stdin#1870
Conversation
Automated comment from CodeApprove ➜⏳ @jdeanwallace please review this Pull Request |
There was a problem hiding this comment.
Automated comment from CodeApprove ➜
⏳ Approval Pending (3 unresolved comments)
Approval will be granted automatically when all comments are resolved
LGTM!
In: Discussion
The code looks good and seems to edit /etc/wpa_supplicant/wpa_supplicant.conf correctly. However, I'm having some issue connecting to my own wifi network at home when specifying a password, but I've had issues before.
Can you confirm that you're able to connect to your network when a password is specified?
In: app/network.py:
> Line 163
process.communicate(input=wifi_settings.psk)
It's technically not correct that we always specify a stdin pipe, even when there isn't a password. Can we rather do something like this?
if wifi_settings.psk:
args.append('--psk')
subprocess.Popen(args, stdin=subprocess.PIPE, text=True).communicate(input=wifi_settings.psk)
else:
subprocess.Popen(args)In: debian-pkg/opt/tinypilot-privileged/scripts/enable-wifi:
> Line 16
The password must be 8-63 characters in length.
Can we specify that this is the password used for authenticating with the wifi network? Suggestion:
Optional. Authenticate with the WiFi network using a password read from stdin. The password must be 8-63 characters in length.
👀 @db39 it's your turn please take a look
db39
left a comment
There was a problem hiding this comment.
Automated comment from CodeApprove ➜
In: Discussion
Can you confirm that you're able to connect to your network when a password is specified?
Yes - I'm able to connect to my Wi-Fi network using a password:
In: app/network.py:
> Line 162
process.communicate(input=wifi_settings.psk)
Resolved
In: debian-pkg/opt/tinypilot-privileged/scripts/enable-wifi:
Resolved
jdeanwallace
left a comment
There was a problem hiding this comment.
Automated comment from CodeApprove ➜
Approved: I have approved this change on CodeApprove and all of my comments have been resolved.

Resolves https://github.com/tiny-pilot/tinypilot-pro/issues/1464
This change updates the enable-wifi script to read the PSK from stdin instead of using an argument.
We also update the enable_wifi function in network.py to use the new stdin interface.