m.alessandrini
Posts: 8
Joined: Fri Apr 18, 2014 8:50 pm

Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 10:37 am

Hi, with the Raspberry 0 W you can setup a headless system by turning the board to an access point and connecting to it from other clients. This is more convenient than connecting the board to an existing wifi network, for example if you don't have such a network in all the places you use it.
Now you could do that by simply editing configuration files on the sd from another computer, the only problem is that you have to install hostapd, and that forces you to connect the first time to the Zero with a monitor and keyboard, or use a Raspberry 3 to boot into the system via ethernet.
[Reference: https://www.raspberrypi.org/documentati ... s-point.md]
Thanks
Michele Alessandrini

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 10:49 am

Good idea. I'll see what we can do.

m.alessandrini
Posts: 8
Joined: Fri Apr 18, 2014 8:50 pm

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 10:54 am

Thanks!
Sorry my post was incomplete, it needs "hostapd" and "dnsmasq", I had the latter already installed somehow but it's not there in the fresh image. BTW I'm referring to Raspbian Stretch Lite.

epoch1970
Posts: 5131
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 11:03 am

I see the point, but IMHO this also pulls dnsmasq into the picture...

If you can live with link-local addresses, may be there is a simple workaround: wpa_supplicant has an AP mode. I don't know if the version of wpa_supplicant that ships w/ Raspbian has support for it, documentation is scarce and overall hostapd is a better AP.
But you might want to experiment with "mode=2"
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

m.alessandrini
Posts: 8
Joined: Fri Apr 18, 2014 8:50 pm

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 11:22 am

Didn't know that about wpa_supplicant, I have to try, thanks.

hippy
Posts: 7730
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 12:18 pm

If the Zero W is to be configured as a host out of the box then please make sure that how to disable that to use it as a client is well documented.

As an aside; how will it be determined what region the Zero is operating in before it enables its Wi-Fi ? AIUI one cannot currently connect as a client without specifying a country code so seems rather anomalous to allow it to configure itself as a host without the same.

If the proposal is just to have hostapd etc pre-installed in the image to make host configuration easier, then no problem.

User avatar
procount
Posts: 2211
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 12:29 pm

@hippy - I don't think the suggestion was to have it configured as a hotspot out of the box, but rather that all the components were already installed in the image such that it was easy to setup by "simply editing configuration files on the sd from another computer", in the same way that you can just drop a wpa_supplicant.conf file on the image to get it to connect as a client to another wifi router.
(EDIT: Hmm. did you just edit your post? :) )
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

m.alessandrini
Posts: 8
Joined: Fri Apr 18, 2014 8:50 pm

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 2:09 pm

Indeed, simply installing hostapd does not enable it, you need a configuration file and you have to enable it in /etc/default/hostapd.

hippy
Posts: 7730
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Suggestion: make "hostapd" preinstalled

Thu Feb 07, 2019 2:57 pm

procount wrote:
Thu Feb 07, 2019 12:29 pm
(EDIT: Hmm. did you just edit your post? :) )
I did; I realised that I wasn't exactly sure which was being proposed. I also changed "AP" to "host" because AP wasn't correct terminology.

I can support the argument for Pi's with Wi-Fi actually becoming a host at first power-up if there's no immediate user interaction, much like Chromecasts and mini-routers and repeaters so you can connect via phone or tablet and set client details completely headless or with just a monitor/TV.

That really needs to be done via a browser so anyone with a phone, Wi-Fi enabled Pi or laptop can set it up. I had a nightmare finding a suitable phone or tablet which could run the Google App required with my Chomecast. A brilliant idea poorly executed.

Return to “Raspberry Pi OS”