Report comment

Hi Luigi. I presume you are using a PI with built in wifi? if you are using a PI with a wifi dongle then it is likely that wifi dongle is not usable as a access point, check if it has a AP mode.

To trouble shoot the built in wifi; when the hotspot is active the wifi icon will be two red crosses and will show the message "Wlan0: STOPPED" this is because dhcpcd has been disabled on wlan0. dnsmasq will be managing the network for wlan0 at this point. ETH0 will still be managed by dhcpcd though.
Check that dnsmasq is running ok with sudo systemctl status dnsmasq
that should say it is running. If not then there should be an error in the message. Check the dnsmasq config is ok.

Also see if the ip of 192.168.50.5 has been generated on wlan0 with the command ip addr

When your router is active again the PI will only connect if you are using the cron timer or you manually enter sudo /usr/bin/autohotspotN
otherwise it won't pick up your router until you reboot.

When the PI goes back to network mode, dnsmasq is disabled and dhcpcd will be back in control of wlan0.

Let me know how you get on and what happens and I iwll look into it further