0

My Raspberry pi is connected with known WiFi network right now for my application, but if any other person is to use their own wifi network then how do I setup wifi for Pi?

So I need to implement wifi setup as below.

What I need to implement next is for new WiFi connection is

  1. First my pi is work as a wireless access point without internet on boot time
  2. Then it will automatically popup/open http page to get SSID and PW from user
  3. Then it will connect with known wifi network as SSID and PW provided by user.

As I see in so many tutorials they only give access point setup with Ethernet connection and as I am new to the RPI ,can anyone help on that?

Thanks in advance!!!

3
  • Where does automatically popup/open the http page? On the RasPis monitor?
    – Ingo
    Dec 1, 2020 at 19:00
  • automatically pop up/open http page on mobile or laptop.
    – user127349
    Dec 2, 2020 at 11:24
  • What mobile or laptop you are talking about? There is a Raspberry Pi connected to a network by WiFi. Do you want to change this connection on the RasPi?
    – Ingo
    Dec 2, 2020 at 11:32

1 Answer 1

1

Forgive the edits to your question but it helps my reply.

The simplest way of doing this is to use https://github.com/balena-io/wifi-connect as they have done it for you BUT that's not really an answer (and they may one day pull it) so, in the forum spirit of providing a solution on-going, this is a VERY crude way to do it:

Built into Python is a simple web server capability that you can use to develop a simple program. Its not the equivalent of Apache etc BUT for this task it can do the job for you.

  1. Ship the Pi as a known access point using its own DHCP server (dnsmasq is the normal one on Pi APs) (point 1 on your list)
  2. Ship the Pi with Python set to start up after reboot and to serve your web page (a small shell script will do this) (point 2)
  3. Instruct the user to connect to the pi and serve your data entry screen up (point 2)
  4. Collect the details from the user (point 2)
  5. Use Python / scripts to undo the Pi access point details and join the network (point 3)

Now the issues you have to cope with are:

  • What happens if the user incorrectly enters the WiFi details? How do they get back to your data capture?
  • What happens if the user needs to change the WiFi details as their ISP has shipped a new router / access point?
  • What happens if you need to update the code on the Pi?
  • What happens if this is used in a different country (different frequency spectrum) - this may not be an issue depending on your market.

Note: There is a system for getting users to log-on to a WiFi network (you may have used it in cafes / stations etc to access their WiFi often at the cost of your privacy) called an 'Active Portal'. These have strict standards as to the way they work (see RFC 7710 for a starting point) and still do not address the change over issues.

1
  • Thank you Andyroo for that question edit !!:)and thank you for reply it seems it will work for me ,let me try and then i will update here !
    – user127349
    Dec 2, 2020 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.