AutoAP disconnects after a few seconds / Captive Portal

Help setting up WiFi
Post Reply
Posts: 43
Joined: Wed Apr 18, 2018 12:53 am

AutoAP disconnects after a few seconds / Captive Portal

Post by N6MIK »

Hi - not sure if this is a 'wifi' issue or lies elsewhere... but I'll start here.

Most recent updates of Pi-Star running on a Pi-0, previously running flawlessly on my home network with an uptime of several weeks.

I wanted to move it to my truck, which has a hotspot built in. After driving out of range of my home network, I plugged in the pi and waited for the AutoAP to broadcast. Using my iphone, it connects fine, pops up a "Captive Portal" window showing the pi-star dashboard and within 10 seconds or so, the wifi connection disconnects... not enough time for the dashboard to move to the config screen, let alone add the new wifi network for the truck.

What am I missing? I haven't used AutoAP in a while, but previously never had an issue using my phone to set up net networks in this manner. Thanks!
Pi-Star Team
Posts: 1926
Joined: Wed Apr 17, 2019 11:11 pm

Re: AutoAP disconnects after a few seconds / Captive Portal

Post by KE7FNS »

N6MIK wrote: Wed Jul 21, 2021 7:12 pm What am I missing?
I don't know, but using the AutoAP isn't really the proper way to do what you are wanting to do.

What you want to do is create a wpasupplicant.conf file with both of your network information in it, and then it will scan in the order of their priority and connect to one if it responds (within range).

What I would do is create a network for your truck hotspot SSID and make it priority 100, and then create a home network and make it priority 99.
That way if it detects the hotspot on in your truck is on it will connect to it, if not it will connect to the home.

Note: You cannot just move out of the range of a working network and it automatically reconnect to another network, it requires a reboot.

How you setup two networks is you go to the wifi builder and create a two networks. hotspot and home.

download and open the 2nd wpasupplicant.conf file in a text editor and copy the information in the entire network={ } section to the clipboard. Then open the 1st wpasupplicant.conf file and paste it at the end of the file (AFTER the } in the first network section of the other) so this file now has two network= sections.

Set the priorities to 100 and 99 and id_str to 0 and 1.

Save the file.

Then copy the file and make sure it is named wpasupplicant.conf to the SD card and place it in the /boot directory. It should be the only partition you can see using a Windows OS. There should be other files like cmdline.txt and config.txt.

Then place the SD card into the RPi and boot it and you are done. When your hotspot in the truck is on and you power up the RPi it will connect to the hotspot in the truck (assuming you entered the proper information correctly, and it is setup as WPA2). When the hotspot in the truck is off it will connect to your home network. I hope your truck has the ability to automatically turn it off when the truck is off, otherwise I don't know how you are going to do what you want to do.
If someones previous actions are any indication of their future actions, then I predict the deletion and removal of access will happen at any moment. 7-11-2020.

"07/13/20 This Website Has Been Taken Down" ... again :lol:
Post Reply