# BOCS 2way remote is now open source



## dfeller (Sep 30, 2009)

Howdy:

The response of users to our system (www.bocsco.com) has been - well - overwhelming. I've found that we at BOCS are not able to respond to every feature request as fast as we would like, and there are some really great suggestions out there from real world users.

So, we have decided to go open source on our remote controls. In fact, I've "experimented" with one user who has far exceeded my expectations and over the holidays added a huge new macro feature to the remotes. I'll have him post everything here.

Why might anyone want to do this? While many remotes are macro programmable, even using some of the JP1 tools, there are many things that just cannot be done with them. This is a unique opportunity to take full control of both the IR and wireless systems at a core firmware level and get exactly what you want - customized to your home. One of the big features here is that the RF communications are TWO-WAY. We use that to verify keypresses sent to the hub have, in fact, gone through and we use retrys to create a more solid connection. The reverse channel, could easily be modified to allow the remote to receive information back from the hub as an example.

All I ask is that you document your changes well and post back your results for the community.

Here is how it works

1) Never heard of BOCS? See the avs threads in the "Home A/V Distribution and Networking" group.
http://www.avsforum.com/avs-vb/showthread.php?p=17149193#post17149193
and the main THREAD here
http://www.avsforum.com/avs-vb/showthread.php?p=16089527#post16089527
but basically we make a whole-home distribution system that includes 900MHZ (and IR) remotes that can act locally or from across the home.

2) The programming methods and connection to the remote are described on my blog in this entry
http://myxtender.com/wholehome/?p=79

3) I've posted the core firmware files that control button functionality and how the remote does learning and programming www.bocsco.com/opensource/BOCS1450base.zip. It is written in C and very well documented. At the bottom of this post, I'll briefly describe each file.

4) Note that what is posted is not enough to compile a firmware rev - I will provide the full source after you sign a simple source agreement (I'm working one up now and will post a link to it here once I've completed it - just fill it out, sign and send it back to me at [email protected])

5) I'm available for "tech support" here, on the chat window on our website (www.bocsco.com/virtualbocs) or phone (see my signature). Note that we are not volunteering in every case to test your changes, help you debug, etc. And no guarantee of support is given beyond a basic overview of the code.

Files:
remote.c : Main remote control loop - handles keypresses, all programming modes and communication to the hub via RF
ir.c : Control IR output and multiple digit modes
remote_main.c : Main initialization and setup loop
remote_ir_scan.c : Process for doing an IR code scan
remote_ir_learn.c : Process for learning IR codes into the remote
ir_blaster.c : driver module for IR blaster subsystem, also contains methods for inserting new custom IR codes that are not already in the database
bocsmsp430.txt : Version 1450 (the latest) remote control firmware - complete and compiled. I include this as a safety measure in case you make a modification, screw something up and need to get back to a baseline!

So again, see the blog post for details, but basically, this is an MSP430 TI 8 bit microcontroller that controls an external TI 900MHz chip for communications and a UEI blaster chip for IR codes in and out. Communication is via a simple jtag/serial interface through a very common fetpro programmer.

I'll reserve a couple of posts right under this for more info to be added later and get the first participants to post here as well.

This is a big step for us - be gentle.

David


----------



## craigte (Jan 31, 2010)

I took David up on the Open Source firmware offer on the remote controls, so I wanted to share where it led. 

My BOCS experience turned out to be an awesome adventure… one that you may want to take as well!
*
The initial engagement:*
Like many who made the jump to HD and added a DVR, I was frustrated that I could not access the stored shows in my bedroom. The thought of getting a second DVR and recording the exact same shows (not to mention paying more monthly fees to Comcast) just didn’t seem ideal. After searching the Internet, I came across the BOCS unit and it seemed like a perfect fit. Not only could I watch my recorded shows in the bedroom but I could eliminate my second media box that stores all my DIVX movies (thus eliminating the hassle of keeping them synchronized). 

