Skip to content

redone wifi connection logic.#122

Open
Lupinixx wants to merge 2 commits intoOpenIPC:masterfrom
Lupinixx:wifi-connection-redone
Open

redone wifi connection logic.#122
Lupinixx wants to merge 2 commits intoOpenIPC:masterfrom
Lupinixx:wifi-connection-redone

Conversation

@Lupinixx
Copy link
Copy Markdown
Contributor

@Lupinixx Lupinixx commented May 4, 2026

redone wifi connection logic. Can now scan for wifi and display all found wifi networks, stores SSID + password to make switching between networks easy. When selecting a password protected network, it will show an inputfield with the keyboard to fill it in.
image
image
This has a connected PR for gsmenu.sh in sbc-groundstation

@henkwiedig
Copy link
Copy Markdown
Collaborator

I Like the design.
Still some issues, will comment on the sbc-gs PR here as well.

Pixelpilot_rk

  • please rebase to master
  • add gsmenu.sh stubs or examples to make it not break if one uses the vanilla gemenu.sh
  • When i enable hotspot it still show a connected Wifi
  • double call of "gsmenu.sh get gs wifi hotspot" during page load
  • Maybe swap color for connected and not connected network, OpenIPC color -> enabled, same as switches

@OpenIPC/sbc-groundstations#90

  • use ifup/down instead of iw,pkill
  • do we need auto reconnect to managed network on hotspot disconnect ?
  • disconnecting from managed network does not disconnect for me -> use ifup/down script
  • pkill might also kill the apfpv udhcpd -> use ifup/down scripts

Idea:
Why storing passwords in a seperate file, we already have working wpa_supplicant.*.conf files with the passwords in it, just use them.
Original implementation just used ifdown and disabled auto up for the link.

@Lupinixx
Copy link
Copy Markdown
Contributor Author

Lupinixx commented May 4, 2026

Thanks for the review, i'll look into it.
Reasoning behind the grayed out 'button' for the conencted wifi network is, that that button is not supposed to be clicked. While you can click the blue buttons, to connect to that wifi network. For me having all grayed buttons feels like they are not something you can click.

Lupinixx and others added 2 commits May 5, 2026 23:26
…ound wifi networks, stores SSID + password to make switching between networks easy.

Co-authored-by: Copilot <copilot@github.com>
@Lupinixx Lupinixx force-pushed the wifi-connection-redone branch from 5003f65 to ff55eef Compare May 5, 2026 21:27
@Lupinixx
Copy link
Copy Markdown
Contributor Author

Lupinixx commented May 5, 2026

@henkwiedig
Sidenote; i did not mention before but this is mostly vibecoded.
Thanks for the review! Here's where things stand:

PixelPilot_rk

  • Rebase to master — done.
  • gsmenu.sh stubs — the vanilla gsmenu.sh now has full working implementations for all get/set gs wifi commands using nmcli (available on standard Ubuntu-based systems the upstream targets). No more empty stubs that silently do nothing.
  • Hotspot shows connected WiFi — fixed in gs_wifi.c: rebuild_network_list now skips the get gs wifi ssid call when the hotspot switch is checked, so no network gets the "Connected" marking while in AP mode. hotspot_switch_status_cb also triggers a list refresh on toggle.
  • Double call of get gs wifi hotspot — fixed by making both set gs wifi hotspot on/off idempotent: they check current state first and exit 0 immediately if nothing needs to change, so the spurious call on page load is harmless without needing to touch the C code.
  • Color swap — Personally think this is the way to go, keep unconnected networks blue, like they are one you can click, to connect to the network.

sbc-groundstations (#90)

  • ifup/down instead of iw/pkill — done throughout. All connect/disconnect/wlan/hotspot handlers use ifdown/ifup exclusively. No pkill, no iw for connection management.
  • Auto-reconnect on hotspot off — removed. Turning off the hotspot just does ifdown and cleans up the config files; the user reconnects manually, matching the original behaviour.
  • Disconnect not working — was using iw; now ifdown wlan0 + removes /etc/network/interfaces.d/wlan0 to disable auto-up at boot.
  • pkill killing apfpv udhcpd — no longer an issue. The only killall udhcpd is in the hotspot interface's pre-down hook, so it only fires when that specific interface is brought down via ifdown.
  • Passwords from wpa_supplicant.conf — done. get gs wifi savednetworks and get gs wifi password both read directly from /etc/wpa_supplicant.conf. No separate password file. New networks are saved/updated in that same conf via a wpa_conf_update_network helper that removes any existing stanza for the SSID and appends the updated one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants