szac
Posts: 10
Joined: Thu Oct 25, 2012 1:24 pm

How do I configure wifi settings via browser?

Thu Oct 25, 2012 1:35 pm

I'd like to have my headless raspberry pi to create its own wireless network that I can connect to in a web browser for configuration.

Sort of like what what Twine and other wifi connected sensors and routers do.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: How do I configure wifi settings via browser?

Thu Oct 25, 2012 1:50 pm

There are several threads showing how to turn an RPi into a WiFi hotspot. See for example http://www.raspberrypi.org/phpBB3/viewt ... 36&t=14100

There are also threads about web portals for configuring a RPi.

It is not clear exactly what you want to configure. It is a chicken-and-egg situation trying to configure network settings using a browser because the RPi needs a network connection for you to connect to it from the browser.

szac
Posts: 10
Joined: Thu Oct 25, 2012 1:24 pm

Re: How do I configure wifi settings via browser?

Thu Oct 25, 2012 2:02 pm

I'm building a portable wifi radio so I need a way to connect a headless raspi to an internet connected wifi network without access to ssh. Other headless computers/sensors/routers have solved this by serving up a temporary web page (from the device) for which to configure the wifi settings.

I've found the wifi hotspot threads and ad-hoc threads, but I'm having trouble locating any info about a web interface.

Thanks!

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: How do I configure wifi settings via browser?

Thu Oct 25, 2012 2:14 pm

Here is an example thread which you may find useful
http://www.raspberrypi.org/phpBB3/viewt ... 36&t=12335

szac
Posts: 10
Joined: Thu Oct 25, 2012 1:24 pm

Re: How do I configure wifi settings via browser?

Thu Oct 25, 2012 2:18 pm

Excellent! That project has eluded me in my searches. Thanks!

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: How do I configure wifi settings via browser?

Thu Oct 25, 2012 2:24 pm

I think I understand what you want to do, but it would be nice to check if you have the same thoughts...

When power is turned on
1. Try to connect to the last defined network
2. If this is not possible within a defined time (for example 60 seconds)
3. Scan all available WiFi SSIDs and store them for later use
4. Reconfigure the RPi as a hotspot access point
5. Launch a web server
6. Wait for somebody to connect and use a web browser to configure new network settings.
7. Reconfigure the RPi as a WiFi device
8. Try to connect to the network, if this fails return to step 2.

This is all very possible and should be technically easy, others have done all the hard work for you.

Note that in step 6, the user will expect to see a list of the available networks but the RPi will not be able to scan because it is configured as an Access Point. This is why the list of networks should be built in step 3 before the RPi becomes an Access Point.

If you do get this working, it would be a fantastic project. A lot of people would be interested in using this.

szac
Posts: 10
Joined: Thu Oct 25, 2012 1:24 pm

Re: How do I configure wifi settings via browser?

Thu Oct 25, 2012 2:38 pm

Yep. That's the exact scenario. Good call on #6. I was imagining having a physical button that when pressed will put the raspi in to 'server mode' so that step could do the scan first, then create network as you suggest.

I'll report any findings back here.

kumar303
Posts: 4
Joined: Sun Jan 20, 2013 10:49 pm

Re: How do I configure wifi settings via browser?

Sun Jan 20, 2013 10:52 pm

Did you ever get this working? I was looking for something exactly like this so a Raspberry PI box could be shipped to a customer. The customer could power on the box and configure wifi through a browser.

abers
Posts: 1
Joined: Thu Sep 12, 2013 1:44 am

Re: How do I configure wifi settings via browser?

Thu Sep 12, 2013 1:46 am

Has anyone found a solution for this yet?

danpillay
Posts: 1
Joined: Thu Mar 19, 2015 9:58 pm

Re: How do I configure wifi settings via browser?

Thu Mar 19, 2015 10:05 pm

Hey did you ever manage to get any findings on this project?

emma24xia
Posts: 28
Joined: Thu Dec 04, 2014 9:51 am

Re: How do I configure wifi settings via browser?

Fri Mar 20, 2015 2:39 am

This is such a great post, I now can set up wifi with Pi.

TobiasN82
Posts: 1
Joined: Tue May 05, 2015 7:16 pm

Re: How do I configure wifi settings via browser?

Tue May 05, 2015 7:20 pm

Hello all,

did anyone got a solution for that:

When power is turned on
1. Try to connect to the last defined network
2. If this is not possible within a defined time (for example 60 seconds)
3. Scan all available WiFi SSIDs and store them for later use
4. Reconfigure the RPi as a hotspot access point
5. Launch a web server
6. Wait for somebody to connect and use a web browser to configure new network settings.
7. Reconfigure the RPi as a WiFi device
8. Try to connect to the network, if this fails return to step 2.

I want to get exactly the same for my raspberry.

Maybe you could give me a short tutorial to set this up?

Thanks
Tobias

ghamm
Posts: 13
Joined: Mon Apr 20, 2015 6:05 pm

Re: How do I configure wifi settings via browser?

Sat Sep 26, 2015 5:27 am

Hi,
Heres what I am doing..
I turn on Root access to my pi. I turn on SSH abilities.
I plug my pi in to my ethernet/router

On my windows machine, I wrote an app that ..

First, scans my network and looks for the RPI IP address. Once it finds the IP, it keeps track of it..
Second, the user enters their SSID, password, Protocol etc.. of the WIFI network
Three, my windows app Builds a new wpa_supplicant.conf file..
Lastly, it logs into the pi using SFTP .. Copies the new file to the RP..

Reboot the pi, and there ya go. So far so good.
This makes a simple graphical setup that anyone can use. (If they have a windows machine.) (Mac next)

szac
Posts: 10
Joined: Thu Oct 25, 2012 1:24 pm

Re: How do I configure wifi settings via browser?

Sat Jan 02, 2016 3:14 pm

Just came across a promising solution. Haven't tried it yet https://www.reddit.com/r/raspberry_pi/c ... i_to_turn/

Nefalas
Posts: 1
Joined: Mon Oct 30, 2017 1:59 pm

Re: How do I configure wifi settings via browser?

Mon Oct 30, 2017 2:01 pm

If anyone is still looking for this, check out https://github.com/jasbur/RaspiWiFi

Return to “General discussion”