Before uploading the code to your ESP32, you need to configure credentials and network settings. This includes WiFi credentials, API authentication, and SSL certificate configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/benz206/SpotifyMacroBoard/llms.txt
Use this file to discover all available pages before exploring further.
Create credentials file
The Spotify MacroBoard uses a separate header file for credentials to keep sensitive information organized and secure.Locate the sample file
Navigate to the
src directory in your Spotify MacroBoard source code and find SampleCredentials.h.Configure WiFi settings
The ESP32 needs WiFi credentials to connect to your network and communicate with the Spotify API server.Configuration parameters
| Parameter | Description | Example |
|---|---|---|
SSID | Your WiFi network name | ”HomeNetwork” |
SSID_PASS | Your WiFi password | ”MySecurePassword123” |
Set API password
The API password authenticates your MacroBoard with the Spotify control server.This password is used in API requests to
/api/manageState/ and /api/getCurrent/ endpoints. You’ll need to configure the same password on your server.Configure server certificate
The MacroBoard uses HTTPS for secure communication with the API server. You need to provide the server’s SSL certificate.Get your server certificate
Connect to your server
Use OpenSSL or your browser to retrieve the SSL certificate from your server:
Copy the certificate
Copy the entire certificate including the
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines.Certificate configuration
Example certificate configuration
Example certificate configuration
The certificate is set using
wifiClient.setCACert(benzServerCert) during setup. This ensures all HTTPS connections are verified against this certificate.Pin configuration
The pin assignments are defined in the credentials file. Verify these match your hardware connections:Pin reference
RGB LED settings
RGB LED settings
| Setting | Value | Description |
|---|---|---|
RGB_PIN | 18 | Data pin for LED strip |
RGB_LED_NUM | 20 | Number of LEDs in strip |
BRIGHTNESS | 230 | LED brightness (0-255) |
CHIP_SET | WS2812B | LED chip type |
COLOR_CODE | GRB | Color order for LEDs |
Button assignments
Button assignments
Display configuration
Display configuration
| Setting | Value | Description |
|---|---|---|
SDA | 21 | I2C data pin |
SCL | 19 | I2C clock pin |
SCREEN_WIDTH | 128 | Display width in pixels |
SCREEN_HEIGHT | 64 | Display height in pixels |
OLED_RESET | -1 | No reset pin used |
Verify configuration
Before uploading, verify your configuration:Upload to ESP32
Once your configuration is complete:Upload
Click the Upload button (right arrow icon) to compile and upload the code.The upload process typically takes 30-60 seconds.
Troubleshooting
LEDs show red after upload
LEDs show red after upload
Cause: Cannot connect to WiFi or API server.Solutions:
- Verify WiFi credentials are correct
- Ensure you’re using a 2.4 GHz network
- Check that your router is broadcasting the SSID
- Move the ESP32 closer to your router
- Verify the server certificate is correct
LEDs show yellow after connection
LEDs show yellow after connection
Cause: API request timeout.Solutions:
- Check that your server is running and accessible
- Verify the API password is correct
- Ensure your firewall allows connections on port 443
- Check server logs for errors
LEDs show orange
LEDs show orange
Cause: Invalid response from server.Solutions:
- Verify the server is returning proper JSON responses
- Check that the API endpoints are implemented correctly
- Review server logs for errors
Compilation errors
Compilation errors
Cause: Missing or incorrect configuration.Solutions:
- Ensure
SMBCredentials.hexists in thesrcdirectory - Verify all required libraries are installed
- Check that pin definitions don’t conflict
- Ensure certificate string is properly formatted
Next steps
Code overview
Learn about the code structure and how the MacroBoard works