The Web Controled Radio how to page:

This page describes the setup of a fairly easy to implement internet controled radio. This setup has many limitations, but the audio quality is quite high, the video acceptable, and the control efficient. I am sure there are many better ways to do this. Real Server Basic and Real Producer Basic being one of many ideas. After a few nights of a few hours trying to set these up to run together, I opted for a simpler solution.

I had a dynamic web address. If I wanted people to connect to my computer so that they can connect with NetMeeting, I would have to have a way that people could connect with a web address that changes each time I logged on. This can be done with software available from http://www.tzo.com . They have a nice website that tells you how to connect NetMeeting with a computer using thier product at: http://www.tzo.com/MainPageSupport/HowToPages/HowToNetmeeting.html , but this turns out to be quite easy.

With the addition of installing a sound card , an optional usb video camera, and NetMeeting on your computer (see http://www.microsoft.com/windows/netmeeting/ ) you now may have an internet radio (less the controls). People could connect to your radio and view/listen to what channel you are tuned to. You are now half way there ...... almost.

You need something that takes input from the web page and inputs this into the radio. For my setup this was split into two functions. First, a web page that took input (http://www.radiohound.com/webradio2.shtml )and wrote the input into a file called http://www.radiohound.com/outdata.txt . Second, a program running on my home computer that checks this file at 3 second intervals to see if the input has changed. Since this file is only one line long, it does not take to much bandwidth, but I do incur about 50% of my IScur about 50% of my ISP's alloted "hits", hence the selection of 3 second intervals.

To make a file on your homepage allow write commands, you need to set its permissions. To do this, start telnet, connect to your ISP. You may have to change the directory to get to where this file is located using the "cd public_html" or similar command. To change the permissions to one that would allow to be written to, enter the command "chmod 660 outdata.txt". This should allow outdata.txt to be written to. For more info about ssi and cgi, my ISP has a nice FAQ at: http://www.best.com/faq/ . Select the links for ssi and cgi. Note: You should check your ISP to see if they allow these types of files.

For the main webpage, you can view my source and see most of what I am up to, or even copy my page and edit it to match your needs. First of all, it is webradio.shtml . The .shtml allows you to do some server side includes (ssi). This stuff you cannot see with view source. This is what writes info to a file. At the bottom of the web page I have input the command <!--#exec cmd="echo $QUERY_STRING>outdata.txt"--> . This tells the webpage to write the querry string (what you see at the end of www.radiohound.com/webradio.shtml?freq=144.390) to the file outdata.txt . Old info wiltdata.txt . Old info will be written over.

Next, I wrote a "small" Visual Basic program that runs in the background of my home computer. This program downloads the info in outdata.txt at 3 second intervals. If a command has changed states, it checks the command for validity, and then sends the command to the radio over the serial port. A list of commands that can be sent over the serial port to the radio can be found here.A picture of the form is shown below. I was going to make this file available for other users to make thier own web-radio, but I am ashamed to post the 18meg file. Not only that, but the file is to big to post on my ISP. If anyone has no limit out there, and would like to host a home for this big bertha file, let me know.

Written code:

Private Sub cmdSend_Click()
MSComm1.Output = Text4.Text & Chr(13)
End Sub
Sub PortSelect()
If MSComm1.PortOpen = False Then MSComm1.PortOpen = True
MSComm1.Output = "AI 0" + Chr(13)
MSComm1.Output = "DL 0" + Chr(13)
MSComm1.Output = "BUF 0" + Chr(13)
MSComm1.Output = "BUF 1" + Chr(13)
End Sub

Private Sub Exit_Click()
End
End Sub
Private Sub Form_Load()
MSComm1.CommPort = 2
oad()
MSComm1.CommPort = 2
PortSelect
End Sub
Private Sub Help_Click()
frmHelp.Show
End Sub
Private Sub MSComm1_OnComm()
Dim EVMsg$
Dim ERMsg$
' Branch according to the CommEvent property.
Select Case MSComm1.CommEvent
' Event messages.
Case comEvReceive
Dim Buffer As Variant
Buffer = StrConv(MSComm1.Input, vbUnicode)
Rem Debug.Print "Receive - "; Buffer, Asc(Buffer)
txterm.Text = txterm.Text + Buffer
If Right(txterm.Text, 1) = Chr(13) Then
I = Len(txterm.Text) - 1
Text5.Text = Left(txterm.Text, I)
txterm.Text = ""
End If

' Error messages.
Case comBreak
ERMsg$ = "Break Received"
Case comCDTO
ERMsg$ = "Carrier Detect Timeout"
Case comCTSTO
ERMsg$ = "CTS Timeout"
Case comDCB
ERMsg$ = "Error retrieving DCB"
Case comDSRTO
ERMsg$ = "DSR Timeout"
Case comFrame
ERMsg$ = "Framing Error"
Case comOverrun
ERMsg$ = "Overrun Error"
Case comRxOver
ERMsg$ = "Receive Buffer Overflow"
Case comRxParity
ERMsg$ = "Parity Error"
Case comTxFull
ERMsg$ = "Transmit Buffer Full"
Case Else
ERMsg$ = "Unknown error or event"
End Select

End Sub
Private Sub Text1_Change()
Te End Sub
Private Sub Text1_Change()
Text2.Text = Mid(Text1.Text, 6, 3)
Text3.Text = Mid(Text1.Text, 10, 3)
If Val(Text2.Text) > 399 And Val(Text2.Text) < 481 Then
MSComm1.Output = "BC 1" & Chr(13) 'set band to B
MSComm1.Output = "FQ 00" & Text2.Text & Text3.Text & "000,0" & Chr(13)
End If
If Val(Text2.Text) > 117 And Val(Text2.Text) < 175 Then
MSComm1.Output = "BC 0" & Chr(13) 'set band to A
MSComm1.Output = "FQ 00" & Text2.Text & Text3.Text & "000,0" & Chr(13)
End If
Text6.Text = Val(Text6.Text + 1)
Text7.Text = Text7.Text & Text2.Text & "." & Text3.Text & Chr(10)
If Text2.Text & Text3.Text = "144390" Then
'MSComm1.Output = "BCN 1" & Chr(13)
Else
'MSComm1.Output = "BCN 0" & Chr(13)
End If
If Right(Text1.Text, 2) = "tx" Then
MSComm1.Output = "MNF 0" & Chr(13)
'Text8.Text = "MNF 0"
End If
If Right(Text1.Text, 2) = "fq" Then
MSComm1.Output = "MNF 1" & Chr(13)
'Text8.Text = "MNF 1"
End If
If Mid(Text2.Text, 1, 2) = "sc" Then MSComm1.Output = "SC 1" & Chr(13)
If Mid(Text2.Text, 1, 2) = "st" Then MSComm1.Output = "SC hen MSComm1.Output = "SC 0" & Chr(13)
End Sub
Private Sub Text8_Change()
MSComm1.Output = Text8.Text & Chr(13)
End Sub
Private Sub Timer1_Timer()
Text1.Text = Inet1.OpenURL
End Sub

 

If you have any questions, please e-mail me at: mailto:walter@radiohound.com