ZPMMaker
Posts: 111
Joined: Sun Aug 23, 2015 11:04 am
Location: Australia

Using two WiFi country codes

Sun Mar 22, 2020 10:14 pm

I've been developing an IoT sensor suite based on the RPi, and am about to start shipping the systems to where they're being installed.

Problem is, it's more convenient to use WiFi both during system setup (here in Australia) and when the system is being installed (potentially in other countries) rather than using an Ethernet cable.

TL;DR: is there a way to specify more than one WiFi country code in wpa_supplicant.conf?

Thanks.

trejan
Posts: 3064
Joined: Tue Jul 02, 2019 2:28 pm

Re: Using two WiFi country codes

Sun Mar 22, 2020 10:22 pm

ZPMMaker wrote:
Sun Mar 22, 2020 10:14 pm
TL;DR: is there a way to specify more than one WiFi country code in wpa_supplicant.conf?
No. You can't specify multiple countries. Does the end user not pick the country themselves?

You need to change it at the last step of your programming process or have a manufacturing mode where it defaults to Australia.

ZPMMaker
Posts: 111
Joined: Sun Aug 23, 2015 11:04 am
Location: Australia

Re: Using two WiFi country codes

Sun Mar 22, 2020 10:32 pm

trejan wrote:
Sun Mar 22, 2020 10:22 pm
ZPMMaker wrote:
Sun Mar 22, 2020 10:14 pm
TL;DR: is there a way to specify more than one WiFi country code in wpa_supplicant.conf?
No. You can't specify multiple countries. Does the end user not pick the country themselves?

You need to change it at the last step of your programming process or have a manufacturing mode where it defaults to Australia.
Ok, thanks anyway.

"Does the end user not pick the country themselves?" No, it's a completely headless system; I need to pre-program the appropriate WiFi settings prior to shipping.

"You need to change it at the last step of your programming process" Yep, was just trying to avoid having to do that because my network switch is in a hard-to-reach place and I'm being lazy. :lol:

Thanks anyway for the advice.

trejan
Posts: 3064
Joined: Tue Jul 02, 2019 2:28 pm

Re: Using two WiFi country codes

Sun Mar 22, 2020 10:49 pm

ZPMMaker wrote:
Sun Mar 22, 2020 10:32 pm
"Does the end user not pick the country themselves?" No, it's a completely headless system; I need to pre-program the appropriate WiFi settings prior to shipping.

"You need to change it at the last step of your programming process" Yep, was just trying to avoid having to do that because my network switch is in a hard-to-reach place and I'm being lazy. :lol:
Are you using a preconfigured card image that you write and then alter the WiFi settings? If so then just leave the prebuilt image set to Australia and your SSID details so it'll join your network automatically.

An alternative if you only need to configure WiFi before shipping is to copy a wpa_supplicant.conf file to the boot partition after you've written the card. The Pi startup scripts will look for a wpa_supplicant.conf file so people can configure WiFi headlessly.

RonR's RPi-Init tool might be helpful for you.

ZPMMaker
Posts: 111
Joined: Sun Aug 23, 2015 11:04 am
Location: Australia

Re: Using two WiFi country codes

Mon Mar 23, 2020 1:25 am

trejan wrote:
Sun Mar 22, 2020 10:49 pm
ZPMMaker wrote:
Sun Mar 22, 2020 10:32 pm
"Does the end user not pick the country themselves?" No, it's a completely headless system; I need to pre-program the appropriate WiFi settings prior to shipping.

"You need to change it at the last step of your programming process" Yep, was just trying to avoid having to do that because my network switch is in a hard-to-reach place and I'm being lazy. :lol:
Are you using a preconfigured card image that you write and then alter the WiFi settings? If so then just leave the prebuilt image set to Australia and your SSID details so it'll join your network automatically.

An alternative if you only need to configure WiFi before shipping is to copy a wpa_supplicant.conf file to the boot partition after you've written the card. The Pi startup scripts will look for a wpa_supplicant.conf file so people can configure WiFi headlessly.

RonR's RPi-Init tool might be helpful for you.
Thanks. I already have the file in the boot partition prior to first boot. Getting the RPi to connect to my WiFi when I first turn it on is not the issue, though.

It's ok; I've since climbed up and run a Ethernet cable out of the network switch. Problem solved. :)

Return to “Advanced users”