RaspberryConnect Logo

Models of Raspberry Pi

WhatisaRPI sml

What is a Raspberry Pi and what are the different models?

Raspberry Pi OS Software Packages

RaspbianSoftwarePackages

Raspberry Pi OS is the official operating system for the Raspberry Pi (previously known as Raspbian). There are 1000's of Free programs available for download.

Projects

Projects

Various Projects and Guides from the Raspberry Pi Community.

 

Activate an easy Automated WiFi AccessPoint or connect to a local WiFi Network for Raspberry Pi OS Bookworm. The AP is automatically created when you are not in range of a known WiFi network. Useful for both headerless or desktop setups. 

With the Raspberry Pi being so portable it is always useful to have a wifi connection. When the wifi signal has been lost due to a weak signal, it can be a bit of a nightmare trying to get access to the Pi without a screen.

The script in this Article will monitor the wifi connection and make sure you are connected to a known Wifi network when the signal is good or it will create a WiFi access point, so you will always have a wifi connection available.  It will also allow you to flip to an Access Point with a simple command and back to a WiFi network on demand.


The Access Point will allow a direct Wifi connection to the Pi from a Phone, Tablet, Laptop for use with ssh, VNC desktop sharing, a local web server, etc.

Every 2 minutes the AccessPopup script will check the local wifi network signals. If a known one comes back into range, then a connection is made to the wifi network and the Access Point is stopped.

This is useful for Devices that may be running sensors, cameras or other monitoring software in your Garden, Greenhouse, Shed or Garage that may be where the WiFi signal is weak. You will always be able to get a connection over wifi and is ideal for headerless setups. 

This is also useful for any setups where the Pi is required to go in and out of wifi range. 

Compatibility:

Requires any Raspberry Pi computer. Tested with PiOS 12 Bookworm and Ubuntu 23.10 Raspberry Pi Image.
This will NOT work on PiOS 11 Bullseye or 10 Buster or older as they do not use Network Manager as they use DHCPCD instead.

A similar script is available for these called AutoHotspot.
This is available at raspberry-pi-automatic-hotspot-and-static-hotspot-installer

Installation and Use:

Latest versions:
accesspopup 0.8-3 28th Jan 2024
installconfig.sh 0.8-4 28th Jan 2024

Installation:
download the archive file with curl "https://www.raspberryconnect.com/images/scripts/AccessPopup.tar.gz" -o AccessPopup.tar.gzunarchive with tar -xvf ./AccessPopup.tar.gz change to the AccessPopup folder cd AccessPopup Run the Installer script
sudo ./installconfig.sh

The menu options below will be presented. Use option 1 to install the AccessPopup scripts.
This will automatically start monitoring the wifi connection every 2 minutes. It will also check the wifi at startup and then at every 2 minute intervals.

Setting a Constant Access Point:

Sometimes it is useful to be able to use the AccessPoint even though the Pi is in range of a known WiFi network.
This can be done by opening a terminal window and entering the command:
sudo accesspopup -a

to go back to normal use, just run the script without the -a argument.
sudo accesspopup

alternately use option 4 "Live Switch..." on this installer script.

Menu Options:

1 = Install AccessPopup Script
Installs the AccessPopup script and starts the 2 minute checks

2 = Change the Access Points SSID or Password
The access points wifi name (ssid) is AccessPopup and the password is 1234567890.
Use this option to change either or both. At least change the terrible password.

3 = Change the Access Points IP Address
The Access Points IP address is 192.168.50.5. Use this option to choose a new IP address, based on 10.0.#.# or 192.168.#.#

4 = Live Switch between: Network WiFi <> Access Point
Switch on demand. Set the Pi to an Access Point until the next reboot or switch back to a known WiFi Network in range.

5 = Setup a New WiFi Network or change the password to an existing Wifi Network
Scan for local WiFi networks and connect to a new one or change the password to an existing profile.

6 = Change Hostname
Change the system Hostname, so a connection can be made by name instead of an IP address.

7 = Uninstall AccessPopup
Uninstall the AccessPopup script and return the RPi to its default wifi setup.

8 = Run AccessPopup now. It will decide between a suitable WiFi network or AP

9 = Exit

 

Using the Access Point:

When the Access Point has been activated, the SSID AccessPopup will be broadcast. Using a wifi device, scan for new wifi devices in the area, and select AccessPopup.

You will be prompted to enter the password.

If you have not already changed it, the password will be 1234567890. Don't use the password that is used to log into the Raspberry Pi.

The connection to the Access Point will be made.

SSH, VNC, Web Server

Now that a connection to the Access Point has been made, If you are using SSH, VNC or accessing a web server of the RPi then use:

ssh: This email address is being protected from spambots. You need JavaScript enabled to view it..5   so if your user is called  pi, then use ssh This email address is being protected from spambots. You need JavaScript enabled to view it..5

VNC remote desktop: enter the server as 192.168.50.5 

Web server: if there is a web server running on the PI, it can be used by entering http://192.168.50.5/ into a web browser.

The Hostname of the device can also be used in place of the IP address for any of the above options.

 

