info:sonos_api_for_seeburg
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
info:sonos_api_for_seeburg [2023/11/12 08:29] – 192.168.1.71 | info:sonos_api_for_seeburg [2023/11/12 08:35] (current) – 192.168.1.71 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Sonos API for Seeburg ===== | ||
+ | This website is no longer available. | ||
+ | |||
+ | Having solved the electronics problem I developed a small Python program to handle the decoding logic and the communication with the home media system. | ||
+ | |||
+ | The main loop of the program polls the GPIO pin which is connected to the voltage regulator. | ||
+ | |||
+ | < | ||
+ | Wait for a pulse | ||
+ | |||
+ | When a pulse is detected, count the pulses in the pulse train | ||
+ | |||
+ | a) Count the pulses before the “gap” and store this as the selection number | ||
+ | |||
+ | b) Count the pulses after the “gap” and store this as the selection letter | ||
+ | |||
+ | Play the song corresponding to that selection | ||
+ | |||
+ | Go back to the start | ||
+ | </ | ||
+ | |||
+ | It should be simple, but there are a couple of small complications to overcome. | ||
+ | |||
+ | The second complication is that the square waves of the pulses (from the voltage regulator) have short gaps between them when the GPIO will read False. | ||
+ | |||
+ | To solve both of these issues, I wrote a short function that allowed the logic to ignore short gaps and spikes. | ||
+ | |||
+ | The logic now runs like this: | ||
+ | |||
+ | < | ||
+ | Wait for a pulse | ||
+ | |||
+ | When a pulse is detected, check that it is long enough to be a proper pulse, if it is very short ignore it | ||
+ | |||
+ | If it is a proper pulse then start counting the pulse train and don’t stop until there has been a gap of more than X seconds | ||
+ | |||
+ | Whenever the GPIO pin state changes check that the change is long enough to correspond to a signal pulse or gap. If it is very short ignore it | ||
+ | |||
+ | Count the pulses before the big gap and store this as the selection number | ||
+ | |||
+ | Then count the pulses after the big gap and store this as the selection letter | ||
+ | |||
+ | Play the song corresponding to that selection | ||
+ | |||
+ | Go back to the start | ||
+ | </ | ||
+ | |||
+ | I wrote several debugging programs which output information to the terminal to show data about time between pulses and final calculation of the selection so that I could be sure that it was working and to fine tune the function that ignores the spikes and short gaps. Here is a video showing one of these programs working. | ||
+ | |||
Now we have to get the Raspberry Pi to communicate with the home music network. | Now we have to get the Raspberry Pi to communicate with the home music network. | ||
info/sonos_api_for_seeburg.1699795750.txt.gz · Last modified: 2023/11/12 08:29 by 192.168.1.71