Posts: 4
Threads: 1
Joined: Jul 2025
Reputation:
0
Hi,
I'm a beginner with openplotter, and I've just installed it on my raspi3. I intend to use it headless to get AIS information, collected thanks to a SDR-RTL, to my phone. As I will not keyboard and screen for the raspi onboard my sailship, my phone will be the only way to access it (by VNC or SSH). Though I want to be sure that the wifi hotspot will always be enable when I reboot, even if, by any kind of mistake I disable it. I tried
Code: sudo nmcli connection modify <hotspot UUID> connection.autoconnect yes connection.autoconnect-priority 100
but It doesn't work. Does someone have any idea ?
Thanks a lot in advance !
Posts: 400
Threads: 11
Joined: Sep 2016
Reputation:
23
What version of OP? How, more importantly why, do you disable it by mistake? Just stop doing it perhaps?
Posts: 4
Threads: 1
Joined: Jul 2025
Reputation:
0
(2025-07-05, 03:27 PM)baltika_no_9 Wrote: What version of OP? How, more importantly why, do you disable it by mistake? Just stop doing it perhaps? Hi, I'm using OpenPlotter V4. I wouldn't disable wifi on purpose, but if it happens, I would be in trouble...
Posts: 400
Threads: 11
Joined: Sep 2016
Reputation:
23
2025-07-06, 02:19 PM
(This post was last modified: 2025-07-06, 04:18 PM by baltika_no_9.)
Hi
I've never known my hotspot fail to start on bootup and am still not sure how you manage to stop it inadvertently. My hotspot is set to use the on-board wif adapter. I have a USB adapter that I use for connection to the Internet etc.
Did you create the hotspot via the NM GUI or CLI?
When you do close it down in error do you have to create it again?
Edit: Can you post the output of the following command?
Posts: 400
Threads: 11
Joined: Sep 2016
Reputation:
23
I've been testing a script which on my system checks for the presence of the hotspot on reboot, if it is inactive it will start it. This could also be run say every 5 minutes to make sure the AP is available but it would be interesting to know the answers to my questions above to see if it might work for you.
Posts: 4
Threads: 1
Joined: Jul 2025
Reputation:
0
(2025-07-07, 02:09 PM)baltika_no_9 Wrote: I've been testing a script which on my system checks for the presence of the hotspot on reboot, if it is inactive it will start it. This could also be run say every 5 minutes to make sure the AP is available but it would be interesting to know the answers to my questions above to see if it might work for you.
Hi, thanks for your support !
When I do
I get
Code: pi@openplotter:~ $ nmcli c
NAME UUID TYPE DEVICE
OpenPlotter-Hotspot 12341495-372f-4ca0-8c3a-cfdb3017f3a7 wifi wlan9
Tel Suc c88764b3-f1a9-42fc-ac2c-4ec213caa059 wifi wlan0
lo a648bddc-f705-44e9-b219-08b4df35c4b7 loopback lo
preconfigured a063e91b-21f3-400f-adb4-e2c89abd1225 wifi --
Wired connection 1 34a444aa-db5f-36e9-9700-2f7b7a03b0ad ethernet --
I created the hotspot via GUI but I tried to change the parameters thanks to nmtui.
Isn't it weird that I don't have anything in my /etc/network/interfaces file ?
Code: # interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source /etc/network/interfaces.d/*
Posts: 400
Threads: 11
Joined: Sep 2016
Reputation:
23
2025-07-07, 05:51 PM
(This post was last modified: 2025-07-07, 06:01 PM by baltika_no_9.)
The interfaces file is a bit of a red herring these days as the Raspberry OS hasn't used it for a long time now I think.
Your set up looks very much like mine. Presumably you can still get to the Pi by SSH into the "Tel Suc" interface when your Hotspot is broken?
Here is what you should see when you power up the Pi, using this command to access the system log:
Code: journalctl | grep Hotspot
Output:
Code: Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0415] policy: auto-activating connection 'OpenPlotter-Hotspot' (12341495-372f-4ca0-8c3a-cfdb3017f3a7)
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0434] device (wlan9): Activation: starting connection 'OpenPlotter-Hotspot' (12341495-372f-4ca0-8c3a-cfdb3017f3a7)
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0483] device (wlan9): Activation: (wifi) access point 'OpenPlotter-Hotspot' has security, but secrets are required.
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0572] device (wlan9): Activation: (wifi) connection 'OpenPlotter-Hotspot' has security, and secrets exist. No new secrets needed.
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0908] device (wlan9): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Started Wi-Fi Hotspot "OpenPlotter"
You can see it autoactivating correctly. It might be worth seeing if in your log there are errors concerned with the hotspot.
I've tested this script to test whether the Hotspot is up, if it isn't it will restart it:
Code: #!/usr/bin/env python3
# Check if a particular network connection is up, if it isn't, enable it
# Get the network name for the adapter you're interested in from the nmcli c command
# CDY 06July25
import subprocess
def is_connection_active(connection_name):
try:
# Run nmcli to get active connections
result = subprocess.run(
['nmcli', '-t', '-f', 'NAME', 'connection', 'show', '--active'],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
active_connections = result.stdout.strip().split('\n')
return connection_name in active_connections
except subprocess.CalledProcessError as e:
print("Failed to check active connections.")
print("Error output:")
print(e.stderr)
return False
def bring_up_connection(connection_name):
try:
# Run the nmcli command
result = subprocess.run(['nmcli', 'conn', 'up', connection_name],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True)
print("Command output:")
print(result.stdout)
except subprocess.CalledProcessError as e:
print("Failed to bring up the connection.")
print("Error output:")
print(e.stderr)
if __name__ == "__main__":
# Provide your connection name here
connection_name = "OpenPlotter-Hotspot"
if is_connection_active(connection_name):
exit(0)
else:
bring_up_connection(connection_name)
Save this as a file with your choice of name but with a .py extension. Mine is in a /home/pi/Scripts/ folder
you can run it at any time with the command:
Code: python <yourFileName>.py
Can you check that it runs OK?
Are you using the onboard wifi adapter for both AP and external access?
Posts: 4
Threads: 1
Joined: Jul 2025
Reputation:
0
(2025-07-07, 05:51 PM)baltika_no_9 Wrote: The interfaces file is a bit of a red herring these days as the Raspberry OS hasn't used it for a long time now I think.
Your set up looks very much like mine. Presumably you can still get to the Pi by SSH into the "Tel Suc" interface when your Hotspot is broken?
Here is what you should see when you power up the Pi, using this command to access the system log:
Code: journalctl | grep Hotspot
Output:
Code: Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0415] policy: auto-activating connection 'OpenPlotter-Hotspot' (12341495-372f-4ca0-8c3a-cfdb3017f3a7)
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0434] device (wlan9): Activation: starting connection 'OpenPlotter-Hotspot' (12341495-372f-4ca0-8c3a-cfdb3017f3a7)
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0483] device (wlan9): Activation: (wifi) access point 'OpenPlotter-Hotspot' has security, but secrets are required.
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0572] device (wlan9): Activation: (wifi) connection 'OpenPlotter-Hotspot' has security, and secrets exist. No new secrets needed.
Jul 07 15:41:17 openplotter NetworkManager[751]: <info> [1751899277.0908] device (wlan9): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Started Wi-Fi Hotspot "OpenPlotter"
You can see it autoactivating correctly. It might be worth seeing if in your log there are errors concerned with the hotspot.
I've tested this script to test whether the Hotspot is up, if it isn't it will restart it:
Code: #!/usr/bin/env python3
# Check if a particular network connection is up, if it isn't, enable it
# Get the network name for the adapter you're interested in from the nmcli c command
# CDY 06July25
import subprocess
def is_connection_active(connection_name):
try:
# Run nmcli to get active connections
result = subprocess.run(
['nmcli', '-t', '-f', 'NAME', 'connection', 'show', '--active'],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
active_connections = result.stdout.strip().split('\n')
return connection_name in active_connections
except subprocess.CalledProcessError as e:
print("Failed to check active connections.")
print("Error output:")
print(e.stderr)
return False
def bring_up_connection(connection_name):
try:
# Run the nmcli command
result = subprocess.run(['nmcli', 'conn', 'up', connection_name],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True)
print("Command output:")
print(result.stdout)
except subprocess.CalledProcessError as e:
print("Failed to bring up the connection.")
print("Error output:")
print(e.stderr)
if __name__ == "__main__":
# Provide your connection name here
connection_name = "OpenPlotter-Hotspot"
if is_connection_active(connection_name):
exit(0)
else:
bring_up_connection(connection_name)
Save this as a file with your choice of name but with a .py extension. Mine is in a /home/pi/Scripts/ folder
you can run it at any time with the command:
Code: python <yourFileName>.py
Can you check that it runs OK?
Are you using the onboard wifi adapter for both AP and external access?
I've the same results when I do
Code: journalctl | grep Hotspot
And your script works, thanks !
I'm using onboard wifi for both access, why ?
Posts: 400
Threads: 11
Joined: Sep 2016
Reputation:
23
I ask because when the duties are shared by the onboard adapter that configuration is not noted for its stability and I am wondering if it may be a factor in your issue. That's why I keep the onboard one for the AP and a USB wifi adapter for external access.
If that script works you could add it into crontab so that it executes at each reboot and at, say, every 5 minutes. In that case if the hotspot fails it will restart. If there is an issue the journalctl command should give an idea about the problem. I know people prefer init.d/rc.d for regular jobs at bootup but frankly crontab has always worked for me.
Good luck
|