Skip to content

Latest commit

 

History

History
121 lines (79 loc) · 3.14 KB

README.md

File metadata and controls

121 lines (79 loc) · 3.14 KB

ESP32 Spotify Player Display

A Spotify player display implementation using ESP32 and an OLED I2C display.

Overview

This project displays Spotify playback information on an OLED screen connected to an ESP32 microcontroller.

Simulated Prototype

For desmonstration and testing purposes, a simulated prototype is available at Wokwi (an online ESP32 simulator).

Run on Wokwi

Requirements

Note

This project is developed and tested on Linux-based systems. Compatibility with other operating systems is not guaranteed.

Hardware

  • ESP32 (or compatible board)
  • OLED 128x64 Display (SSD1306 or similar)
  • USB cable for programming
  • I2C connection cables

Software

Installation

  1. Install playerctl (installation guide)
  2. Clone this repository
  3. Compile the serial communication program:
gcc -o playerctl_to_serial playerctl_to_serial.c -lpthread

Usage

Execute the compiled binary:

./playerctl_to_serial [--port=SERIAL_PORT] [--baud=BAUD_RATE]

Default values:

  • Port: /dev/ttyACM0
  • Baud: 1152000

Example:

./playerctl_to_serial -p /dev/ttyUSB0 -b 9600

Configuration

Display Setup

Configure your OLED display controller in esp32-spotify-player.ino:

// initialization for the 128x64px OLED display
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

See supported controllers for options.

Protocol

Serial data format:

status;volume%;title;artist;current_position;time_left;full_time;percentage_position;

Example:

1;69%;Open Hearts;The Weeknd;1:21;-2:33;3:54;34;

Display Output:

Troubleshooting

Important

  • Verify serial port connection
  • Check playerctl installation
  • Confirm display I2C connection

Error display:

Known Issues

  • The serial communication program not stop to comunicate with the port when the ESP32 is disconnected.
  • Songs with too long titles or artists may not fit the display was shown by the example below:

Display Overflow:


Footnotes

  1. While Spotify is the default player, others can be used by modifying the playerctl_to_serial.c file.