Enable/Disable WIFI with rfkill
-
This script helps to avoid BT connection problems if you want to connect several PS3 and Shawan controllers to your Pie.
Reference here
So... I wrote a small script that shows you your current IP and checks state of WIFI adapter
If you are connected by eth0 and wlan0 so you will see 2 IPs. If you disable the wifi connection then only eth0 will be active and only one IP is showen. Therefore this script says... "There may be an wifi adapter active" because it checks just radio devices with rfkill.
Place script to:
~/RetroPie/retropiemenu
Get script: https://github.com/crcerror/RetroPie-Shares/blob/master/rfkill_wifi_dialog.shInstall with:
wget http://raw.githubusercontent.com/crcerror/RetroPie-Shares/master/rfkill_wifi_dialog.sh -O "/home/pi/RetroPie/retropiemenu/Wifi Switch.sh"
After reboot the script is located into RetroPie-Settings-Menu ;) -
The same script for ORA XU4
Please download from here: GITHUB ORA XU4 Sharesor get it with
wget http://raw.githubusercontent.com/crcerror/XU4-ORA-scripts/master/wifi_toggle_dialog.sh -O "/home/pigaming/RetroPie/retropiemenu/Wifi Switch.sh"
-
Been fighting with 2 x Wireless PS3 Shanwan clones all day but this has totally fixed the weird problems i was having. (Random Disconnects, Lag, both reconnecting using same channel etc) Thanks Heaps.
-
@Pi-Mania Novice Pi user here. To get this installed do I hit F4 go to CUI, then simply type 'wget http://raw.githubusercontent.com/crcerror/XU4-ORA-scripts/master/wifi_toggle_dialog.sh -O "/home/pigaming/RetroPie/retropiemenu/Wifi Switch.sh"' to install this?
-
@common763 What image have you used for installation ? The
pigaming
user is specific to the Odroid image. -
I just went to the RetroPie site, downloaded v4.4 for the Raspberry Pi 2/3. Then flashed to the SD card. Did it on Windows. Looking to fix issues with bluetooth and PS3 controllers going haywire during gameplay. Someone recommended this thread.
-
@common763 Sure - in this case you need to download the script to
/home/pi/RetroPie/retropiemenu/Wifi Switch.sh
wget http://raw.githubusercontent.com/crcerror/XU4-ORA-scripts/master/wifi_toggle_dialog.sh -O "/home/pi/RetroPie/retropiemenu/Wifi Switch.sh"
-
Thanks. One more stupid question. Will running this affect my wi-fi connect to the PC when I transfer files and such?
-
@common763 Of course, this will stop the Wifi radio so the network connection will not be possible via Wifi. You can toggle it though from the menu (on/off) whenever you need (or not) the Wifi connection.
-
ok. thanks for the help. Will give this a shot to see if it fixes my issues.
-
I just ran this. The Wifi Switch is at the bottom of the RetroPie Menu. When I select it does the same thing that a rom does without the proper bio...just goes back to the screen. ANy suggestions to what I am doing wrong?
-
@common763 All set. I replaced wget http://raw.githubusercontent.com/crcerror/XU4-ORA-scripts/master/wifi_toggle_dialog.sh -O "/home/pi/RetroPie/retropiemenu/Wifi Switch.sh" with wget http://raw.githubusercontent.com/crcerror/RetroPie-Shares/master/rfkill_wifi_dialog.sh -O "/home/pi/RetroPie/retropiemenu/Wifi Switch.sh"
-
@common763 Glad you found out ;)
-
@mitu said in Enable/Disable WIFI with rfkill:
@common763 Sure - in this case you need to download the script to
/home/pi/RetroPie/retropiemenu/Wifi Switch.sh
wget http://raw.githubusercontent.com/crcerror/XU4-ORA-scripts/master/wifi_toggle_dialog.sh -O "/home/pi/RetroPie/retropiemenu/Wifi Switch.sh"
Excuse me Sir. The XU4-ORA script does NOT work for Raspberry and vice versa.
- Raspberry uses
rfkill
for radio actions - ORA uses
nmcli
The XU4 is a realy nice device it's a full grown debian/ubuntu platform ;)
- Raspberry uses
-
@mitu Just a quetion. This will disable the onboard wifi, but if I block the wifi with this script and then plug a wifi dongle (On a rpi3), I will be using the dongle wifi? Thanks
-
@Shaddonai I'm not sure,
rfkill
can selectively disable/enable Wifi individually, I'm not sure the script can do that (i.e. choose which Wifi connection to stop).
But, as you said, if you use it before you're adding your Wifi dongle, then it should be fine. -
@Shaddonai There are more effective methods available to block onboard wifi.
Adddtoverlay=pi3-disable-wifi
toboot/config.txt
and then it's device drivers are not loaded during boot.rfkill
behaves like a software toggle and I assume if you plug in annother WiFi device then the whole stack will be resetted. Means both connections are active but not if you use the overlay above.@mitu
Yes rfkill can disable/enable devices by it's device number. But I do not know if the device number keeps unique everytime ;) -
@mitu Thanks!
-
@cyperghost Actually I am searching for an sript that let me disable the onboard bluetooth by modifying the config.txt, but I did not find one so I am trying with rfkill. If you know an script like that, please let me know.
-
@Shaddonai here you are - disable Bluetooth
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.