- Download and install: Notepad++ Alternatively, any other text editor which is capable of editing files with Unix-style line endings.
- Optional: Watch this video to get an idea of the process. The steps from the video are partially automated, below.
- Remove the MicroSD card from your computer and reinsert it. Do not at any point during the setup of the USB drive allow Windows to format any partition on any drive.
- Note that a new drive labeled "boot" has appeared on your computer. Note the drive letter of that drive.
- Right-click on your Start menu icon and select "Windows PowerShell (Admin)".
- Right-click the title bar of the window and select "Properties". Ensure that the "Use legacy console" checkbox is unchecked and activate the OK button. If it was checked before you unchecked it, close te PowerShell window and go back to step 3. If it wasn't, proceed onto the next step.
- Run the following command:
Note: You can paste into the PowerShell window by right-clicking. The text will appear at the position of the cursor, not necessarily at the position where you click.
Set-ExecutionPolicy -Scope CurrentUser Unrestricted
- Enter Y when prompted, and press Enter.
- Run the following commands:
cd ~ wget https://raw.githubusercontent.com/marcone/teslausb/main-dev/setup/windows/setup-piForHeadlessConfig.ps1 -OutFile setup-piForHeadlessConfig.ps1 ./setup-piForHeadlessConfig.ps1 -Verbose
- Enter the single letter of the "boot" drive and press Enter.
- Enter the SSID of your WiFi network and press Enter.
- Enter the Pre-Shared Key of your WiFi network and press Enter.
- If you want to add additional WiFi networks, execute:
./add-wifi.ps1 -Verbose
- If you will use any public or insecure networks, be sure to update your password using the instructions at the end of this document.
- Enter the additional SSID and Pre-Shared Key of the WiFi network and repeat as necessary.
- Eject the sd card.
- Move the sd card to the Pi.
- Connect a micro usb cable to the port labeled "USB" on the Raspberry Pi, and to the PC.
- On the PC, press your Windows key, type Control Panel.
- Open "Network and Sharing Center"
- Click "Change adapter settings"
- Wait for something labeled "USB Ethernet/RNDIS Gadget" to appear.
- Enter this command in your PowerShell window:
Note: If you receive an error indicating that the host id has changed and you can't work around it you'll need to delete the ~\.ssh\known_hosts file. You're especially likely to encounter this error if you're following these instructions for a second time.
- If you get an "unknown host" error message install Bonjour: https://support.apple.com/kb/DL999 and go back to step 15.
- You should be prompted for the password for the user "pi". Enter
raspberry
- Change your password! While not required, it is recommended, especially if you may be using any public or insecure WiFi connections. To do so Enter
passwd
- Then enter your new password and press Enter
- Confirm your new password and press Enter
- If you want to change your password later, you must set the system partition to writeable with either
/root/bin/remountfs_rw
- or
mount / -o remount,rw