❗Make sure you've completed Programming the ESP32 as WiFi Co-Processor and are able to scan for access points ("AP") before proceeding.

Connecting to an Open or WPA-secured AP

  1. (optional) Ensure you can access the WiFi AP by connecting to it from a laptop/phone

  2. Edit the /lib/secrets.py file on your SAM32 and update ssid to be the broadcast name of your WiFi access point and password to be the corresponding password. If the AP doesn't have a password (is an "Open" network), set the password field to be empty like this:

    'password' : '',

    Make sure your ssid and password are strings (enclosed in quotes or in apostrophes) and then save the file.

    ⚠BE CAREFUL⚠ sharing secrets.py! your credentials are stored in plain text!

  3. Open a serial console and start the SAM32 REPL (Accessing the Serial Console)

  4. Press Ctrl + D to reboot the board, then Ctrl + C to halt it

  5. Type:

    >>> from sam32lib import sam32
    >>> sam32.esp_init()
    >>> sam32.wifi()
    
  6. See the Testing Your Connection section below

Connecting to "eduroam" (common University WiFi)

eduroam is an "enterprise" access point and must be handled differently than a standard WPA2-esque connection.

  1. (optional) Ensure you can access eduroam by connecting from a laptop/phone with your university credentials
  2. Edit the /lib/secrets.py file on your SAM32 and update ent_user to be your university email address and ent_password to be the password corresponding with the account. Save the file. You don't need to update any other fields unless your enterprise AP is not named "eduroam"

⚠BE CAREFUL⚠ sharing secrets.py! your credentials are stored in plain text! 3. Open a serial console and start the SAM32 REPL (Accessing the Serial Console) 4. Press Ctrl + D to reboot the board, then Ctrl + C to halt it 5. Type:

```bash
>>> from sam32lib import sam32
>>> sam32.esp_init()
>>> sam32.wifi(enterprise=2)
```

setting `enterprise=2` is what tells the ESP32 to handle this connection differently than normal.
  1. See the Testing Your Connection section below

Testing Your Connection

After following one of the procedures above for connecting to an AP (and assuming you didn't receive any error messages), there are multiple ways to check if you're connected: