![]() |


|
|||||||
| General Discussion This forum is for any type of conversation that really isn't specialized enough to belong in any of the other forums. |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
![]() 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. |
|
|
|
|
|
#4 (permalink) |
![]() 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. |
|
|
|
|
|
#6 (permalink) |
![]() 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 |
|
|
|
| Sponsored links | |
|
|
|
|
|
#7 (permalink) |
![]() 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.
|
|
|
|
|
|
#11 (permalink) |
![]() 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
|
|
|
|
|
|
#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 |
|
|
|
|
|
#15 (permalink) | |
|
Join Date: Jul 2005
Location: Ottawa Valley
Posts: 6,154
|
Re: My teamspeak radio project
Quote:
![]() And I would make it more like a state machine, with state = RUNNING and such.
__________________
Peace through fear... since 1947! |
|
|
|
|
| Sponsored links | |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
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 |

