Go Back   Tactical Gamer > General Forums > General Discussion


General Discussion This forum is for any type of conversation that really isn't specialized enough to belong in any of the other forums.

Reply
 
Thread Tools
Old 01-06-2007, 01:43 AM   #1 (permalink)
 
Wimpinator's Avatar
 
Join Date: Jan 2006
Location: United states, TN
Age: 35
Posts: 2,909
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.
__________________
|TG-6th|Wimpinator



Wimpinator is offline   Reply With Quote
Old 01-06-2007, 01:50 AM   #2 (permalink)
 
Drizzid's Avatar
 
Join Date: Oct 2005
Location: Glendale, AZ
Age: 37
Posts: 2,957
Re: My teamspeak radio project

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

But seriously nice work!
__________________
Drizzid is offline   Reply With Quote
Sponsored links
Old 01-06-2007, 01:51 AM   #3 (permalink)
 
Join Date: Aug 2005
Location: indiana
Posts: 1,000
Re: My teamspeak radio project

Very, VERY cool wimp.

If you had to guess what would something like this cost to build from scratch?
freekyE is offline   Reply With Quote
Old 01-06-2007, 02:01 AM   #4 (permalink)
 
Wimpinator's Avatar
 
Join Date: Jan 2006
Location: United states, TN
Age: 35
Posts: 2,909
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.
__________________
|TG-6th|Wimpinator



Wimpinator is offline   Reply With Quote
Old 01-06-2007, 02:09 AM   #5 (permalink)
 
Join Date: Aug 2005
Location: indiana
Posts: 1,000
Re: My teamspeak radio project

is there a way to use a different (cheaper) board?
freekyE is offline   Reply With Quote
Old 01-06-2007, 02:17 AM   #6 (permalink)
 
marstein's Avatar
 
Join Date: Jul 2005
Location: Half Moon Bay, CA, USA
Age: 42
Posts: 828
Re: My teamspeak radio project

This is super cool. Did you think about publishing this to, like, make magazine?
__________________
Gigabyte P35-DS3R, 2GB, 8800GTS 640MB, Core2Duo E8400
marstein is offline   Reply With Quote
Sponsored links
Old 01-06-2007, 02:19 AM   #7 (permalink)
 
Wimpinator's Avatar
 
Join Date: Jan 2006
Location: United states, TN
Age: 35
Posts: 2,909
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.
__________________
|TG-6th|Wimpinator



Wimpinator is offline   Reply With Quote
Old 01-06-2007, 02:20 AM   #8 (permalink)
 
Wimpinator's Avatar
 
Join Date: Jan 2006
Location: United states, TN
Age: 35
Posts: 2,909
Re: My teamspeak radio project

Quote:
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.
__________________
|TG-6th|Wimpinator




Last edited by Wimpinator; 01-06-2007 at 02:56 AM.
Wimpinator is offline   Reply With Quote
Old 01-06-2007, 02:56 AM   #9 (permalink)
 
Wimpinator's Avatar
 
Join Date: Jan 2006
Location: United states, TN
Age: 35
Posts: 2,909
Re: My teamspeak radio project

BTW the handles on the front are cheap plastic drawer pulls from Home Depot.
__________________
|TG-6th|Wimpinator



Wimpinator is offline   Reply With Quote
Old 01-06-2007, 03:08 AM   #10 (permalink)
 
Wimpinator's Avatar
 
Join Date: Jan 2006
Location: United states, TN
Age: 35
Posts: 2,909
Re: My teamspeak radio project

This is the schematic for the interface board

__________________
|TG-6th|Wimpinator



Wimpinator is offline   Reply With Quote
Sponsored links
Old 01-06-2007, 03:31 AM   #11 (permalink)
 
Wimpinator's Avatar
 
Join Date: Jan 2006
Location: United states, TN
Age: 35
Posts: 2,909
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
__________________
|TG-6th|Wimpinator



Wimpinator is offline   Reply With Quote
Old 01-06-2007, 05:09 AM   #12 (permalink)
 
Root's Avatar
 
Join Date: Dec 2004
Location: South east england
Posts: 8,839
Re: My teamspeak radio project

Quote:
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
Root is offline   Reply With Quote
Old 01-06-2007, 08:22 AM   #13 (permalink)
 
Join Date: Jul 2005
Posts: 4,494
Re: My teamspeak radio project

Digg it!
__________________
Battlefield Admin(BF2 Rules) (BF2142 Rules)
[volun2][medic][defense3][eng2][support]
[sg-c1][gchq-c1][tog-c1][ma-c1][taw-c1][tg-c2]
Support TG | Write for TacticalWiki | BF2 Sig. Generator | TS Help
perry is offline   Reply With Quote
Old 01-06-2007, 10:53 AM   #14 (permalink)
Obi
 
Obi's Avatar
 
Join Date: Jul 2005
Location: Scotland
Age: 20
Posts: 2,081
Re: My teamspeak radio project

Consider yourself Digged. (Dug?)
__________________

Obi is offline   Reply With Quote
Old 01-06-2007, 11:57 AM   #15 (permalink)
 
icky's Avatar
 
Join Date: Jul 2005
Location: Ottawa Valley
Posts: 6,154
Re: My teamspeak radio project

Quote:
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!
icky is offline   Reply With Quote
Sponsored links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SOP (Radio) - The Radio Check Apophis Operation Flashpoint - Announcements and SOP's 0 08-31-2005 02:52 PM
SOP (Radio) - The Contact Report Badger Ghost Recon - Official Rules, Announcements and SOP's 0 05-15-2003 01:24 PM
SOP (Radio) - The Fire Mission Badger Ghost Recon - Official Rules, Announcements and SOP's 0 05-15-2003 01:22 PM
SOP (Leadership) - S.M.E.A.C. Badger Ghost Recon - Official Rules, Announcements and SOP's 0 05-15-2003 01:19 PM


All times are GMT -4. The time now is 09:42 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
©2004-2008 - Tactical Gamer - All Rights Reserved