• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
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.
  • C
    cyperghost
    last edited by cyperghost 24 Oct 2018, 16:54

    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
    • C
      cyperghost
      last edited by cyperghost 11 Feb 2018, 16:41 2 Nov 2018, 16:39

      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 27 Jan 2019, 10:34

        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 28 Jan 2019, 11:24 Reply Quote 0
        • C
          common763 @Pi-Mania
          last edited by 28 Jan 2019, 11:24

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

          M 1 Reply Last reply 28 Jan 2019, 11:26 Reply Quote 0
          • M
            mitu Global Moderator @common763
            last edited by 28 Jan 2019, 11:26

            @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 28 Jan 2019, 11:32

              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.

              M 1 Reply Last reply 28 Jan 2019, 11:35 Reply Quote 0
              • M
                mitu Global Moderator @common763
                last edited by 28 Jan 2019, 11:35

                @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"
                
                C 2 Replies Last reply 28 Jan 2019, 18:21 Reply Quote 0
                • C
                  common763
                  last edited by 28 Jan 2019, 11:40

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

                  M 1 Reply Last reply 28 Jan 2019, 11:42 Reply Quote 0
                  • M
                    mitu Global Moderator @common763
                    last edited by 28 Jan 2019, 11:42

                    @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 2 Feb 2019, 15:55 Reply Quote 0
                    • C
                      common763
                      last edited by 28 Jan 2019, 11:43

                      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 28 Jan 2019, 15:18

                        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 28 Jan 2019, 15:46 Reply Quote 0
                        • C
                          common763 @common763
                          last edited by 28 Jan 2019, 15:46

                          @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
                          • C
                            cyperghost @mitu
                            last edited by cyperghost 28 Jan 2019, 18:21

                            @common763 Glad you found out ;)

                            1 Reply Last reply Reply Quote 0
                            • C
                              cyperghost @mitu
                              last edited by cyperghost 28 Jan 2019, 18:24

                              @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 2 Feb 2019, 15:55

                                @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

                                M C 2 Replies Last reply 2 Feb 2019, 16:25 Reply Quote 0
                                • M
                                  mitu Global Moderator @Shaddonai
                                  last edited by 2 Feb 2019, 16:25

                                  @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 2 Feb 2019, 18:31 Reply Quote 0
                                  • C
                                    cyperghost @Shaddonai
                                    last edited by cyperghost 2 Feb 2019, 16:47 2 Feb 2019, 16:44

                                    @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 2 Feb 2019, 18:45 Reply Quote 0
                                    • S
                                      Shaddonai @mitu
                                      last edited by 2 Feb 2019, 18:31

                                      @mitu Thanks!

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        Shaddonai @cyperghost
                                        last edited by 2 Feb 2019, 18:45

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

                                        C 1 Reply Last reply 2 Feb 2019, 18:51 Reply Quote 0
                                        • C
                                          cyperghost @Shaddonai
                                          last edited by 2 Feb 2019, 18:51

                                          @Shaddonai here you are - disable Bluetooth

                                          S 1 Reply Last reply 3 Feb 2019, 14:45 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.

                                            [[user:consent.lead]]
                                            [[user:consent.not_received]]