logoalt Hacker News

mschuster91yesterday at 5:57 PM5 repliesview on HN

What about manual pre-provisioning? I just found out a few days ago that you can't pre-provision wifi via placing wpa_supplicant.conf in /boot any more, you now need to use that GUI provisioner.

I appreciate that RPi is trying to make the ecosystem more accessible for newcomers - but not at the cost of power users, please!


Replies

pmyesterday at 6:44 PM

I don't think wpa_supplicant.conf has been used for sometime, as they moved to cloud-init for bootstrapping. It requires the network-config file instead, the format of which is documented on the cloud-init documentation page.

I happen to have been experimenting with this for the past few weeks, and the most persistent issue was getting wi-fi to work correctly. It's quite a common issue, with any number of hacks. I offer my own network-config below, though I've only tested it with provisioning Ubuntu Server on the RPis so far (I have two 3B+s).

  network:
    version: 2
    renderer: networkd
    wifis:
      wlan0:
        regulatory-domain: "AU"
        dhcp4: true
        dhcp6: false
        optional: false
        access-points:
          "<access-point-name>":
            password: "<password>"
The important parts are:

1. The renderer, as the default is NetworkManager, which doesn't work correctly with RPis (at least on Ubuntu Server). It may work with RPiOS, but I haven't tested it yet.

2. The regulatory domain, the lack of which is what disables wi-fi in the first place. I forget how much testing I did with the format, but I believe it must be uppercase (I don't remember about quoting the string, however).

3. Disabling IPv6 may be relevant, though unlikely. It was just in a working configurations I found; I just haven't had time to confirm it. The relevant line in my user-data file is as follows:

  bootcmd:
  - sysctl net.ipv6.conf.all.disable_ipv6=1
The rest of the configuration is standard, though I purposefully made the wi-fi non-optional so I could confirm that wi-fi worked (my only Internet at the moment is through my iPhone hotspot, which was another source of issues, but that's a whole other story).

NB. According to someone else, the imager has the respective command line options for user-data and network-config, which I didn't know.

gioboxyesterday at 6:07 PM

I had to go and read the docs to confirm this was true, I'm really surprised this has been removed (since Raspian Bookworm apparently). It was a ridiculously common way to configure wifi on RPis over the last decade!

It's the little paper cuts like this that really hurt on a platform who's original aims were to target the education market, there is still a mountain of tutorials online advising to drop in that file for wifi setup.

show 1 reply
supercoffeeyesterday at 6:13 PM

I recently needed to create some heavily customized pi images for a fleet of Iot devices. I came across this tool that did the job nicely. Only downside is that it only works on Linux.

https://github.com/gitbls/sdm

aheppyesterday at 7:19 PM

I've been using buildroot for my Pis, and adding a config script to /etc/init.d that can copy over whatever config files you want from /boot

exasperaitedyesterday at 6:18 PM

Good news:

rpi-imager --cli

Has really expanded options over the previous versions.

Including:

--first-run-script <first-run-script> --cloudinit-userdata <cloudinit-userdata> --cloudinit-networkconfig <cloudinit-networkconfig>

Though it doesn't support the old simple config text file, presumably most of that is replaced by cloudinit network config.

I am guessing this is available in the Windows version. I am seeing this from the macOS binary.

show 1 reply