MarcSallent
Posts: 5
Joined: Wed Dec 31, 2014 3:32 pm

Configuring WiFi from OSX

Thu Jul 19, 2018 5:15 pm

Hello,

I have several RPIs that I'll have to deploy to a new physical location and will work connected to the local wifi network, and I still don't know the settings of that network.

Is there a way to set the SSID and password in /boot/cmdline.txt or /boot/config.txt so I can update the SD cards in my computer when I get those settings without having to SSH to each RPI?

Thanks!

marc

B.Goode
Posts: 6426
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Configuring WiFi from OSX

Thu Jul 19, 2018 5:24 pm

The Raspberry Pi Foundation documentation for setting up WiFi with Raspbian is here: https://www.raspberrypi.org/documentati ... /README.md

The section about a 'headless' configuration may be relevant.

If you need further clarification, look for one of the many reposts by forum user @HawaiianPi on this subject.

gkaiseril
Posts: 442
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: Configuring WiFi from OSX

Thu Jul 19, 2018 6:27 pm

Wireless connectivity shows how to do this for first boot. Then depending upon

How to Change Your Raspberry Pi (or Other Linux Device’s) Hostname to change the host name using a bash script that can be added to your auto batch file.

It is also possible to boot a raspberry pi and then edit the booted SD card and add various commands to establish the network settings, add scripts to modify the name and IP address upon booting based on serial number of the Pi and then clone the modified SD card as many times as needed or set up a network boot.

MarcSallent
Posts: 5
Joined: Wed Dec 31, 2014 3:32 pm

Re: Configuring WiFi from OSX

Mon Jul 23, 2018 9:40 am

Thanks! I don't know how I missed the "headless" section :S

To expand in my question, is there a way to set variables in a file in the boot folder in a way that I can read them from a Python or bash script?

Thanks

marc

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

Re: Configuring WiFi from OSX

Mon Jul 23, 2018 4:39 pm

MarcSallent wrote:
Mon Jul 23, 2018 9:40 am
To expand in my question, is there a way to set variables in a file in the boot folder in a way that I can read them from a Python or bash script?
Depends when you want them available, but reading a text file should be no problem. You can add anything you want in the boot partition; just don't remove stuff that is already there ;)

The shell has the handy and dangerous "source" built-in command
Systemd units supports an EnvironmentFile option
I don't know which pattern to recommend with python

Any of these will require the local filesystem to be mounted.

You could also stuff cmdline.txt with your own variables, e.g. "... fsck.repair=yes rootwait foo=bar baz=qux"
and you'll be able to find these with "cat /proc/cmdline".
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 10 guests