Bosse_B
Posts: 967
Joined: Thu Jan 30, 2014 9:53 am

How do I speed up WiFi connect on RPi3?

Wed Jun 29, 2016 9:41 pm

I have an RPi3 box running Raspbian Jessie.
It is dual homed (Ethernet connected and WiFi enabled) and is supposed to be used as an instrumentation controller for remote data acquisition.
It has 4 relays hooked to GPIO ports to control power to the instrumentation and the data connection is by way of WiFi.
So I have set up the system via /etc/wpa_supplicant/wpa_supplicant.conf to have all info on the specific WiFi SSID in the instrument (it is acting like an Access point system).
My problem is this:
When I switch on the power to the instrument via the relays its AP comes on line almost instantly and I can see it via iwlist wlan0 scan.

But the RPi3 WiFi does not connect to the AP until about 6-7 minutes later, which is way too slow!

So is there some way to speed up the connection to a WiFi network when it appears on the air?
Ideally I would like response times in the range 10-15 seconds....

If I connect manually via the desktop icon it will do that much earlier but I need it to be automatic...

Even a cron script running every minute would be better than this slow system, but is there a way to command a connection to be done from a script?
Bo Berglund
Sweden

Bosse_B
Posts: 967
Joined: Thu Jan 30, 2014 9:53 am

Re: How do I speed up WiFi connect on RPi3?

Fri Jul 01, 2016 11:14 pm

Isn't there a command line command (which can be scripted) to tell the RPi3 to connect to the WiFi SSID now?
If I use ifdown wlan0 followed by ifup wlan0 I get a shorter connection delay but I am not sure if this is the right way to do things...
Bo Berglund
Sweden

Bosse_B
Posts: 967
Joined: Thu Jan 30, 2014 9:53 am

Re: How do I speed up WiFi connect on RPi3?

Sat Jul 02, 2016 5:33 am

I have tested as follows:
- sudo ifdown wlan0
- Switch on power to the external WiFi unit with the Access Point hardware
- Wait for it to be stable (30 seconds or so)
- sudo ifup wlan0
Now the connection icon on Jessie shows up blinking for about 12-15 seconds, then becomes stable.

Is this the quickest way to get RPi3 to connect to a WiFi AP?
Bo Berglund
Sweden

User avatar
mikronauts
Posts: 2779
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: How do I speed up WiFi connect on RPi3?

Mon Jul 04, 2016 6:56 pm

Leave it connected & running all the time.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Bosse_B
Posts: 967
Joined: Thu Jan 30, 2014 9:53 am

Re: How do I speed up WiFi connect on RPi3?

Tue Jul 05, 2016 11:49 am

If I could I would...

But there are two problems with this:
1) The WiFi AP is built into a data collection instrument, which is supposed to be switched on do its measurement and then shut down. This is to minimize battery drain. The WiFi AP power cycles with the instrument.

2) I did a test by keeping it running for 24 hours and it turned out that after some 18+ hours the WiFi AP seemed to go bonkers and it was impossible to connect until after a power cycle.
Bo Berglund
Sweden

dukla2000
Posts: 190
Joined: Tue Jan 10, 2012 12:02 am
Location: Reading.UK.EU

Re: How do I speed up WiFi connect on RPi3?

Tue Jul 19, 2016 8:43 pm

Not directly relevant but may help you:
I added
noarp
to /etc/dhcpcd.conf as per an article on ArchWiki. Saves me about 7 seconds on boot, may help you if not using arp.
Daily driver: Pi3B, 64GB Samsung Evo+ @100MHz, DVB-T, onboard WiFi for internet, BT/USB dongle for KB/mouse, 250GB HDD via USB for media, Raspbian Jessie Lite with Openbox desktop.
Museum: Pi B

Return to “Troubleshooting”