Spinneret (Internet) controlled FM radio
Oldbitcollector (Jeff)
Posts: 8,091
I thought I would combine two fun Parallax offerings into a single project.
* Spinneret and FM Radio module.
The goal here is to have an FM radio which can be controlled from my android phone both across the room and across the world. The hardware for this project is easy, and I'll post software as we go along to help others replicate the project. See message two for project videos.
About the code:
I'm using Mike G's contest winning webserver software as the basis for this project. I've also lifted the control object from the FM Radio spin demo, and placed some of the commands into the Spinneret webserver.
Here's some of the important bits in the webserver code.
Start by configuring lines 14,15, and 16 to match your network settings...
The control page is located at http://WWW.IP.OR.NAME/hello.html
If you want to change the name, simply change line 670
Around line 730 is the code which creates the button controls. More controls could easily be added.
Around Line 700 is where I'm processing the returned data. I'm cheating a bit by examining only portion of the returned data. I've added some Parallax Serial Terminal code so that you can extend the cheat a bit by adding buttons, monitoring the terminal, then added the detected codes. I'm sure there is an elegant way to do this, but this hack works.
OBC
* Spinneret and FM Radio module.
The goal here is to have an FM radio which can be controlled from my android phone both across the room and across the world. The hardware for this project is easy, and I'll post software as we go along to help others replicate the project. See message two for project videos.
About the code:
I'm using Mike G's contest winning webserver software as the basis for this project. I've also lifted the control object from the FM Radio spin demo, and placed some of the commands into the Spinneret webserver.
Here's some of the important bits in the webserver code.
Start by configuring lines 14,15, and 16 to match your network settings...
The control page is located at http://WWW.IP.OR.NAME/hello.html
If you want to change the name, simply change line 670
if(strcomp(Request.GetName(id), string("hello")))
Around line 730 is the code which creates the button controls. More controls could easily be added.
StringSend(id, string("<form>",13,10)) StringSend(id, string("<BR><BR>Oldbitcollector's Spinneret Controlradiocontrol Radio<BR><BR>",13,10)) StringSend(id, string("<button type=submit name=radiocontrol value=1>ON</button> ",13,10)) StringSend(id, string("<button type=submit name=radiocontrol value=0>OFF</BUTTON> <BR><BR> ",13,10)) StringSend(id, string("<button type=submit value=2 name=radiocontrol>VOLUME UP</button> ",13,10)) StringSend(id, string("<button type=submit value=3 name=radiocontrol>VOLUME DOWN</BUTTON> <BR><BR>",13,10)) StringSend(id, string("<button type=submit value=4 name=radiocontrol>SEARCH</button> ",13,10)) StringSend(id, string("</form>",13,10))
Around Line 700 is where I'm processing the returned data. I'm cheating a bit by examining only portion of the returned data. I've added some Parallax Serial Terminal code so that you can extend the cheat a bit by adding buttons, monitoring the terminal, then added the detected codes. I'm sure there is an elegant way to do this, but this hack works.
pst.str(string("Cheap Input Detection:")) pst.dec(radiocontrol) pst.newline if radiocontrol == 92 or radiocontrol == 208 pst.str(string("OFF")) outa[23]:=0 FM.PowerOff
OBC
Comments
I've got some software working! As soon as I clean up the code a bit I'll post it.
Had some trouble getting signal today in my office, but you can see it working.
Another video of it actually getting signal.
OBC
Keep up the good work. You may have another Pandroa. But, yours can be called OBC Radio.
Added additional demo videos to the thread. (See message 2)
Added code and code notes for others who might want to replicate or jump off this project.
Set project as completed, but I'll likely post a revision of the code which doesn't use the "cheat".
OBC
http://hackaday.com/2011/09/26/over-the-air-fm-radio-gains-internet-control/
PE -- 3 Cheers... Hurrah, Hurrah, Hurrah!
WTG JEFF!!