Python script for 60s Diner Wallbox as Controller

Hey there,
i’m new to phyton and still relatively new to osmc so please be forgiving if i ask stupid questions :slight_smile:
I have a Seeburg Consolette Wallbox (kind of a remote for an old vinyl jukebox) which is connected to my raspberry pi (i got my inspiration and huge parts of my python code from this project here: http://wallbox.weebly.com)
The python script i’m working on polls the GPIO Pins from my raspberry Pi 2 for a signal and interprets these signals (electric pulses) into a selection (A1, B4…V8, etc.) that has been made on the wallbox. Then the raspberry should start playing the mp3 file. I managed to get this done within raspbian with mpg321 but now want to do this with kodi as mp3 player instead.
Here’s the part of the code i used to start the mp3 with mpg321 in raspbian:

def play_song(track):
print “Playing Track %s” % track
global ACTIVE_PROCESS
if ACTIVE_PROCESS:
ACTIVE_PROCESS.terminate()
ACTIVE_PROCESS = subprocess.Popen([“mpg321”, “/Music/Jukebox/%s.mp3” % track])

I checked the web and found out that there is a xbmc module which could work but that i have to run the python script within kodi.
Can anyone help me with the line to play the mp3 file and tell me how to run the script in kodi?

Thanks in advance!

You should probably ask this question on the kodi forums, as it’s not really OSMC related (other than the coolness to hooking the Wallbox to the Pi :wink: )

It’s been a while since I played with Kodi plugins, but looking at your code I can tell that you are not telling Kodi to play the file, you are trying to start another process to play the file. You need to tell Kodi to play the file instead. Look on the kodi site about how to develop a plugin for more info.

Good luck with your project!

I have the scripts for de Pi. It is tuned for my wurlitzer 5250. It counts the pulses from the wallbox and send the result to the database. In this database (mysql) is the link to the songid in the kodi database. In my case i using a mysql db for the music library. If you are interested in it send me a reply.:slightly_smiling:

1 Like

Hey Paul - sounds interesting! Can you send me the code and maybe explain this to me?
I just got hold of a second Wallbox - a Seeburg 3W1 that I hooked up with an internal amp etc. and want to use as a standalone player with a raspberry pi and some speakers.
Thought about having online radio stations instead of mp3 as selections.
Can you post a link or so?
Cheers
Philipp

Hi Philipp,

I changed the code for the wallbox. Currently it’s independent to the type of database you use in the DNLA compatible device. It only send the code for the pressed button in a mqtt format the the mosquito server. All logic is handled with a node-red (nodered.org) server.

However the walbox script is still in python 2.7.

Buttonmqtt

1 Like

Hey Paul,
thanks for your answer. I will take a look at this. But if you can upload your python code somewhere and post the link here it would help me A LOT!
I never worked with mosquito or node-red so I have to dig myself into this…
Cheers
Philipp

Hi Philipp,

The code is under the Buttonmqtt link. doesn’t the work for you?

1 Like

Ah sorry…didn’t see that.
Thank you very much!! I will look into it and let you know how it turned out for me.
Right now I’m trying to set up my Wallbox in the kitchen with Volumio as OS since it this one is headless.
But in the living room I have the Seeburg Consolette connected to the Rpi that also acts as a media center with Kodi. Right now it runs the songs from the command line via mpg321 and this works pretty well but I have to have raspbian as a OS running in the background which sometimes is a bit of a pain :slight_smile:

Hi,
I’ve bought as a rasp pi so i can encode signals using the pi’s GPIO from an old 100 selection jukebox , I’ve manage to use someone else’s python script which prints the comination i.e A1, B1, etc. would anyone know how i can get the combination it prints to link to an mp3 i.e. if it printed A1 it would play mp3 A1 etc, all the way upto k0. someone told me i maybe able to use pygame but as I’m new to this i have no idea what I’m doing.

unfortunately i cannot get your code to work in my python script and play the mp3. Does this need to go in a special section, I have installed mpg321.

Thanks

You need to be talking with the author of the script! Maybe try PMing him.

1 Like

Ive just joined today, how do you do that. i can’t see an option to?

You click on the name of the person you want to PM (since you just joined today, you may not be able to do that for day or so.)

1 Like

@Powdersurfer Please could you send me your python file that allowed you to play mp3s from the combination. Thank you.

@Jarrett_English wrote you a PM.