Using AccessPopup in a terminal window: 

 AccessPopup is set to run automatically every 2 minutes but it can be run manually to switch to the Access Point.

In a terminal window enter: sudo accesspopup -a

The access point will be activated and the timer will be stopped so it doesn't try to connect to a Wifi network again.

To re-connect to a nearby known wifi network, either reboot or run the script without -a

sudo accesspopup

This will attempt to connect to a known local wifi network and re-activate the 2 minute timer.

If a wifi network connection can't be made, it will activate the Access Point again and continue to monitor the connections.

 

Using Network Manager from The Desktop:

Alternately to using the AccesPopup script, the Network Manager interface can be used to make your own Access Point. This will be used if no know wifi network is found when the Pi is started. If a known Wifi Network is then in range, Network Manager will keep the Access Point going until it is manually stopped in the WiFi menu or the Pi rebooted. If this suits your needs and you are always using the desktop environment then the standard setup may be useful. 

To create an Access Point in Network Manager use the "Create Wireles Hotspot" menu option

RPi NetworkManager CreateHotspot
RPi NetworkManager Hotspot Details

As standard Network Manager will use a previously setup Access Point if no known Wifi network is in range. Then when a known Wifi network comes into range you will need to manually stop the Access Point and select the desired Network. 

So the AccessPopup script is not required if you are only using a Desktop environment.

AccessPopup is most useful for setups without a desktop (headerless) or where the wifi signal is inconsistent as the wifi connection will be remade every time it is strong again. 
If you are using the AccessPopup script and Network Manager desktop menu, then AccessPopup will switch from any Access Point back to a known Wifi network every 2 minutes unless the following command is used in a terminal screen window.
sudo accesspopup -a

This will also stop the timer and the script from running.

Using the "Advanced Options" and "Edit Connections" the AccessPoint settings for the profile AccessPopup can be changed, by selcting the profile and then the cog icon.

RPI NetworkManager EditConnectionRPi NetworkManager edit profile

The AccessPopup profile will be removed from the Network Manager menu if option "7 Uninstall" of this script is used. Unless the profile name has been changed.

On re-installing AccessPopup the default options will be setup. Any other AccessPoint that has been setup, will be ignored in favour of the AccessPopup one.

If you find this guide useful and wish to show your appreciation then you are welcome to make a donation or share a link to this article. There is no obligation to do so, this guide is free for use and support is available to everybody as long as I know the answer :)

I am the single developer of this script and website. Any support towards the costs are welcome.

RaspberryConnect.com

 

  

Considerations:

The Access Point disconnects every 2 minutes.

If a WiFi network is setup but the password is not correct, then the connection will fail. Once there is an attempt to connect to a WiFi network, it is added to the list of known networks by Network Manager.
When an Access Point is active, every 2 minutes it will be deactivated to connect to the bad WiFi network when it is in range. This will disrupt any connections to the Access Point.
The Access Point will be re-enabled once the connection to the Wifi network has failed.
If you experience this, then correct the password with option 5 or the Desktop interface. Otherwise delete the bad Wifi network entry.

Ethernet connection to the Pi

If an Ethernet cable is connected to the Pi and the Access Point is available, any device on the Access Point can ssh/vnc/ping etc the other devices also connected to the access point and the network the Ethernet is connected to. This includes the internet, if it is available.
No device on the Ethernet's network can connect ssh/vnc/ping etc to the devices connected to the access point. The Ethernet network can access the Pi, as it is on both networks.

 Using a Second WiFi Device

 When a second Wifi device is setup such as a USB Wifi dongle, no device connected to the access point can ssh/vnc/ping etc the network that the second Wifi device is connected to. Devices connected to the Access Point can only access the internet or other networks through a connected Ethernet cable.
To do this through a second wifi device requires additional configuration.

 Loss of Connection when a Switch Happens

 Any connection to the Rpi from another device will be lost when the RPi switches from a Wifi Network connection to an Access Point and back. 

If you are using ssh then programs such as tmux will keep your session running while you connect back to your RPi on the new wifi connection. 

VNC will reconnect if you are using a Hostname as the server connection. If you have connected with an IP address then you will need the new IP adress from the network you have connected through. 

 

Add comment

Comments  
Adjust Wifi AP Transmission Power using Network Manager
Hey therer, I have an adjacent question on how to reduce the transmission power of the Wifi AP/hotspot using the Network Manager. Basically I want to reduce the radius of my hotspot, so you can only connect to the Pi when you are very close by. Within the NM GUI, you can edit the settings for the wireless hotspot and I see that it includes Transmission Power as an editable setting but it is set to 0mW by default. Changing and saving to a new mV value also doesn't actually update the setting either (ie. when you reopen the settings for the hotspot its back at 0mW). Maybe its just a place holder and yet to be implemented? Is there another way to do this?
Adjust Wifi AP Trans
Hi I have had a look at the NM Gui on my Pi and I can't see an option for transmission power and I can't see anything in the docs to change that setting. The only other place I know of a power setting is with IW dev set txpower [] phy set txpower [] to see your current setting use sudo iw dev Then to make the change there is a fixed option, but you have to bring the interface down to make the change. sudo ip link set wlan0 down sudo iw dev wlan0 set txpower fixed 15000 sudo ip link set wlan0 up Not sure if this helps as it will limit the wifi all the time. Other than putting a physical barrier round the Pi to reduce the signal I don't know what else to suggest.
Unable to connect to network
Hey,

