0

Ok, this may not even be possible but I am working with Pi less than a month. So far, I have a running project.

I was wondering what will happen, if I give my Pi to a friend (or try to make it a product) so that he will just plug it into power. Let's say he has no experience with Pi and Linux.

My question is, how could the Pi connect to its network? Would any of the WiFi adaptors do that? Is it possible to set it up via your phone or it has to be connected via ethernet in order to set it up for the first time?

1
  • Probably better to ask on U&L about this. I think the problem is not that there aren't tool to do this, but that linux is heterogeneous and so there's no one standard way. A quick search turned up this: techrepublic.com/blog/10-things/… It's almost 6 years old but probably most of those things still exist; I'd try nm-applet first (outside of GNOME, but on raspbian it is in the network-manager-gnome package) and just work your way down the list until you find something you like that works.
    – goldilocks
    Commented Apr 28, 2015 at 14:46

1 Answer 1

2

The short answer is: NO, there is no out-of-the-box way to do this.
The long answer is: It depends on how much work you want to put into this. By definition, you cannot know which of the many networks is your friend's WiFi network (he/she could be in a spot where there are multiple networks). So there is no way you can preset your product to work with "any network". On top of that, there are unsecured, secured (WEP) and secured (WPA/WPA2) networks, each requiring a slightly different authentication process. You can easily see how a "one-size-fits-all" wouldn't work.
That said, there are a couple of things you could look into:

  1. You could look into using WPS - this is a way to autoconfigure the setup of the network for networks where the WiFi router support WPS. Just note that there are serious security flaws in WPS, and that WPS is not something everyone will have turned on.
  2. You could use the method employed by Google for their Chromecast (and used by other devices as well): Upon first boot, the wifi dongle in your Pi acts as a wireless Access Point. Anyone wanting to use your product connects to the WiFi network broadcast by your Pi, and uses it to configure the Pi with a network SSID and password (via a webpage the Pi serves up - you would need to build this webpage). Then the Pi configures the WiFi adapter with this info, resets it and turns it back into a "normal" WiFi dongle to connect using the credentials you gave it. EDIT: Use the hostapd package for the Access Point functionality
3
  • Thanks for the info. I was thinking something like 2 - it would be a nice project as well. One question - when using a wifi dongle, the Pi should not be connected via Ethernet, right? User connects to the dongle, sets up the network and then Pi uses these data for its dongle to connect to the WiFi of the home. No Ethernet need at all at any point, isn't it?
    – ghostrider
    Commented Apr 28, 2015 at 14:52
  • Correct. Just have the Pi boot into AP mode on the Wifi. Hostapd is the package I would use as the basis of all this.
    – Phil B.
    Commented Apr 28, 2015 at 15:05
  • 1
    WRT ethernet vs. wifi, beware of something called ifplugd that's used by default on Raspbian. It detects when an ethernet cable is plugged in and may interfere with whatever else you are using to configure the network.
    – goldilocks
    Commented Apr 28, 2015 at 15:37

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.