How to launch hotspot at boot?

I’ve recently moved house temporarily, and the broadband connection here is abysmally slow. However, due to a ridiculous stroke of luck, this is also the only place in this country with decent 5G coverage. This means that until I can get

working again (it has 4G support) I need to hotspot from my smartphone to my desktop. However, unlike my desktop, which can broadcast a hotspot across a great distance using its antennae, my smartphone cannot, which means that I’d like to use my smartphone like the network gateway, and each device like an AP.

I can do this on Android

and Windows

https://answers.microsoft.com/en-us/windows/forum/all/automatically-turn-on-mobile-hotspot-when-the-pc/036f6f77-bcf0-465a-91f5-2ea51d8983b6

but not on KDE Plasma in any obvious manner, because I suppose I could configure a systemd service to invoke whatever code creates a hotspot

but that’s rather out of my league, since unlike Windows, there aren’t high-level .NET (or Win32 API equivalent) commands available.

To this end, I’d like to be able to configure all of my devices to broadcast their own network signal on boot automatically, rather than have me need to configure this at every boot.

Is this possible? If not, could I request that it be?

I have a solution, I think.

You can script the startup of the hotspot, using the cli tool nmcli
For instance following:

Then once you have a command line that starts your hotspot, you can add it to the programs launched at startup in “Automatic Startup” add a connection script.

Hope this helps.

2 Likes

Automatic startup? I thought Linux distributions requires an init service for anything that wants to start at boot…? (https://bugzilla.mozilla.org/show_bug.cgi?id=1851337#c3 :0)

See

I’m a fool.

Automatic startup? I thought Linux distributions requires an init service for anything that wants to start at boot…?

At boot, yes, but for the user session, users can do what they want as long as they have control over it :wink:

It is specified in xdg Desktop Application Autostart Specification which means it works in GNOME and other DE the same way.

1 Like

If you’re into scripting the hotspot start, then this python example script from NetworkManager’s examples, might also be helpful:

It is using the high level DBus API for the NetworkManager service, so once you know what it’s doing, you can implement this in any other language, including shell or .net Core

1 Like