Announcement

Collapse
No announcement yet.

My teamspeak radio project

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • My teamspeak radio project

    I have a pretty simple problem that I decided to design a fairly complex solution. I often forget to launch teamspeak when I get ready to play a game. Once I'm in game and realize I needed to launch Teamspeak then I have to minimize the game and launch teamspeak and sign in while praying that it doesn't crash my game. I thought it might be pretty cool to have a box that sits on my desk that allows me to control teamspeak through a hardware interface. Thus the "Teamspeak Radio" was born. I had an Arduino micro-controller that didn't have a purpose and a bunch of switches and an old ATX power supply chassis. The only thing I had to buy was an LCD. I wrote a script in python to talk to the Radio over the USB port and interface with Teamspeak.



    The switch on the bottom right will start or stop Teamspeak. The next switch from the right is the mute control. It allows me to mute the speakers and microphone with the flip of a switch.



    The LCD shows the channels. The python script gets a list of all of the available channels and spits it out to the Arduino board. The paddle switch on the left allows me to toggle between all of the channels. The red button above the paddle switch joins the selected channel.



    And finally here is inside the radio.

    There are a few things that still need to be done. I need to add a couple of LEDs to show the mute status as well as an LED to show that the Radio is communicating with Teamspeak. The chassis still needs to be sanded and painted a nice Olive Drab as well as gaps filled and general cosmetic work. I also need to add a knob to the pot that controls the LCD contrast. The hardware was inspired by this picture:

    http://www.tactical-link.com/vvc1099.jpg


    Now you know why I was mysteriously connecting and disconnecting from teamspeak. Testing was a pain.
    Retired 6th DB

  • #2
    Re: My teamspeak radio project

    Bravo on the engineering Wimp but man you have too much free time on your hands :D

    But seriously nice work!
    sigpic

    Comment


    • #3
      Re: My teamspeak radio project

      Very, VERY cool wimp.

      If you had to guess what would something like this cost to build from scratch?

      Comment


      • #4
        Re: My teamspeak radio project

        I would guess $15 for switches, $2 for pot, $15 for the LCD, $35 for Arduino board and $10 for the transistors and resistors for the interface board. So a guestimate of $77 not counting the chassis. Geeze this thing was more expensive than I thought.

        The software for the Arduino board was cobbled together from a few open source projects. I haven't posted the code because I don't have it all commented with credits yet.
        Retired 6th DB

        Comment


        • #5
          Re: My teamspeak radio project

          is there a way to use a different (cheaper) board?

          Comment


          • #6
            Re: My teamspeak radio project

            This is super cool. Did you think about publishing this to, like, make magazine?

            Comment


            • #7
              Re: My teamspeak radio project

              Sure you could probably knock a few dollars off the board by going with a standard micro-controller and building a custom board. That's a pretty slippery slope because there end up being a lot of hidden costs such as a programmer. You could probably find something for under $30 but I haven't looked into these things in a while so it's just a guess.
              Retired 6th DB

              Comment


              • #8
                Re: My teamspeak radio project

                Originally posted by marstein View Post
                This is super cool. Did you think about publishing this to, like, make magazine?
                I may do that but I wanted my TG peeps to get a first look.
                Last edited by Wimpinator; 01-06-2007, 02:56 AM.
                Retired 6th DB

                Comment


                • #9
                  Re: My teamspeak radio project

                  BTW the handles on the front are cheap plastic drawer pulls from Home Depot.
                  Retired 6th DB

                  Comment


                  • #10
                    Re: My teamspeak radio project

                    This is the schematic for the interface board

                    Retired 6th DB

                    Comment


                    • #11
                      Re: My teamspeak radio project

                      The python script (yes I know it is far from optimized):

                      Code:
                      ## Teamspeak Radio Interface
                      ## Copyleft Jesse Merritt
                      ## Distribute freely without modifying this header
                      ##
                      ## Visit www.tacticalgamer.com
                      ## The PREMIER online community for mature gamers
                      ##
                      ##
                      ## The PYSERIAL module is required for this script
                      ## http://pyserial.sourceforge.net/
                      
                      
                      #  Imports modules and definse name spaces
                      import serial
                      import os
                      import time
                      
                      newbyte = ""
                      muted = 0
                      unmuted = 1
                      quit = 1
                      start = 1
                      running = 0
                      channel = 0
                      line_count = 0
                      channels = []
                      names = []
                      name_stripped = []
                      id = []
                      
                      ## Setup the serial port
                      ser = serial.Serial(2)
                      
                      ## Main loop
                      while 1:
                          byte = ser.read()       #Reads a byte from the serial port
                          
                          if byte == "m" and running == 1 :        # Mutes Teamspeak
                              if muted == 1:            
                                  os.system("tscontrol.exe MUTE")            
                                  muted = 0
                                  unmuted = 1
                                  print "Muting:   " + byte
                                  
                          if byte == "u" and running == 1 :     # Unmutes Teamspeak  
                              if unmuted == 1 :                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                  os.system("tscontrol.exe UNMUTE")
                                  unmuted = 0
                                  muted = 1
                                  print "unmuting:   " + byte         
                              
                          if byte == "q" and running == 1:        #Quits Teamspeak
                              if quit == 1:
                                  chan_list.close()
                                  print "stopping"
                                  os.system("tscontrol.exe QUIT")            
                                  os.system("rm chan_temp.txt")
                                  quit = 0
                                  start = 1
                                  running = 0
                                  ser.write("Not Connected")          
                                  
                      
                          if byte == "s" :                        #Starts teamspeak and signs on to a designated server
                              if start == 1:
                                  channel = 0
                                  # change the line below to include the correct login name and password
                                  os.system("start teamspeak://67.19.106.94:8767/?nickname=your_name??password=your_pass?Channel=Main")
                                  quit = 1
                                  start = 0
                                  running = 1
                                  time.sleep(5)
                                  print "starting"
                                  os.system("tscontrol get_channels >> chan_temp.txt")    #Gets all channels
                                  chan_list = open("chan_temp.txt", "r")                  #Writes channels to a temp file
                                  ser.write("Main            ")                           #Writes main channel to LCD
                                  
                                  for line in chan_list.readlines() :                     #Parses temp file
                                      line_count = line_count + 1
                                      id_list = line.split(" ")
                                      if line_count > 2 :                                 #The 1st 2 lines are garbage so skip them                
                                          id.append(id_list[1])                           #Add the channels to a list
                                          parsed = line.split(":")
                                          names.append(parsed[3])                        
                                      
                                  for s in names :                                        #Create another list of channels with useless stuff removed                                       
                                      split = s.split("  ")                    
                                      if split != "Playercount" :
                                          name_stripped.append(split[0])                    
                                  length = len(id)
                                  end = length - 1
                                  
                          line_count = 0           
                      
                          if byte == "+" and running == 1:        #Channel up
                              channel = channel + 1
                              if channel == length :
                                  channel = 0
                                  
                              ser.write(name_stripped[channel])    #Write the channel name to the LCD
                              print name_stripped[channel]        
                              
                              
                          if byte == "-" and running == 1:        #Channel Down
                              channel = channel - 1
                              if channel == -1 :
                                  channel = end          
                              print name_stripped[channel]        
                              ser.write(name_stripped[channel])   #Write the channel name to the LCD
                      
                          if byte == "e" and running == 1:        #Enter buttom
                              move = (id[channel])
                              os.system("tscontrol SWITCH_CHANNEL " + str(move))  #Switch to selected channel when pressed
                      Retired 6th DB

                      Comment


                      • #12
                        Re: My teamspeak radio project

                        Originally posted by Wimpinator View Post
                        The python script (yes I know it is far from optimized):
                        We have some python guys kicking around, that might take a look at the code and optimize it.
                        BFCL TF2 league admin

                        Comment


                        • #13
                          Re: My teamspeak radio project

                          Digg it!
                          Battlefield Admin() ()
                          [volun2][medic][defense3][eng2][support]
                          [sg-c1][gchq-c1][tog-c1][ma-c1][taw-c1][tg-c2]
                          | for | |

                          Comment


                          • #14
                            Re: My teamspeak radio project

                            Consider yourself Digged. (Dug?)

                            Comment


                            • #15
                              Re: My teamspeak radio project

                              Originally posted by Root View Post
                              We have some python guys kicking around, that might take a look at the code and optimize it.
                              Well it really doesn't need any optimization. Speed is not an issue with code like this. I would only change it to use more obvious variable names. ;)

                              And I would make it more like a state machine, with state = RUNNING and such.
                              Peace through fear... since 1947!

                              Comment

                              Connect

                              Collapse

                              TeamSpeak 3 Server

                              Collapse

                              Advertisement

                              Collapse

                              Twitter Feed

                              Collapse

                              Working...
                              X