RetroPie Wifi Manager
-
@paradoxgbb said in RetroPie Wifi Manager:
@philcomm For what it's worth, I agree with you very much. I didn't really expect pushback in that other thread, but I did, a bit. The fact is people want to travel with their pis, and some others feel that this is outside the bounds of the project.
In my scripts I was leveraging generating wifikeyfile.txt (in clear text!) and dropping it into /boot. Then you can import it with RetroPie's existing wifi configuration screens.
I think the sticking point might be that there's not firm consensus on the cleanest way to integrate to get the job done. The previous approach was to build this in emulationstation but that doesn't directly configure WiFi. The existing screens RetroPie-Setup uses might be able to be extended, but I'm not sure what dependencies they leverage to work without digging.
Good luck and again, let me know if you want another pair of eyes.
I kinda get the RetroPie team on the topic of not baking a OSK into emulationstation, since this would mean they need to make a seperate build of
es
and then constantly rebasing it on a new release and making sure it works. So I think my solution is more reasonable. I would really be interested how thewifikeyfile.txt
stuff works, so far I have only worked with thewpa_supplicant.conf
(just a minute ago I finished the full parsing, so now I can disassemble it, do changes programatically, assemble it and then write it to the file). -
@philcomm Since you seem interested, this is an earlier version of the script I was using. It's super easy, just put the sid and psk and that's all you have to do. Very little fuss. I had another script that copied this into \boot. On the wifi screen option 3 allows you to import the credentials from there, so the integration might be easier as you won't have to deal with hashing. Since it's in a more secure cleartext should be ok to store temporarily but you'll need sudo.
#!/bin/bash ########## # GLOBALS ########## exportTarget="/home/pi/RetroPie/roms/wifikeyfile.txt" defaultssid="GregMotoX4" function logInfo() { echo [$(date)] $1 } ####### # MAIN ####### echo currentssid=$(wpa_cli get_network 0 ssid) currentssid=$(echo "$currentssid" | tail -1) #Second line currentssid=$(echo ${currentssid//$'"'}) #Trim quotes if [ "[$currentssid]" != "[FAIL]" ] && [ "[$currentssid]" != "[Using interface 'wlan0']" ]; then logInfo "Detected current SSID...[$currentssid]" defaultssid=$currentssid fi logInfo "Default SSID if entered blank: [$defaultssid]" read -p $'SSID: \x0a' ssid=${REPLY//$'\r\n'} logInfo "ENTERED SSID: [$ssid]" if [ "[$ssid]" == "[]" ]; then logInfo "SSID not set! Using default..." ssid=$defaultssid fi read -p $'PSK: \x0a' psk=${REPLY//$'\r\n'} logInfo "ENTERED PSK: [$psk]" if [ "[$psk]" == "[]" ]; then logInfo "PSK not set! Try again." exit fi if [ -f $exportTarget ]; then logInfo "Target [$exportTarget] found. Overwriting..." fi echo ssid=\"$ssid\" > $exportTarget echo psk=\"$psk\" >> $exportTarget logInfo "Done!" echo
-
The gdrive link worked, thanks.
Looks nice, it reminds me of the stage password screen for old games. -
Quick update on the project:
It is now in a fully usable state.
First you have the wifi selection screen where you ... select your wifi. If you select one that is already saved, a prompt pops up asking if you wanna proceed since the old config will be overwritten.
Then you need to enter the password. B now acts as backspace, so you don't need to use the one on the OSK.
The next screen shows the integrity of the entered password. Since
wpa_passphrase
, which I use to generate the config text, requires at least 8 characters, this needs to be checked before saving.If everything is valid, the next step then puts together the old
wpa_supplicant.conf
with the new network. The generated network also getspriority=1
, all other networks getpriority=0
.
Then the config is saved and the network card restarted.The next step is to add wifi deletion from the selection screen. I also wanna have a
set priority
button or something on the same page.I am really happy how this turned out. I will create a PR to the
RetroPie-Setup
repo, hopefully someone will look into it. -
Please send it some love: https://github.com/RetroPie/RetroPie-Setup/pull/3429
-
@paradoxgbb if you are interested,
wget -P /home/pi/RetroPie-Setup/scriptmodules/supplementary/ "https://raw.githubusercontent.com/OfficialPhilcomm/retropie-wifi-manager/master/advanced-wifi.sh"
will download a config file into your RetroPie-Setup. You can then open RetroPie Setup from EmulationStation -> Manage packages -> experimental -> advanced-wifi. Let me know your thoughts, would love to hear them! -
@philcomm I will very soon, thanks. Probably won't be until Monday or Tuesday though... good luck with the PR, I'll nudge there when I have the chance to play.
-
@philcomm if one would like to keep the local master of
RetroPie-Setup
clean (which has serveral advantages), it can be done by creating a local branch with your proposed pull request, as outlined here: https://retropie.org.uk/forum/post/260327 - saves you the burden of adding/removing files to/from the local master explicitly. -
@lolonois Thank you, I might do this when they don't accept the PR.
-
In the meantime, here are some development updates:
-
@philcomm my git hint was more general for anyone interested to testdrive your proposed change/PR. I just missed to remove your handle :/ -- However, your PR looks very promising.
-
@lolonois Thanks! I really hope it gets accepted. I put a solid 20 hours into this so far.
-
@lolonois said in RetroPie Wifi Manager:
@philcomm my git hint was more general for anyone interested to testdrive your proposed change/PR. I just missed to remove your handle :/ -- However, your PR looks very promising.
https://github.com/RetroPie/RetroPie-Setup/pull/3429#issuecomment-974847831 :(
-
@philcomm Sorry for the PR not being accepted, unfortunately maintainance considerations are always a big factor for new additions in RetroPie.
I liked your idea of adding a text (curses) based OSK and the minimal ui. My intention was to add some sort of OSK and was considering something SDL based (either
python-sdl2
orpython-imgui[sdl]
so it would be easy to script).I experimented a bit with the urwid
python
library to add a simple input box to the WiFi module. My main goals were to make it work withjoy2key
and to look similar to the existing text UI (based ondialog
) that RetroPie-Setup uses.It turned out pretty close to the
dialog
based screensDefault view Smaller screen Error message I have submitted a PR with this and some minor changes to the WiFi module.
NOTE: the changes I proposed don't include support for multiple networks or prioritization (which your WiFi manager has), but I think these can be added later in the main WiFi module.
-
@mitu Nice, I will check it out later!
-
@mitu said in RetroPie Wifi Manager:
@philcomm Sorry for the PR not being accepted, unfortunately maintainance considerations are always a big factor for new additions in RetroPie.
I liked your idea of adding a text (curses) based OSK and the minimal ui. My intention was to add some sort of OSK and was considering something SDL based (either
python-sdl2
orpython-imgui[sdl]
so it would be easy to script).I experimented a bit with the urwid
python
library to add a simple input box to the WiFi module. My main goals were to make it work withjoy2key
and to look similar to the existing text UI (based ondialog
) that RetroPie-Setup uses.It turned out pretty close to the
dialog
based screensDefault view Smaller screen Error message I have submitted a PR with this and some minor changes to the WiFi module.
NOTE: the changes I proposed don't include support for multiple networks or prioritization (which your WiFi manager has), but I think these can be added later in the main WiFi module.
How can I get it to work? I cloned your PR on one of my machines, updated RetroPie to make sure everything is installed, but I don't see the osk.
-
@philcomm You need to run first
sudo ./retropie_packages.sh joy2key depends sudo ./retropie_packages.sh joy2key install_bin
and then use the WiFi module as usual. The OSK should be used when the network name/pass is asked.
EDIT: commands should be run from
$HOME/RetroPie-Setup
. -
@paradoxgbb tip from me: you can spice your GPi up by using https://github.com/OfficialPhilcomm/retropie-music, a music script I wrote a while ago to have background music in the menus. I never get over hearing
Without Me
by eminem in 8 bit while in the menus. -
@philcomm First off, I'm sorry that your OSK as originally engineered looks like it won't be accepted --- but I wanted to thank you for really moving the ball forward on this, because it looks like the python-based one will make it through as per recent comments on the PR. This is going to save a lot of people time and frustration and you should get a large chunk of the credit.
For fun last week as I was setting up my Zero2W I connected via SSH to it and attempted to enter Wifi via my phone using the existing infrastructure by executing RetroPie-Setup directly. Although in theory this seemed like a good idea, the WiFi won't drop and reconnect to a new network when you're using that connection for the terminal session, turns out. So, still very clunky.
Will check out your music suggestion, and also the new OSK coming down the pike. Thanks so much.
I think I might have found some quirks around the safe shutdown script with the Zero2W around pin allocation and interaction with WiFi but I want to do some more testing this week before making further topics or inquiries about it here. I also will share some additional script suggestions / observations too.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.