A Raspberry Pi FM radio with DVR-like time-shifting capabilities that allows you to pause, rewind, and fast-forward through live, analog radio.
- Time-Shifting: Pause live radio and rewind up to 60 seconds, or buffer up to 5 minutes of content
- TEA5767 Integration: Uses the TEA5767 FM tuner module via I2C
- OLED Display: Shows frequency, signal strength, playback status, and buffer information
- Physical Controls:
- Four buttons: play/pause, forward, backward, and reset to live
- Rotary encoder for frequency tuning
- RSSI Monitoring: Displays signal strength with a visual indicator
- Frequency Persistence: Remembers the last tuned station across reboots
- Raspberry Pi (any model <= Pi 4. Pi5 is weird with this hardware config.)
- TEA5767 FM tuner module (I2C interface)
- OLED display (SPI interface, SSD1306 controller)
- 4 push buttons
- Rotary encoder
- Audio output (speakers or headphones)
- Python 3.6+
- RPi.GPIO
- sounddevice
- numpy
- smbus2
- Pillow (PIL)
- luma.core and luma.oled
- evdev
-
Clone this repository:
git clone https://github.com/GabeKnuth/RadioShift.git cd RadioShift -
Install dependencies:
pip install -r requirements.txt -
Ensure I2C and SPI are enabled on your Raspberry Pi:
sudo raspi-configNavigate to "Interface Options" and enable both I2C and SPI.
-
Connect the hardware:
- TEA5767 module to the I2C pins (GPIO 2 & 3)
- OLED display to the SPI pins
- Buttons to GPIO pins as defined in
config.py - Rotary encoder to appropriate pins
-
Run the main application:
python main.py -
Controls:
- Rotate the encoder to tune radio frequency
- Press play/pause button to pause/resume playback
- Press backward button to rewind by 0.5 seconds
- Press forward button to advance by 0.5 seconds
- Press live button to return to live radio
All configuration settings can be adjusted in config.py, including:
- Buffer times for past and future content
- Audio settings (sample rate, block size, etc.)
- GPIO pin assignments
- Default frequency
- RSSI display settings
main.py: Application entry pointaudio_buffer.py: Time-shifting buffer implementationradio.py: TEA5767 FM tuner controldisplay.py: OLED display interfacebuttons.py: Physical controls handlingrssi.py: Signal strength monitoringpersistence.py: Frequency persistence across rebootsconfig.py: Configuration settings