Shop OBEX P1 Docs P2 Docs Learn Events
Spinneret (Internet) controlled FM radio — Parallax Forums

Spinneret (Internet) controlled FM radio

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2011-09-26 16:55 in Robotics
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
  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> &nbsp;&nbsp;&nbsp;",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> &nbsp;&nbsp;&nbsp;",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

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-09-21 15:40
    Initial Video


    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
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-09-21 18:16
    across the room and across the world.
    Cool!! I know how annoying it is when somebody changes the radio station every time I fly to Australia!!! :lol:
  • bsnutbsnut Posts: 521
    edited 2011-09-21 18:55
    That's a cool project Jeff. It would've won if it was entered into the Spinneret Contest and it would be perfect for a contest for the FM module. The bummer thing is there is no contest for the FM module and the Spinneret contest is done too. One, thing I can say is late contest entries win something.

    Keep up the good work. You may have another Pandroa. But, yours can be called OBC Radio.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-09-24 18:39
    More progress...

    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
  • Mike GMike G Posts: 2,702
    edited 2011-09-25 08:23
    Cool project, thanks for posting.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-09-26 16:46
    Somebody's getting the word out --
    http://hackaday.com/2011/09/26/over-the-air-fm-radio-gains-internet-control/

    PE -- 3 Cheers... Hurrah, Hurrah, Hurrah!
  • PublisonPublison Posts: 12,366
    edited 2011-09-26 16:55
    Thanks for the heads up, PJ!

    WTG JEFF!!
Sign In or Register to comment.