Create credentials file
The Spotify MacroBoard uses a separate header file for credentials to keep sensitive information organized and secure.1
Locate the sample file
Navigate to the
src directory in your Spotify MacroBoard source code and find SampleCredentials.h.2
Create your credentials file
Make a copy of
SampleCredentials.h and rename it to SMBCredentials.h.3
Open for editing
Open
SMBCredentials.h in Arduino IDE or your preferred text editor.Configure WiFi settings
The ESP32 needs WiFi credentials to connect to your network and communicate with the Spotify API server.Configuration parameters
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
1
Connect to your server
Use OpenSSL or your browser to retrieve the SSL certificate from your server:
2
Copy the certificate
Copy the entire certificate including the
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines.3
Format for C++
Format the certificate as a C++ string with line breaks escaped as
\n.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
Display configuration
Display configuration
Verify configuration
Before uploading, verify your configuration:1
Check file inclusion
Ensure the main sketch (
src.ino) includes your credentials file:2
Verify compilation
Click the Verify button in Arduino IDE to compile the code and check for errors.
3
Review credentials
Double-check that:
- WiFi SSID and password are correct
- Network is 2.4 GHz
- API password matches your server configuration
- Server certificate is properly formatted
Upload to ESP32
Once your configuration is complete:1
Connect ESP32
Connect your ESP32 to your computer via USB.
2
Select port
Verify the correct port is selected in Tools > Port.
3
Upload
Click the Upload button (right arrow icon) to compile and upload the code.The upload process typically takes 30-60 seconds.
4
Monitor connection
After upload, watch the RGB LEDs for connection status:
- Pulsing white: Connecting to WiFi
- Fade to green: Successfully connected
- Red: Connection error
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