When my unit arrived, I quickly tore apart my media center, hooked up my unit, programmed my remotes (which are awesome because they truly were universal) and was up and running in no time flat. 

*BUT:*
After showing my wife how the RED button made the bedroom TV function just like she was in the living room and how she could watch her soaps in peace when I wanted to watch a movie in the other room… life was great…. until she started using the 2nd remote I had purchased with the living room setup. We have a cable box/DVR combo and pressing the RED button in the living room meant the TV was no longer High Definition since the BOCS remote forces the TV to a tuner channel – even in the main TV room. Obviously, all you have to do is change the TV to HDMI input, but after many attempts of explaining that when in the living room, don’t press the RED button, press the CBL button and she would be still be in HD and have access to the DVR functions - that is of course unless she was previously watching a movie using the BLUE button, then she needed to change the input and then press the CBL button. It made perfect sense to me but after a couple more times of her pressing the RED button on the living room remote “Like I do in the bedroom” she declared my latest project a failure. 

*Surprise – Surprise:*
I loved the new system and failure wasn’t an option, so I reached out to David Feller. I explained my dilemma and also added that I do software programming as a hobby and had an idea of how I could change the remote to solve my problem. I’m not sure who was crazier, me for making the request or him for agreeing to let me try. Either way, I am thankful that he took a chance and sent me the code as well as the hardware needed to modify the remote because here is what became of it:

*What I (she) wanted: *
Regardless of what room my wife is in, she wanted to push the RED button to watch her soaps. When she happens to be in the living room, this would mean pressing the RED button would cause the TV to select the HD input and make the CBL button active, regardless of what state the system was in. We have a HD-TV in the living room so when in there, she wanted her soaps IN HIGH DEFINITION!!! 

To accomplish this, I would need to setup a sequence of commands that would be sent in order with a delay between each command… hang on a second… that sounds like what a high priced Harmony remote does. Could I make the BOCS remote go into a learning mode and capture sequences easily to be “replayed”? Could I store multiple sequences and associate them to other buttons? 

*Where I ended up:*
To make a long story a little shorter, after a lot of programming, (and countless emails to David!), My BOCS remote does just what my wife wanted above. Not only that but it can now turn on my DVD player, change my TV input to DVD, turn on my surround sound system, change that input to DVD and make the DVD button active by simply pressing the GREEN button!!!

I can turn on my CD player, then my surround sound system, change the input to CD and have the AUX button that controls my surround system active, just by playing a AUX sequence!!!

If this all sounds confusing, the short version is this, I added:
· 4 new programmable buttons that will each accept up to a series of 8 commands with delays between each
· The ability to assign these sequences to the BOCS RED, GREEN or BLUE buttons – essentially letting you completely redefine what those three buttons do
· This results in a remote that can now be used in the main TV location and completely replace the need for a Harmony remote!

*You can do it too:*
If I have caught your interest… great! As a result of my success, David has decided to extend the offer to others that want to reprogram their remote. The code is well written and documented. Even with a rudimentary understanding of C++, changing remote functions is fairly straightforward. There is plenty of memory space available for more functions, and as a combination RF and IR remote with a spectacular basestation in the Xtender, it can be programmed to do just about anything. Home Automation, Security, lighting control, and of course entertainment control.

By the way, David provided excellent support and helped me through getting everything up and running.

*Want the easy way out?*
There are 3 options if you would like to take advantage of what I did (no C++ programming on your part).

1.) If you have the knowledge\tools\ability to flash your remote, I will send you the compiled file gratis.
2.) You could physically send me your remote (along with a small donation to help me save for my next BOCS unit and shipping money to get it back, say $15 total) 
3.) I have new remotes, which have the sequencing capabilities already added, that I am selling for $49, which includes priority shipping.

My email address is remoteupgrade_at_live_dot_com (it wouldn't let me post and email address so replace replace the _at_ and _dot_ and you have it) - just drop me a note to make arrangements. 

Also, if you have an idea for a good remote feature, I’m open to suggestions, as I understand the firmware pretty well now. 

Craig


----------