this script is perfect for me, but it doesn't reconnect to my wifi at home. The accesspoint at the works perfectly, but when i want to switch back with (4), or (8) to my home wifi it always shows me the message:

Checking: *ssid name*
unable to confirm connection status
a network connection has not been made with any known ssid. activating acceess point

But, if i go back to nmtui and reconnect to my home wifi, it works. I have tried several ways to create the connection, with nmtui, with the script, but i won't reconnect.

Need help, thanks!
Pascal
Unable to connect to network
Hi Pascal

That's a bit odd, I will have a look into what is causing that. It will be detecting the SSID from your home network. After it activates the connection it waits for a response from NM. If it doesn't get the a valid response you get the message you see.
Could you activate your connection with the command 'nmcli con up Your-Network-Profile-Name'
and send me the feedback text please. Just to check it's not anything I haven't seen yet.

Does your NM profile name have any special characters or spaces in the name?
Unable to connect to network
Hi,
thanks for the reply. With sudo, the connection works. Output ist German, connection established, no errors occured.
Verbindung wurde erfolgreich aktiviert (aktiver D-Bus-Pfad: /org/freedesktop/NetworkManager/ActiveConnection/3)

My ssid is RaumschiffEnterprise, no spaces, nothing special there. It seems the Accesspopupscript doens't wait until NM has answered. It shows the message "unable to confirm" pretty quickly.

Another odd thing is, at the network list i always get all entries twice. Maybe it is confused about the doubled entries.

Add or Edit a Wifi Network
Add a new WiFi network or change the password for an existing one that is in range
1 FRITZ!Box 7530 AL
2 RaumschiffEnterprise Gastzugang
3 RaumschiffEnterprise
4 RaumschiffEnterprise
5 RaumschiffEnterprise Gastzugang
6 FRITZ!Box 7530 AL
7 FRITZ!Box 7530 AL
8 To Cancel

2 until 5 are mine, i have also 5GHz Wifi, but Rpi Zero W can only connect to 2.4GHz, so this is not the reason.
Unable to connect to network
Hi Pascal

Thank you for the information.
I think I have found the issue and tested it using a WiFi repeater and your SSID's.
I have updated the script and done some other updates as well
If you download the latest version. Then use option 7 to uninstall the old script and then option 1 to install the new script.
it should start using the changes.

The repeating SSIDs is because it picks up each antenna on the router. If you run the command

sudo iw dev wlan0 scan ap-force | grep -E "^BSS|SSID:"

you will see each Mac ID (BSS) is different for each entry.
It doesn't matter which one is selected though as the right one will be used when the connection is made.

Please let me know if this solves the problem, if not I will look into it further.
Thank you & Question
Hi Wolfgang,
Thanks for the feedback and how you have use the script. That is always interesting to know.
For the issue; the AP should be getting generated. It is on a 2 minute timer so it will check if a known SSID is in range and try to connect to it. As your Network is in range the AP will be stopped, the connection to your router will fail due to the wrong password and the the AP will be setup again. about 1 min 30 seconds later it will do it all over again.
To check if the script will switch when your router ssid is not available you need to change the SSID rather than the password.
nmcli con mod "Profilename" ssid "newssid"

Then the script won't find any known ssids and create the AP.

If you just want an AP while at home you can use
sudo accesspopup -a
as well, and
sudo accesspopup
to go back to normal use.

I hope that helps, let me know if you have any issues
Happy New Year
Forgot to add my question
So, here is a little test I made: I entered
sudo nmcli radio wifi on
sudo nmcli dev wifi connect password ""
with a fake password for my network, which subsequently interrupted the valid wifi connection.

In this case, it should default to the access point, right? Because it doesn't. The wifi network is not shown on my Mac or iPhone.
Am I missing something?
Thank you & Question
Great update, thanks much! I find the menu also clearer than the previous version. I am working to include this in a picture frame application. When you give family members a homebrewed picture frame (www.thedigitalpictureframe.com), the first problem is always the Wifi. Your app would make it easy to access the frame.
Install Bug: RPI 4, Bookworm
Error on the installconfig.sh

./installconfig.sh: line 563: -3: substring expression < 0
Install Bug: RPI 4, Bookworm
Thank you for that.

It is trying to display the ip address, so just info and not an issue to the function.
I will fix that.

Keep connected at home and on the move with the Automatic Access Point scripts

Guides for setting up your Raspberry Pi to your home network when your at home or generate a Automated Access Point when you are out. For all models of the Raspberry Pi

AccessPopup Installer Script

AccessPopup Automated Access Point

Automated Access Point or Wifi Network connection for PiOS 12 Bookworm. AccessPopup installation and setup. 

Auto Hotspot Script Easy Installer

AutoHotspot Net Sml

Setup a Auto Hotspot or Static Hotspot with the easy installer.
For PiOS Buster & Bullseye.