This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Raspberry Pi as a Bluetooth speaker (headless, persistent) | |
| A guide to turning a headless Raspberry Pi into a persistent Bluetooth audio sink — so any paired device can connect and play audio without you needing to SSH in first. | |
| ## Prerequisites | |
| - Raspberry Pi running Raspberry Pi OS (Bullseye or later) | |
| - BlueZ and PulseAudio installed (included by default on most Pi OS images) | |
| - An audio output — onboard audio, HDMI, or a USB DAC | |
| - A Bluetooth device to connect from (Mac, iPhone, Android, etc.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class OAuth1 | |
| class << self | |
| def oauth_header(uri:, method:, access_token:, access_secret:, consumer_key:, consumer_secret:) | |
| header = { | |
| 'oauth_consumer_key' => consumer_key, | |
| 'oauth_token' => access_token, | |
| 'oauth_nonce' => generate_nonce, | |
| 'oauth_signature_method' => 'HMAC-SHA256', | |
| 'oauth_timestamp' => Time.now.to_i, | |
| 'oauth_version' => '1.0' |