RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Enable/Disable WIFI with rfkill

    Scheduled Pinned Locked Moved Projects and Themes
    wifidisable wificyperghostraspberryxu4
    31 Posts 8 Posters 12.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cyperghostC
      cyperghost
      last edited by cyperghost

      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.sh

      Install 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 ;)

      1 Reply Last reply Reply Quote 5
      • cyperghostC
        cyperghost
        last edited by cyperghost

        The same script for ORA XU4
        Please download from here: GITHUB ORA XU4 Shares

        or 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"

        1 Reply Last reply Reply Quote 0
        • P
          Pi-Mania
          last edited by

          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.

          C 1 Reply Last reply Reply Quote 0
          • C
            common763 @Pi-Mania
            last edited by

            @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?

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @common763
              last edited by

              @common763 What image have you used for installation ? The pigaming user is specific to the Odroid image.

              1 Reply Last reply Reply Quote 0
              • C
                common763
                last edited by

                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.

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @common763
                  last edited by

                  @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"
                  
                  cyperghostC 2 Replies Last reply Reply Quote 0
                  • C
                    common763
                    last edited by

                    Thanks. One more stupid question. Will running this affect my wi-fi connect to the PC when I transfer files and such?

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @common763
                      last edited by

                      @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.

                      S 1 Reply Last reply Reply Quote 0
                      • C
                        common763
                        last edited by

                        ok. thanks for the help. Will give this a shot to see if it fixes my issues.

                        1 Reply Last reply Reply Quote 0
                        • C
                          common763
                          last edited by

                          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?

                          C 1 Reply Last reply Reply Quote 0
                          • C
                            common763 @common763
                            last edited by

                            @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"

                            1 Reply Last reply Reply Quote 0
                            • cyperghostC
                              cyperghost @mitu
                              last edited by cyperghost

                              @common763 Glad you found out ;)

                              1 Reply Last reply Reply Quote 0
                              • cyperghostC
                                cyperghost @mitu
                                last edited by cyperghost

                                @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 ;)

                                1 Reply Last reply Reply Quote 0
                                • S
                                  Shaddonai @mitu
                                  last edited by

                                  @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

                                  mituM cyperghostC 2 Replies Last reply Reply Quote 0
                                  • mituM
                                    mitu Global Moderator @Shaddonai
                                    last edited by

                                    @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.

                                    S 1 Reply Last reply Reply Quote 0
                                    • cyperghostC
                                      cyperghost @Shaddonai
                                      last edited by cyperghost

                                      @Shaddonai There are more effective methods available to block onboard wifi.
                                      Add dtoverlay=pi3-disable-wifi to boot/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 ;)

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        Shaddonai @mitu
                                        last edited by

                                        @mitu Thanks!

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          Shaddonai @cyperghost
                                          last edited by

                                          @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.

                                          cyperghostC 1 Reply Last reply Reply Quote 0
                                          • cyperghostC
                                            cyperghost @Shaddonai
                                            last edited by

                                            @Shaddonai here you are - disable Bluetooth

                                            S 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.