Choirrulloh / autohotspot

Raspberry Pi Auto-HotSpot Scripts and configuration tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scripts to install, remove and manage an Auto-HotSpot on a Raspberry Pi

Version 20191011

Auto-HotSpot is a feature that allows the Raspberry Pi to become a "HotSpot" (WiFi access point). This allows other computers, phones, and tablets to connect to and operate the Pi (using VNC) over WiFi. This Auto-HotSpot uses the script written by roboberry for use on Raspbian Stretch or Buster.

Changes

The author of the autohotspot script has rearranged his website, which broke my configure-autohotspot.sh script. This version points to the new location of roboberry's script.

It also more completely removes files related to autohotspot, should you opt to remove it from your system.

If you've already configured AutoHotSpot and it's working for you, you can leave it as-is. However I recommend that at your convenience you update autohotpsot using the Raspberry > Hamapps > Update Pi and Ham Apps menu item, then run Raspberry > Preferences > Manage Auto-HotSpot and select "Remove Autohotspot". Once it's removed, run Raspberry > Preferences > Manage Auto-HotSpot again. You should see your previous settings - change them if desired. Click OK to re-activate your AutoHotSpot.

Prerequisites

  • Raspberry Pi 3B, 3B+ or 4 (NOTE: I have only tested this image with 3B and 3B+.) running the Hampi image
  • Familiarity with the Pi's Terminal application and basic LINUX commands

Installation

Pick either Easy or Manual Installation below.

Easy Installation

  1. Click Raspberry > Hamradio > Update Pi and Ham Apps.
  2. Check autohotspot, click OK.

Manual Installation

  1. Open a Terminal and run these commands:

     cd ~
     rm -rf autohotspot/ 
     git clone https://github.com/AG7GN/autohotspot  
     sudo cp hamapps/*.sh /usr/local/bin/
     sudo cp hamapps/autohotspot.desktop /usr/local/share/applications/
     rm -f .local/share/applications/autohotspot.desktop
     rm -rf autohotspot/
    
  2. Close the Terminal by clicking File > Close Window or typing exit and press Enter in the Terminal window.

  3. Click Raspberry > Preferences > Manage Auto-HotSpot. Follow the instructions on the screen.

Operational Notes

  1. The Pi will create a HotSpot if none of the configured WiFi networks (as defined in /etc/wpa_supplicant/wpa_supplicant.conf) are within range and Auto-HotSpot is installed and enabled. Otherwise, your Pi will connect to your WiFi network like any other client.

  2. Internet access is not required for Auto-HotSpot to work. But, if the Pi's ethernet port is connected to a network that has Internet access, the Pi (if Auto-HotSpot is active) will be come a router and act as a HotSpot with Internet access to any WiFi client that connects to it.

  3. When Auto-HotSpot is active, if you hover your mouse over the network icon in the menu bar in the upper right corner of the screen (just to the left of the speaker icon), you will see a status of "wlan0:STOPPED". That means the Pi's WiFi interface is in hotspot mode.

  4. When Auto-HotSpot is inactive or uninstalled, clicking on the network icon should show a list of available WiFi networks. Select the desired network and provide the password. Once connected, this network will automatically be added to the /etc/wpa_supplicant/wpa_supplicant.conf file. If you install/enable Auto-HotSpot at this point, the HotSpot will not activate as long as your Pi can connect to this WiFi network.

  • If you no longer want to use the WiFi network the Pi is currently connected to, click on the opposing arrows icon, then right-click on the checked network. Click OK when prompted "Do you want to disconnect from the Wi-Fi network...?". This will remove this WiFi network from /etc/wpa_supplicant/wpa_supplicant.conf. Remember that if you disconnect while operating the Pi remotely, you will "saw off the limb you're sitting on" and will be disconnected from the Pi.

Configuration

  1. You can remove, reinstall, or reconfigure Auto-HotSpot at any time by running the Manage Auto-HotSpot script at Raspberry > Preferences > Manage Auto-HotSpot. Follow the instructions provided by the script.

  2. If 'Check WiFi' is enabled (that is, set to any value other than 'No') in the Manage Auto-HotSpot configuration screen, a cron job will be installed in the user's crontab that will periodically check to see if any configured WiFi networks are in range and if so, it will automatically disable Auto-HotSpot and instead connect as a client to that network. All users connected to your Pi's HotSpot will be disconnected if that happens.

    If you set 'Check WiFi' to 'No', you must reboot the Pi to change the state of the Auto-HotSpot.

  3. Once it's installed, when you run Manage Auto-HotSpot thereafter, you'll be presented with options to remove or reconfigure Auto-HotSpot.

  4. For more details on how the HotSpot operates "under the hood" see the original article on which this is based.

About

Raspberry Pi Auto-HotSpot Scripts and configuration tools


Languages

Language:Shell 100.0%