How to start a Hotspot Via Terminal Ubuntu 18.04 - Useful to expand your ESPHome Node Network!

Like many, I’ve had a few issues with a Wemos D1 node going offline.
Even though the offending node was relatively close to the Wifi router (10m away) it kept dropping out. Even with a static ip in router and node settings.

Annnnnyyywaayyy… The Ubuntu NUC (I use for HA) is actually about 2 meters from the Wemos D1 that keeps dropping out.

System wise. The NUC receives its network connection thru LAN physical connection from the main incoming router. Which left the NUC Wifi device unused.

So what I’ve done is generate a WIFI Hotspot thru Terminal/command Line on Ubuntu 18.04 and put the job in crontab.

Heres the command line to generate custom hotspot WIFI:

nmcli dev wifi hotspot ifname wlp2s0 ssid HOTSPOT password “YOURPASSWORDHERE”

Worth checking the code works in terminal before adding to crontab!
If your custom settings fail, try generating a hotspot manually thru Ubuntu wifi settings (on the GUI desktop interface, top right hand corner under power button), write down the SSID and password Ubuntu generates. then use THOSE credentials in your terminal command line.

Then edit crontab in terminal:

crontab -e

Add:

@reboot sleep 30 nmcli dev wifi hotspot ifname wlp2s0 ssid HOTSPOT password “YOURPASSWORDHERE”

And then save the file.

After reboot the wifi hotspot automatically starts.

I’ve added the network settings to the ESPHOME Wemos D1 node and its connecting every time after a reboot.

How many clients are connected to your wifi router and what sort is it?

Never mind. Saw your other post. We’ve been through this before.