piBeacon: 5 - preconfigure wifi

Posted on
Wed Feb 26, 2020 2:43 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 5 - preconfigure wifi

There are two solution to preconfigure WiFi on your ssd. The RPI0W does not have an ethernet port and you would need to add keyboard, monitor etc to it in order to set it up.
With this you can skip that by preconfiguring the SSD.
When you put that preconfigured SSD into eg your Pi0W, it will automatically connect to your local wifi with the proper SSID and passcode


(A) full supplicant file
Steps: after you unzip the downloaded ssd image
1. mount your ssd on your mac like this:
Screen Shot 2020-02-26 at 14.27.32.png
Screen Shot 2020-02-26 at 14.27.32.png (9.57 KiB) Viewed 6146 times
Open drive
2.create a file like this one:
Screen Shot 2020-02-26 at 14.27.21.png
Screen Shot 2020-02-26 at 14.27.21.png (12.85 KiB) Viewed 6146 times
replace abc def with your SSID and password. Keep the " in the text
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
   ssid="abc"
   psk="def"
}
(this is the bare minimum supplicant file)
3. save as wpa_supplicant.conf onto the drive:
Screen Shot 2020-02-26 at 14.27.01.png
Screen Shot 2020-02-26 at 14.27.01.png (81.56 KiB) Viewed 6146 times

You can edit it anywhere save and copy from there, or create it directly on the SSD
Make sure you don't use textedit. That will create curly " (rich text format) then it will not work.
4. unmount drive
5. put SSD into your Pi0W, power up. It should start and copy the wpa_supplicant.conf from the boot drive to the proper location and restart.
Then it should automatically connect to your WiFi - if you have done everything correctly.


(B) supply only wifi SSID and password
after initial steps like in (A)
add a file: wifiInfo.json with the exact format (do NOT use textedit!! it produces curly ") :
Code: Select all
{"SSID":"abc", "passCode":"def"}
the file name as well as keys and data are case sensitive.
It will add:
Code: Select all
network={
ssid="abc"
psk="def"
}
to /etc/wpa_supplicant/wpa_supplicant.conf.
Replace abc and def with your wifi setup.
The /boot/wifiInfo.json file will be removed once used.

You need the 2020-february SSD for this to work.

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests