Sign in   |  Join   |  Help
Untitled Page

ARCHIVED FORUM -- March 2012 to February 2022
READ ONLY FORUM

This is the second Archived Forum which was active between 1st March 2012 and 23rd February 2022

 

Using a raspberry Pi as a DIY equivalent to Logitech Harmony

rated by 0 users
This post has 53 Replies | 6 Followers

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp Posted: Tue, Mar 26 2019 2:38 AM

I have remote control envy. I have loved the B&O remotes since childhood, when a friend had a BeoMaster 5000 with the MCP. The Beo4 is pretty, but the BeoRemote 1 is damn sexy. The problem is I can't justify the B&O source hardware to control it with. I looked at the Lintronic solution, but it seems 1998.

I looked at Neeo, but they recently were bought out, and the remote didn't have a play button. I have a logitech harmony with hub (no screen) and that has good ergonomics, but is not as pretty as the B&O.

On a recent search for other stuff I came across OpenHab, Lirc and realized that Raspberry Pi has CEC capabilities via its built in HDMI port. If you use the right IR receiver for the Pi, there is a Lirc config for Beo4. That made me realize it should also be controllable via Beoremote One in IR mode. This is seeming do-able.

Has anybody tried this before?

Is there a price list for the Beo Remote One - It seems we don't have a B&O dealer in the SF Bay area to ask, I'm trying to figure if the ones on ebay are overpriced or not?

 

 

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Sun, May 5 2019 1:30 AM

As an update to anyone who was interested, I now have this working, and it was surprisingly simple.

The net result is I have:

 

  • An Raspberry PI running Linux with OpenHab2 as the main controller.
    • It is connected to my receiver via HDMI, to control the other devices
    • It controls a Vizio TV, Sony PS4 and Fire TV Cube via HDMI-CEC commands
    • It controls the receiver via IP with an existing binding for openhab
    • It controls a sonos connect (non amp) connected to the receiver in the living room
    • It controls a another pair of sonos connects driving 2 pairs of Beolab 4000's for the office and bedroom
    • It controls Hue, Lutron Caseta & Zwave lighting via their hubs, and a zwave USB stick
  • Connected via USB to the PI is an Arduino Nano, which is hidden in the back of a B&O IR eye
    • This listens to B&O IR commands and translates them to serial comms to the PI via the Arduino's built-in USB port
    • A serial binding in openhab (bindings in openhab are modules to interface to different systems) will detect the incoming messages, and then invoke rules to process the messages. The rules are script based and enable limitless capabilities as you can have state, conditionals, timers etc.
    • A relay is connected to one of the GPIO & ground pins of the Pi to toggle a 5v supply to my 3x Beolab 6000's for L,R,C & 2x Beolab 4000 for surround to force them to be on when using multi-channel sources. This means they don't keep turning on and off when there is no surround effects for a while.

 

By pressing the TV + "Fire TV" selection on the BeoRemote One, it will turn on the FireTV, Receiver & TV, and set the FireTV as active source toggling the right inputs. All the remote buttons then work as expected.

This is also mapped to the DTV button on a Beo 4 (with Go button). As the remote signals have a source ID, both remotes use a different ID, which means I can map the Beo4 a bit differently. The Arrows + Go act as a direction rather than Play, FF, Rewind, so that it works well with the all the devices that now expect direction + select functionality.

I also have it mapped to control my Sonos & Hue lighting for respective modes on both remotes.

Most of the other buttons work as expected, including vol depending on source being used. Pressing the standby button will shut everything down as expected.

 Images: https://archivedforum2.beoworld.org/media/p/279066.aspx, https://archivedforum2.beoworld.org/media/p/279065.aspx

HDMI CEC binding for openhab2: https://github.com/samsp99/openhab2-addons/tree/hdmi-cec/addons/binding/org.openhab.binding.hdmicec

Arduino IR receiver: https://github.com/samsp99/Beomote

I can share the openhab configuration and rules if anybody is interested. 

TWG
Top 75 Contributor
Posts 1,672
OFFLINE
Gold Member
TWG replied on Sun, May 5 2019 7:52 AM

Hi and welcome to Beoworld :)


nice project, keep going! There are other members here on Beoworld with similar projects and such projects are a great contribution to the Bang & Olufsen world.

Maybe these threads will help you, too:

https://archivedforum2.beoworld.org/forums/t/11816.aspx

https://archivedforum2.beoworld.org/forums/t/29362.aspx

 

Beoremote one BT price: 260,- Euro (2019)

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member
crossbytje replied on Mon, Jul 29 2019 12:30 PM

I'm very interested in this setup!

I wondered if this would fit my needs. Maybe some advice would be welcome.

I'd like a good 4K TV/screen, I'm currently only looking to use it as a screen without sound/apps/whatnot. The main source would be a computer (probably a mac mini, maybe something windows/linux based if that allows better integration) running a kodi application for watching series and movies. In the future, I may start using Netflix too, but for now, I'm ok with my own personal content on the computer.

I want a 5.0/5.1 setup, using at least active speakers for the fronts (looking out for some used beolab 9s) and maybe also some lab 3s for the rears. (Currenly using an old amp and some Bose cubes. Replacing the rears would require upgraded cabling and power supply to be added in the ceiling.)
The speakers should be used for watching movies/series, but also for playing background music, preferably in sync with other airplay speakers in the house.

I currently have an older macbook pro running kodi and itunes, connected to my ancient LG tv. The computer is always on, and itunes is always running s.t. I can just press play on my iphone remote app for itunes. There is the old amp and the Bose speaker set. For watching series, I'm using 3 remotes (the horror!): power on the amp, power on the tv, and control the mac using an aluminium apple remote. For listening to music, I power on the amp and use the iphone to control the itunes on the macbook.
This setup works fine for now. Powering up an airplay speaker in the kitchen makes it automatically join the airplay music of the living room.

In the future (when a newer tv and a set of beolab 9s are joining the party), I'd like to get rid of all remotes but one, and if this one could be a beoremote one, that would be ideal!
I suppose I'll need a fancy amp/pre amp for connecting the speakers? Or can active speakers be connected to a mediacenter pc directly? (The main windows computer in the household has 5.1 3.5mm jack outputs for speakers... Or are beolabs not to be connected to such outputs?)

Now, would it be possible to have the beoremote one to control the kodi application on the computer, like: press TV on the remote and automatically power up the screen, (pre)amp+speakers, wake the computer and start the kodi app, after which arrows/play/pause/etc works on the kodi app?

Would it be possible to map a press on the MUSIC button to turn on the amp and speakers and start playing a specific playlist on itunes? Or, if the itunes part is impossible, simply just power up the amp and speakers s.t. I can press play (or choose different playlists) on my iphone remote app?
(Is there any way of choosing playlists on the remote, be it even as in selecting one of 3-4 sources which could correspond to my main 4 playlists? (i'm only ever using 4 specific lists and don't need their names on the remote, something simple like 'list1', 'list2' would already be enough!))

(Power everything off using the standby button on the remote should be possible I suppose?)

I guess most pre-amps nowadays have airplay support too, so the itunes computer could also be a separate unit that simply airplays to the (pre)amp and the other airplay speakers without intervention of the beoremote (but this would require speakers to be set to LINE IN, hence no automatic on/off trigger. Or maybe such a trigger can be engineered from a triggered output on the pre-amp?).

So, a lot of questions/advice needed. I am tech savvy (did computer science at uni), so a bit of programming is no problem. I have however no experience with raspberry pies or arduinos yet. 
What hardware would I need to get my ideal system working?

About your setup: How is the CEC working? You are using a receiver to relay the CEC controls from the PI to the respective devices? Speakers are connected to the receiver?

Thanks a lot for the info and your input! I've only just discovered your post and it finally looked possible to achieve my ideal setup.

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Mon, Jul 29 2019 11:37 PM

Inline

crossbytje:

I'm very interested in this setup!

I wondered if this would fit my needs. Maybe some advice would be welcome.

I'd like a good 4K TV/screen, I'm currently only looking to use it as a screen without sound/apps/whatnot. The main source would be a computer (probably a mac mini, maybe something windows/linux based if that allows better integration) running a kodi application for watching series and movies. In the future, I may start using Netflix too, but for now, I'm ok with my own personal content on the computer.

You can install Kodi on a Raspberry Pi, or alternatively install OpenHab on the PC. I'd think about using a separate device that will handle the 4k presentation and has all the services on it. Once you start wanting to watch netflix, amazon prime series etc having to go via a browser is a pain. Apple TV or a FireTV device would be better (unless the stick has changed in recent generations, you can't connect it via ethernet only wifi, so I'd suggest the cube instead).

I want a 5.0/5.1 setup, using at least active speakers for the fronts (looking out for some used beolab 9s) and maybe also some lab 3s for the rears. (Currenly using an old amp and some Bose cubes. Replacing the rears would require upgraded cabling and power supply to be added in the ceiling.)
The speakers should be used for watching movies/series, but also for playing background music, preferably in sync with other airplay speakers in the house.

I currently have an older macbook pro running kodi and itunes, connected to my ancient LG tv. The computer is always on, and itunes is always running s.t. I can just press play on my iphone remote app for itunes. There is the old amp and the Bose speaker set. For watching series, I'm using 3 remotes (the horror!): power on the amp, power on the tv, and control the mac using an aluminium apple remote. For listening to music, I power on the amp and use the iphone to control the itunes on the macbook.
This setup works fine for now. Powering up an airplay speaker in the kitchen makes it automatically join the airplay music of the living room.

The key here is to ensure that there are Bindings for the devices you want to control, or you can hack it together via REST calls etc. Apple doesn't tend to be very open, so I'd check the openhab forum for help there. If openhab can control it, then my part of the solution enables it from a B&O remote.

In the future (when a newer tv and a set of beolab 9s are joining the party), I'd like to get rid of all remotes but one, and if this one could be a beoremote one, that would be ideal!

I suppose I'll need a fancy amp/pre amp for connecting the speakers? Or can active speakers be connected to a mediacenter pc directly? (The main windows computer in the household has 5.1 3.5mm jack outputs for speakers... Or are beolabs not to be connected to such outputs?)

The older beolab 4000, 6000 & 8000's that I use all have line-in sockets on the back. Sounds Heavenly will make cables for other devices. The problem with using a PC output directly is that its usually at a high level, and doesn't seem to run as well when volume is set to 10% etc.

Now, would it be possible to have the beoremote one to control the kodi application on the computer, like: press TV on the remote and automatically power up the screen, (pre)amp+speakers, wake the computer and start the kodi app, after which arrows/play/pause/etc works on the kodi app?

Would it be possible to map a press on the MUSIC button to turn on the amp and speakers and start playing a specific playlist on itunes? Or, if the itunes part is impossible, simply just power up the amp and speakers s.t. I can press play (or choose different playlists) on my iphone remote app?
(Is there any way of choosing playlists on the remote, be it even as in selecting one of 3-4 sources which could correspond to my main 4 playlists? (i'm only ever using 4 specific lists and don't need their names on the remote, something simple like 'list1', 'list2' would already be enough!))

(Power everything off using the standby button on the remote should be possible I suppose?)

The TV & Amp are easy. The harder part is the apps that you want to use. It depends on the integration between your control software and the apps. For this reason using a device may be easier. For example with FireTV, if you enable adb debugging, then you can send any sequence of keys, or start apps as required. Its insecure though in that any device on the LAN could send those messages.

I guess most pre-amps nowadays have airplay support too, so the itunes computer could also be a separate unit that simply airplays to the (pre)amp and the other airplay speakers without intervention of the beoremote (but this would require speakers to be set to LINE IN, hence no automatic on/off trigger. Or maybe such a trigger can be engineered from a triggered output on the pre-amp?).

So, a lot of questions/advice needed. I am tech savvy (did computer science at uni), so a bit of programming is no problem. I have however no experience with raspberry pies or arduinos yet. 
What hardware would I need to get my ideal system working?

 

Unless you are wedded to a beoremote one, I'd start with a logitech harmony. There are some good deals on the remote+hub combo for the remote that doesn't have light switch buttons. They have done the hard work for most device support.

If you need beoremote support, you'll need a Raspberry Pi, a B&O IR eye and an arduino.

About your setup: How is the CEC working? You are using a receiver to relay the CEC controls from the PI to the respective devices? Speakers are connected to the receiver?

Thanks a lot for the info and your input! I've only just discovered your post and it finally looked possible to achieve my ideal setup.

I have my speakers connected via line-in to the reciever's pre-outs. I have HDMI devices connected to the TV directly and the receiver. It works as well as the devices can over CEC (device support is spotty). Devices are connected directly to the TV so that 4k content works - I haven't upgraded the receiver yet, and am reluctant as they'll change the standards as soon as I do.

I also have the 8pin din hooked up to a USB power supply via a relay controlled by an I/O pin on the pi. This is so I can keep the surrounds & L/R powered on when watching TV. While they can detect a signal, there is a small delay, and if the audio is primarily the center channel then it they can time out (with a click) and detect again going through a series of on/off cycles.

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

Alright! This already clears some things up for me.

I looked a bit deeper into the openHAB and it seems a very powerful tool. I guess that once configuration is done, it is a matter of defining a set of actions/rules to be called when certain remote functions are pressed?

I'll see if I can manage to program a testcase, currently without the remote part, just running on a networked computer. If I can get the kodi and itunes control working, then I suppose the remote side of the deal should not be too hard either (probably using a bit of your help on hardware and integration). Updating tv and speaker hardware will then probably also be a matter of adding a couple of lines of code to the system?

I'm still wondering though, how controllable is the beoremote itself? Can you easily edit the list items on the screen? What about the mybuttons?
Is it the same for a Beo4? I may be able to get my hands on an older Beo4 to test the IR part of the solution later on.

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

Good news!

I got my openHAB installation up and running and am already able to control the Kodi application running on the 'mediacenter' mac. The itunes control was a bit of a pain, but I finally got it to work. I can start playlists from within the openHAB sitemap and airplay control looks within reach too.

That all on separate macs in my network (currently the openHAB is running on my main laptop, kodi and itunes on the older mac connected to my tv).

I think I'm ready for a beoremote connection. Therefore I will need a more technical how-to I suppose on the components and connections. 
Is any B&O IR eye found on ebay suitable, or should I look out for a specific type/model. I just googled 'TSOP7000' and this is a really cheap IR receiver. Is this as good as a B&O eye?

What about the Arduino? There is no 'mini' type on their site. How to assemble these together? Does this need a lot of configuring?

 

As I'm going through the beoremote one manuals, it looks possible to add several music sources to the remote, if these can be renamed, I would be able to select playlists directly through the remote then. I guess the openHAB is able to receive and interpret these commands s.t. different actions can be taken.

 

As I'm thinking about it now, would all this work over bluetooth too? This way the IR receiver would not be needed. Possible problem I see here is that the remote would know it's not somewhere in its own B&O ecosystem, and maybe it refuses to work? I did read here somewhere a while back that a BR1BT can be paired to a mac and it can control volume and tracks in itunes. Not sure if other buttons on the remote could be interpreted using openHAB, or if selecting different sources on the remote would indeed trigger different events...

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Wed, Jul 31 2019 7:54 PM

I found the TSOP works, but doesn't have great range. The B&O eye is amazingly sensitive - that's what gives the remote the ability to bounce off 6 walls and still work. You don't need to point in any direction. 

I also have the I2C on the EYE working so the buttons get sent as specific address/button codes by the arduino.

I have the "ELEGOO for Arduino Nano V3.0" from amazon as my arduino. If you can find one with a micro USB connector that may be better. With a bit of carving away at a usb mini cable's plastic sleeving, i have the arduino fitting in the back of the eye's case. The usb then connects to a Pi (or PC/mac) in your case and acts as a serial port.

I think I shared the code for the arduino, but will send it to you. It sends back a string of A:BBB:CCC, where A=link 0/1, BBB=Address of device from remote, and CCC is the button code. That can then be directly read from a serial binding and translated into actions in OpenHab scripts. I will send you my script as an example. I have a tweaked version of the serial binding that listens for /n, so is faster at getting messages.

Yes you can rename any of the sources from the remote. They will then map to addresses and button codes. The nice thing is the BR1 has a different address from beo4 so you can special case the dpad from the "go" version of the beo4 and have the buttons do what you want.

I have not gotten bluetooth pairing to work to the PI. if you can get it working over bluez, I'd love the info. Over IR it works well enough for same room usage.

I will send the files via PM when I get home tonight.

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Wed, Jul 31 2019 8:00 PM

My buttons can be set to map to specific sources. So under TV i have FireTV, PS4, TV and BlueRay, but have the nearest mybutton mapped to the FireTV action.

The combo of renaming inputs + Openhab scripts is really powerful, and gives the ability to go beyond what B&O does, and have a really flexible system, that would be simple enough for family members to use (Partner Acceptance Factor).

Eg, I use the color buttons to toggle on/off different Sonos ZP90's connected to beolabs in other rooms when music is playing.

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

Great!

I've looked into the Bluetooth part for a couple of hours now, but there seems to be very little support for bluetooth devices in het openHAB community and it mainly focusses on presence detection. Rather strange.

I tried to see if I could get readings from a connected bluetooth headphone, but wasn't able to with the standard bluetooth binding. I guess IR will be the way to go, although it feels like a workaround.

I'll start gathering the necessary hardware. Any B&O IR eye will do? (Or maybe I should try and open up my beolit12 to get the IR eye from there... I read here somewhere that someone succeeded in doing this.)

Exciting times!

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

So, I have an eye coming my way and an order for an arduino is being made. I'll pick up a new Beoremote one next weekend too.

I checked some arduino tutorials and based on the code you posted on github, I think I can get it working. Will have to look a bit further into the right pin connections.

I'd appreciate your input on the openhab configuration and rules files. Not sure yet how to communicate with the arduino from within openhab either, is there an easy binding for this? I guess your openhab config files might explain this further.

 

So as I reread this thread, you mainly control all your devices over CEC? You say in a previous post that your hdmi devices are connected directly to your tv and the receiver? Does this mean that they are physically linked to both the tv and the receiver, or is one of these two responsible for forwarding the CEC commands received from openhab?

(The link you posted to the CEC binding is dead by the way.)

 

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Sun, Aug 4 2019 6:59 AM

Arduino to Pi is simple - the USB connection acts as a USB serial port, so I use the serial binding in OpenHab to listen. I customized the code to listen for returns, so it doesn't have to poll as much. It along with a diagram of the connections inside the eye are in your inbox.

CEC has bus semantics. Devices only have one connection, but once on the bus, you can talk to regardless of what its connected to. So the Pi can be connected to the reciever along with some sources, and other sources direct to the TV, as long as the tv and reciever are connected, you can talk to all of them. I connect 4k sources to the TV as my receiver can't handle 4k video.

 

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

Mail received, thank you very much!

I'll get my stuff going once my components arrive. Holidays are over however, so I'll have to use my spare time in the weekends from now on.

 

Good to know about the CEC bus semantics. It explains everything.

Thanks again for your kind help! I'll keep you guys posted on my progress.

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

In the meanwhile I have acquired a BeoRemote One BT and an IR eye, still awaiting my arduino hardware to hook everything up.

I wondered, in your setup, the specs of the AV Receiver are not too important? 4K devices are directly connected to the TV, and sound is fed into the receiver separately?

Would you say this is 'suboptimal'? I wondered what the up/downside to this approach is. Is there a reason why you (or me) would want a newer receiver to connect sources directly to that receiver?

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

steve1977
Top 100 Contributor
Posts 911
OFFLINE
Bronze Member
steve1977 replied on Mon, Aug 12 2019 7:04 AM

Wow! I have no idea how I missed this thread. You have no idea how much I'd love to use a B&O remote (BROne or Beo4) as remote to use for my non-B&O television. I love my B&O remotes and would love to use them more.

I have a spare Raspberry and could give it a try. It has an IR sensor on-board and also a bluetooth dongle via USB. A few questions to get me started? Really appreciate your help and am sure this "project" will not be an easy one...

1) Does this work with either IR or bluetooth? While I don't have a bluetooth version of the BROne, i'd consider to buy one for this purpose. Assume bluetooth would be better to use than IR as it is the more modern technology and allows better connectivity?

2) Would this allow me to turn on a non-B&O television with the on/off button? And change volume?

3) Would the TV/DTV/etc. keys allow me to switch between the different HDMI sources? One of the HDMI sources will be my Raspberry (with the remote attached to it), others will be Apple TV and there may be a third HDMI port?

4) Would this allow me to control programs on the RPi (when HDMi of the RPi is selected)? And then also allow me to control the ATV when the HDMI of the Apple TV is selected? This would mean that the RPi sends a signal over CEC to the TV that then gets send via CEC to the Apple TV? Seems magic and is this really how it works?

5) Does it allow long-click to control the Apple TV?

 

This is really exciting. Hope you can help me figure this out! Thanks in advance!

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

Hi,

A few answers:

1) it's IR only, the bluetooth part is not well supported in the openhab community, but I think the remote limits it's own functions when connected to a non-B&O device. Once connected to a mac/iphone, the only things that work are basic listening buttons (play/pause/next/prev/volume and on/off). I couldn't find a way to interpret other buttons on my mac and I tried almost all remote/keyboard mapping tools out there.

2) The IR sensor on your pi will not support B&O frequencies, so it can't receive commands from the remote, nor can it send commands to B&O tech. It may however send IR signals to your non-B&O tv, so using a B&O IR eye as a receiver, you may get it working. Once the receiving part is done, you can receive all signals and map them to whatever you like.

3-4) if your tv supports receiving network commands or CEC commands, this should be possible. I have not tried it out yet.

5) no idea, but if you can map everything to everything, a press on e.g. the yellow button could trigger an event for such long presses.

 

I just received my Arduino board and am trying to get it up and running!

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

steve1977
Top 100 Contributor
Posts 911
OFFLINE
Bronze Member
steve1977 replied on Thu, Aug 15 2019 3:49 PM

Got it, thanks for the update.

I already have an IR eye, but have no idea how I'd connect this with the RPi?

My TV supports CEC commands, so it seems this may be doable

What do you need the Arduino board for?

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

Don't know if the pi can do it on its own, but the arduino connects to the IR eye and relays the commands to the openhab server, which in its turn controls the TV (and other devices). 

I would expect a pi to be able to do the work of the arduino on its own, but have no experience in this field. It may be a matter of having the necessary libraries available...

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Fri, Aug 16 2019 10:58 PM

The reason to use an arduino / Pi combo is so that the pi doesn’t need to be doing realtime monitoring of the signal from the ir reciever/eye. That is a full time job, where you want to be as "close to the metal as possible", and an arduino does it well. The arduino sketch (code) is basically a tight for loop, waiting for IR pulses, and then timing them. Doing this with a Pi would be more tricky as it would need to be tied to an interrupt, and the Pi has other higher-level functions to run. At ~$8 for an arduino, its a simplicity trade off that is well worth while. Also as you can fit an arduino nano in the back of a b&o eye, and just have a usb cable coming out, its aesthetically elegant. The USB from the arduino maps to a serial over USB device, so its really easy to read the results from the Pi (or other host device).

You don’t technically need a raspberry pi - you could do all of this with a PC, Mac or NAS box. A Pi is a convenient host, and is cheap (~$50 with PSU & case) and has hdmi/CEC if you need it. It can also interface to IR boards, and general purpose I/O pins which is useful for say forcing a power-on of beolab speakers.

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Fri, Aug 16 2019 10:58 PM

[duplicate]

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member
crossbytje replied on Sun, Aug 18 2019 10:02 AM

I got to experiment a bit further with my remote and the openhab server, and I'm impressed with what I got so far.

It was a bit of searching and getting into details setting up the IR receiver part, but using Sam's help and code, it all came together. Once the openhab server can receive commands, it's all a matter of 'programming' the right actions to follow. The openhab system is very powerful, and allows much more than simply executing commands based on received codes. In the future, I might see what else I'll build into the system. (There's e.g. easy presence detection possible based on whether or not your smartphone is in the neighborhood, which could also trigger stuff to happen in your house.)

I currently have my BeoRemote One control both itunes and kodi on an older mac. I even have the state of the system relayed back to the arduino, so the leds on the B&O IR eye are showing an active source, or blinking when signals are received.

My music sources map to different playlists on itunes, and the kodi app is present as a TV source. I have a playstation too, which could also be mapped as a TV source. It all integrates nicely into the BeoRemote, with the right names and the right options.

So far, I'm still using my old receiver/amp, which is too old to control with anything else than its own IR remote. The same holds for my TV. So I'm still bound to their remotes, but I'll have them upgraded later this year I guess.
I did get rid of my itunes remote app on the iphone. The BeoRemote nicely controls tracks, playlists, and volume of both the main zone and the airplay speakers separately. If my beolit 12 is plugged into the mains, I can even power it up using the 'oldskool' beo4IR function of the BeoRemote.

I'm happy with what I've got so far, and will be even more pleased once I get rid of the old equipment. The Holy Grail of one stylish remote to 'control them all' is finally here! 

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Sun, Aug 18 2019 6:58 PM

crossbytje:

So far, I'm still using my old receiver/amp, which is too old to control with anything else than its own IR remote. The same holds for my TV. So I'm still bound to their remotes, but I'll have them upgraded later this year I guess.

if you are using a raspberry pi, then you could use an IR board to send the signals to your TV and amp. The Lirc binding in openhab enables you to send individual IR codes. Each remote configured in Lirc becomes a device you can call from openhab. The Lirc database is massive - http://lirc.sourceforge.net/remotes/ so is likely to have what you need.

 

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

No pi for the moment. My openhab is running on the mac which is always on anyways. Surely, a pi would consume less energy, so in the long run I might 'upgrade'.

But is the arduino not capable of sending such IR signals too? I may look into this. In my setup however, the tv is the only visible thing and all gear is placed in a cupboard with a semitransparent mirrored front. sending IR signals from within this cupboard to the receiver is no problem, but the tv is out of reach, unless I wire a diode to its receiving eye.

I'm still deciding which devices to use for 4K content when such a TV arrives. Not sure whether the 2011 MacBook Pro will suffice, but we'll see then.
For the audio part, I'm thinking about a Marantz SR5013, as it has both pre amp and amp connections for combining active B&O speakers with passive rears. I'll need a source for sending the power ON/OFF signal to the B&O speakers too, but maybe the arduino could do this too. Is that a simple 5V signal? (If so, the code would be the same as for the LEDs on the IR eye.)

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Sun, Aug 18 2019 7:37 PM

crossbytje:

In the meanwhile I have acquired a BeoRemote One BT and an IR eye, still awaiting my arduino hardware to hook everything up.

I wondered, in your setup, the specs of the AV Receiver are not too important? 4K devices are directly connected to the TV, and sound is fed into the receiver separately?

Would you say this is 'suboptimal'? I wondered what the up/downside to this approach is. Is there a reason why you (or me) would want a newer receiver to connect sources directly to that receiver?

The only reason I connect the 4k sources directly to the TV is that my receiver is only 1080p, but the TV is 4k. I'm being cheap and not replacing the receiver as it has the pre-out connectors i need for the Beolabs, and newer receivers don't have that unless you step up to the $1000 range. So its an economical decision that doesn't really compromise functionality. 

 

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Sun, Aug 18 2019 7:50 PM

crossbytje:

It was a bit of searching and getting into details setting up the IR receiver part, but using Sam's help and code, it all came together. Once the openhab server can receive commands, it's all a matter of 'programming' the right actions to follow. The openhab system is very powerful, and allows much more than simply executing commands based on received codes. In the future, I might see what else I'll build into the system. (There's e.g. easy presence detection possible based on whether or not your smartphone is in the neighborhood, which could also trigger stuff to happen in your house.)

The real power in the openhab scripts is this ability to listen to events and trigger scripts. It doesn't just have to be remote codes. In my house there are different ways to control some of the sources. For example, I have a Sonos connect in the living room connected via optical sp/dif to my receiver. The Sonos can be activated by its own app, or other systems. As it needs the receiver to be on and switched to the right source to be heard, I have a rule listening to the play state of the sonos. When it starts playing, the rule will turn on the receiver and set the input and correct volume. It will also set a state variable in the openhab configuration so it knows what activity is running. The rules for the B&O remote use that to direct the button actions to the right source. The remote(s) are (mostly) stateless, and will control whatever the current source is. 

Another example, is that if the B&O remote is used to turn on the sonos in the living room, it looks to see if either of the other sonos in the house are playing - if so it joins those groups, if not resumes what it was playing last.

 

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Sun, Aug 18 2019 8:08 PM

My newest discovery is the Lutron Binding in openhab. In conjunction with the Caseta Pro hub (needs to be the Pro version), it enables control of Caseta, RA2 etc devices, but also listening to Pico remotes.

Pico remotes are sized to go in a Decora switch plate, or be used as a wireless remote. So if you want the clean home automation feel, you can mount them on the wall, either as part of a gang of switches, or fake up your own gang with them.

Each button on the remote becomes its own switch in openhab, so you can have them do what ever you want via the rules. If you want a button to switch audio to a specific track, dim the lights, close the blinds, and lock the door you can do that.

The labels on the buttons of the Pico remotes in this case are just labels, they don't affect what you can do with them. You can rub the labels off with a plastic spludger if you want. You can also order custom printed remotes direct from Lutron.

If you want that crestron-like functionality and have some coding skills, you can do it without having to take out a second mortgage. 

 

MadHouseINC
Not Ranked
Posts 6
OFFLINE
Bronze Member

Thanks god i found this post, i was about to spend a fortune in another solution that i think at the end it will be even less optimal than this one.

Could you please send to me also the files samsp? it will be highly appreciate it.

 

One question, how do you connect the B&O IR eye to the nano board? could you share a picture of that?

Thanks a lot!

 

B&O IR eye receiver and Nano board V.3 on the way already  :)

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

Hi,

 

I sent you a bunch of files that should get you on your way. Part of the solution is the arduino board that receives the IR signals, the other part is the openhab server that interprets codes and executes appropriate rules controlling your devices.

A bit of programming experience will help a lot.

 

Enjoy! 

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Mon, Nov 25 2019 9:40 PM

Did the files that crossbyte sent help.

The essence of the solution is to use a raspberry pi (rpi) with openhab as the brains of the system. Openhab is a framework for writing home automation systems. you define a set of bindings/things/items which represent the devices and state/commands for those devices.

Beo remote signals can be intercepted and used a set of state data that can trigger rules. the rules can interpret the data from the remote signal, and then send commands to devices such as switch input, play or key left.

B&O remotes use their own frequency, because they are b&o who have to be different. It also uses a pulse width system which needs real-time processing system. Rather than trying to do that with the RPI, my solution uses a small arduino to process the signal, using a b&o eye as the receiver. the arduino is small enough to squeeze in the back of the eye’s case. it then connects to the RPI over usb, which can supply the power, and appears as a serial port. the arduino can handle the IR, and the i2c used by the buttons on older versions of the eye.

MadHouseINC
Not Ranked
Posts 6
OFFLINE
Bronze Member

Thank you very much guys for all your help, I didn't have time to check the files yet but quite sure it will help me a lot, most probably until next month I won't be able to play with it and start testing.

I got already in my hands the raspberry pi, the Arduino Nano V3, and the B&O IR eye same as samsp has, so hopefully I will make it work. The only difference with samsp is I won't have connect the raspberry through HDMI, the intent is to send through network all the comands received from the beo4 to my fire TV stick and to my Sonos mainly, in a later stage I will try to control also my Fibaro home automation with the remote, so let's see how it goes, I will keep you updated.
Once again, thanks!!
Hyponx
Not Ranked
Posts 26
OFFLINE
Bronze Member
Hyponx replied on Thu, Apr 16 2020 6:54 PM

Hello gents,

Stumbled upon this post a few days ago and it's been a big help.

I've got a Pi4 here now and am looking to get a nano + IR Eye in the near future. Overall my system is very similar to yours.

Could you please also send the files to me? I've noticed that the github link is not working anymore either.

 

Thanks!

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

I sent a mail through the forum, if you answer that, I'll have your address and will reply with the files attached.

 

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

Hyponx
Not Ranked
Posts 26
OFFLINE
Bronze Member
Hyponx replied on Thu, Apr 16 2020 9:27 PM

Thanks for the very quick response! I've sent an email back to you.

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Thu, Apr 23 2020 1:25 AM

Thanks to crossbytje I have an Arduino Nano running and reporting back IR codes with GND/5V/IR Signal connected (see https://archivedforum2.beoworld.org/forums/p/16023/138995.aspx for wiring).

I have an IR eye with a 5 wire connection - the other two are TX/RX I believe - would like to get them hooked up. Right now I don't have the eye LEDs or local buttons responding - any idea on how to make that happen? Not sure of what protocol is going on via TX/RX.

 

--- Miniterm on /dev/tty.usbserial-14310  115200,8,N,1 ---

--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

initialized

0:160:96

0:160:100

0:160:50

0:160:53

0:160:67

0:160:202

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Thu, Apr 23 2020 3:12 AM

I have the receivers that use I2C (they are labelled with timer, vol, play/stop). You can supposedly use commands with the I2c device, a PCF 8574T, which is a TTL expander, to set pins for input or output. I have only gotten output to work - aka reading the buttons.

My wiring is: viewed from screw side of connector of IR puck:

Gnd, +5V, IR -> D3, SDL -> A4. SCL -> A5.

 

---- Arduino code ---

#include <Commands.h>

//#define PCF8574_LOW_MEMORY
#include <pcf8574.h>

#include <Beomote.h>

#include <Wire.h>

PCF8574 PCF_20(0x20);
uint8_t lastButtons=0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(57600);
  Serial.println("initialized");
  Beo.initialize(3); // I/O pin for the Eye IR input
}
int mode =0;

void loop() {
  // put your main code here, to run repeatedly:
  BeoCommand cmd;

  if (Beo.receive(cmd))  {
    // Serial.print("Link:");
    Serial.print(cmd.link);
    // Serial.print(", Address:");
    Serial.print(":");
    Serial.print(cmd.address);
    // Serial.print(", Command:");
    Serial.print(":");
    Serial.println(cmd.command);
    //    Serial.println("");
  }
  else
  {
    uint8_t value = PCF_20.read8();
    uint8_t buttons = value ^ 0xFF;
    // Capture state, then act when buttons released
    if (buttons !=0) {
      lastButtons = buttons;
    } else if (lastButtons != 0) {
      
      Serial.print("0:254:");
      Serial.println(lastButtons);
 
      lastButtons=0;
    }
  }
}
---- PCF8574/library.prperties -----
name=PCF8574 library
version=0.9.0
author=Reef
maintainer=Renzo Mischianti <renzo.mischianti@gmail.com>
sentence=Arduino/ESP8266 library for PCF8574
paragraph=Use i2c digital expander with Arduino and ESP8266. Can read write digital values with only 2 wire (perfect for ESP-01).
category=Sensors
url=https://github.com/xreef/PCF8574_library
architectures=*
---- pcf8574.cpp ----
//
//    FILE: PCF8574.cpp
//  AUTHOR: Rob Tillaart
//    DATE: 02-febr-2013
// VERSION: 0.1.02
// PURPOSE: I2C PCF8574 library for Arduino
//     URL: 
//
// HISTORY:
// 0.1.02 replaced ints with uint8_t to reduce footprint;
//        added default value for shiftLeft() and shiftRight()
//        renamed status() to lastError();
// 0.1.01 added value(); returns last read 8 bit value (cached); 
//        value() does not always reflect the latest state of the pins!
// 0.1.00 initial version
// 

#include "PCF8574.h"

#include <Wire.h>

PCF8574::PCF8574(int address
{
  _address = address;
  Wire.begin();
}

uint8_t PCF8574::read8()
{
  Wire.beginTransmission(_address);
  Wire.requestFrom(_address, 1);
#if (ARDUINO <  100)
   _data = Wire.receive();
#else
   _data = Wire.read();
#endif
  _error = Wire.endTransmission();
  return _data;
}

uint8_t PCF8574::value()
{
  return _data;
}

void PCF8574::write8(uint8_t value)
{
  Wire.beginTransmission(_address);
  _data = value;
  Wire.write(_data);
  _error = Wire.endTransmission();
}

uint8_t PCF8574::read(uint8_t pin)
{
  PCF8574::read8();
  return (_data & (1<<pin)) > 0;
}

void PCF8574::write(uint8_t pinuint8_t value)
{
  PCF8574::read8();
  if (value == LOW) 
  {
    _data &= ~(1<<pin);
  }
  else 
  {
    _data |= (1<<pin);
  }
  PCF8574::write8(_data); 
}

void PCF8574::toggle(uint8_t pin)
{
  PCF8574::read8();
  _data ^=  (1 << pin);
  PCF8574::write8(_data); 
}

void PCF8574::shiftRight(uint8_t n)
{
  if (n == 0 || n > 7 ) return;
  PCF8574::read8();
  _data >>= n;
  PCF8574::write8(_data); 
}

void PCF8574::shiftLeft(uint8_t n)
{
  if (n == 0 || n > 7return;
  PCF8574::read8();
  _data <<= n;
  PCF8574::write8(_data); 
}

int PCF8574::lastError()
{
  int e = _error;
  _error = 0;
  return e;
}
//
// END OF FILE
//
--- pcf8574.h -----
//
//    FILE: PCF8574.H
//  AUTHOR: Rob Tillaart
//    DATE: 02-febr-2013
// VERSION: 0.1.02
// PURPOSE: I2C PCF8574 library for Arduino
//     URL: 
//
// HISTORY:
// see PCF8574.cpp file
// 
#ifndef _PCF8574_H
#define _PCF8574_H

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

#define PCF8574_LIB_VERSION "0.1.02"

class PCF8574
{
  public:
  PCF8574(int address); 

  uint8_t read8(); 
  uint8_t read(uint8_t pin); 
  uint8_t value();  

  void write8(uint8_t value); 
  void write(uint8_t pinuint8_t value); 

  void toggle(uint8_t pin);
  void shiftRight(uint8_t n=1);
  void shiftLeft(uint8_t n=1);

  int lastError();

  private:
  int _address;
  uint8_t _data;
  int _error;
};

#endif
//
// END OF FILE
//
---- Beomote.cpp ----
/*********************************************************************************
B&O uses a PWM system, with 200ms pulses with specific sized gaps between them.
The gap size determines the data payload:
    BEO_ZERO    3125 
    BEO_SAME    6250  - Repeat of the last Bit type
    BEO_ONE     9375 
    BEO_STOP    12500 - Marks the start of a message
    BEO_START   15625 - Marks the end of a message

Beo4 commmands are of the form:
    START_PULSE
    Link : bit
    Address: Byte - Target device. 0=TV, 1=Audio, 1B = Lights
    Command: Byte - see Commmands.h
    STOP_PULSE

BeoRemote One uses an additional 4bits for commmands, sending the STOP mark after
21 bits of data
*********************************************************************************/

#include "Beomote.h"

Beomote Beo;

void Pin_ISR()
{
    Beo.pulseISR();
}

ISR(TIMER1_OVF_vect)
{
    Beo.timerISR();
}

// Pin needs to support interrupts, will depend on specific board being used.
// For example, Uno can use Pin2 or Pin3.
void Beomote::initialize(int pin)
{
    irPin = pin;
    // Setting the pinmode of the IR pin and resetting the listener
    pinMode(irPin, INPUT);
    reset();

    // Clearing Control Register A
    TCCR1A = 0;
    // Setting the phase and frequency correct pwm, and stopping the timer
    TCCR1B = _BV(WGM13);

    long cycles = (F_CPU / 2000000) * TICK;
    ICR1 = cycles;

    TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));

    // Setting the timer overflow interrupt enable bit
    TIMSK1 = _BV(TOIE1);

    // Resetting clock select register, and starts the clock with no prescale
    TCCR1B |= _BV(CS10);

    // Setup interrupt to listen to trailing edge of pulse
    //attachInterrupt(digitalPinToInterrupt(pin), Pin_ISR, RISING); // TSOP
    attachInterrupt(digitalPinToInterrupt(pin), Pin_ISR, FALLING); // B&O eye
}

void Beomote::reset()
{
    index = -1;
    state = WAITING;
    timer = 0;

    link = 0x00;
    address = 0x00;
    command = 0x00;

    //Reset Timer
    TCCR1B |= _BV(CS10);
}

int Beomote::receive(BeoCommand &cmd)
{

    if (state == MSG_COMPLETE)
    {
        cmd.link = link;
        //cmd.address = (beo_address)address;
        //cmd.command = (beo_command)command;
        cmd.address = address;
        cmd.command = command;

        reset();
        return 1;
    }

    return 0;
}

int Beomote::fuzzyCompare(int valueint target)
{
    int fudge = BEO_ZERO / 10;
    return (value >= target - fudge) && (value <= target + fudge);
}

void Beomote::timerISR()
{
    timer++;
}

void Beomote::pulseISR()
{
    //int irData = !digitalRead(irPin);
    //digitalWrite(13, irData);
    int beoCode = 0;
    int beoBit;

    // Don't process new command if the old one hasn't been picked up
    if (state == MSG_COMPLETE)
    {
        return;
    }

    if (state == WAITING)
    {
        timer = 0;
        state = FIRST_PULSE;
    }
    else if (fuzzyCompare(timer, BEO_ZERO))
    {
        beoCode = BEO_ZERO;
        beoBit = lastBeoBit = 0;
    }
    else if (fuzzyCompare(timer, BEO_SAME))
    {
        beoCode = BEO_SAME;
        beoBit = lastBeoBit;
    }
    else if (fuzzyCompare(timer, BEO_ONE))
    {
        beoCode = BEO_ONE;
        beoBit = lastBeoBit = 1;
    }
    else if (fuzzyCompare(timer, BEO_STOP))
    {
        beoCode = BEO_STOP;
    }
    else if (fuzzyCompare(timer, BEO_START))
    {
        beoCode = BEO_START;
    }
    else
    {
        // We haven't found a valid pulse size
        //Serial.println("Invalid pulse");
        //DumpState();
        reset();
    }
    //We got a valid message, reset the timer and process it
    timer = 0;

    if (beoCode == BEO_START)
    {
        state = IN_PROGRESS;
        index = 0;
    }
    else if (index == 0)
    {
        link = beoBit;
        index++;
    }
    else if (index < 9)
    {
        address = address << 1;
        address |= beoBit;

        index++;
    }
    else if (beoCode == BEO_STOP)
    {
        state = MSG_COMPLETE;
    }
    else if (index < 21)
    {
        command = command << 1;
        command |= beoBit;

        index++;
    }
    else
    {
        #ifdef DEBUG
        Serial.println("How did we get here?");
        debugDumpState(beoCode);
        #endif
        
        reset();
    }
}

void Beomote::debugDumpState(int beoCode)
{
    Serial.println("Beomote State:");
    Serial.print("  code:");
    Serial.println(beoCode);
    Serial.print("  state:");
    Serial.println(state);
    Serial.print("  timer:");
    Serial.println(timer);
    Serial.print("  index:");
    Serial.println(index);
    Serial.print("  link:");
    Serial.println(link, HEX);
    Serial.print("  address:");
    Serial.println(address, HEX);
    Serial.print("  command:");
    Serial.println(command, HEX);
}
---- beomote.h ----
#ifndef _BEOMOTE_H
#define _BEOMOTE_H

#include "Commands.h"
#include <Arduino.h>
#include <avr/io.h>
#include <avr/interrupt.h>

// Common divisors for 3125 = 1, 5, 25, 125, 625, 3125
#define TICK 25

// Defining the Bang & Olufsen commands
#define BEO_ZERO    (3125 / TICK) //125
#define BEO_SAME    (6250 / TICK) //250 
#define BEO_ONE     (9375 / TICK) //375
#define BEO_STOP    (12500 / TICK) //500
#define BEO_START   (15625 / TICK) //625

typedef struct {
    boolean link;
   // beo_address address;
   // beo_command command;
    unsigned char address;
    unsigned int command;
BeoCommand;

typedef enum IrState
{
    WAITING = 0x00,
    FIRST_PULSE = 0x04,
    IN_PROGRESS = 0x08,
    MSG_COMPLETE = 0x10
} IrState;

class Beomote {
    public:
        void initialize(int pin);
        int receive(BeoCommand &cmd);

        // This method is only to be called by the interrupt service routine
        void timerISR();
        void pulseISR();

    private:
        int irPin;

        int lastState;
        int lastBeoBit;

        IrState state;

        boolean link;
        unsigned char address;
        unsigned int command;

        volatile int timer;
        int index;

        void reset();
        int fuzzyCompare(int valueint target);
        void debugDumpState(int beoCode);
};
extern Beomote Beo;


#endif
------ commands.h --- not used AFAIK -------
#ifndef _COMMANDS_H
#define _COMMANDS_H

typedef enum beo_address
{
    SOURCE_VIDEO = 0x00,
    SOURCE_AUDIO = 0x01,
    SOURCE_VIDEOTAPE = 0x05,
    SOURCE_ALL = 0x0F,
    SOURCE_SPDEMO = 0x1D,
    SOURCE_LIGHT = 0x1B,
    SOURCE_BEOVISION1 = 0xA0,
    SOURCE_BEOSOUND =0xA5,
    SOURCE_BEOVISION20xA8,
    SOURCE_BEOSOUND2=0xAD,
    SOURCE_BEOVISION3 = 0xB0,
    SOURCE_BEOSOUND3 =0xB5
} beo_address;

typedef enum beo_command
{
    NUMBER_0 = 0x00,
    NUMBER_1 = 0x01,
    NUMBER_2 = 0x02,
    NUMBER_3 = 0x03,
    NUMBER_4 = 0x04,
    NUMBER_5 = 0x05,
    NUMBER_6 = 0x06,
    NUMBER_7 = 0x07,
    NUMBER_8 = 0x08,
    NUMBER_9 = 0x09,
    
    CLEAR = 0x0A,
    STORE = 0x0B,
    STANDBY = 0x0C,
    MUTE = 0x0D,
    INDEX = 0x0E,
    RESET = 0x0E,

    BACK = 0x14,

    PICTURE_OFF = 0x1C,
    P_UP = 0x1E,
    P_DOWN = 0x1F,
    TUNE = 0x20,
    Counter=0x20,
    
    CLOCK = 0x28,
    
    FORMAT = 0x2A,

    REWIND = 0x32,
    RETURN = 0x33,
    FORWARD = 0x34,
    PLAY = 0x35,
    GO = 0x35,
    PAUSE = 0x36,
    RECORD = 0x37,


    GUIDE = 0x40,
    SELECT = 0x3F,
    INFO = 0x43,
    SPEAKER = 0x44,

    TURN = 0x46,
    SOUND = 0x46,
    SLEEP = 0x47,
    LOUDNESS = 0x48,
        PICTURE = 0x4A,

    BASS = 0x4D,
    TREBLE = 0x4E,
    BALANCE = 0x4F,
    
    LIST = 0x58,
    
    MENU = 0x5C,
    
    VOLUME_UP = 0x60,
    VOLUME_DOWN = 0x64,
    
    LEFT_REPEAT = 0x70,
    RIGHT_REPEAT = 0x71,
    UP_REPEAT = 0x72,
    DOWN_REPEAT = 0x73,
    
    GO_REPEAT = 0x75,
    GREEN_REPEAT = 0x76,
    YELLOW_REPEAT = 0x77,
    BLUE_REPEAT = 0x78,
    RED_REPEAT = 0x79
    
    EXIT = 0x7F,
    TV = 0x80,
    RADIO = 0x81,
    VIDEO_AUX = 0x82,
    AUDIO_AUX = 0x83,
    HOME_MEDIA = 0x84, // Note uses address C0
    VIDEO_TAPE = 0x85,
    DVD = 0x86,
    CAMCORD = 0x87,
    TEXT = 0x88,
    SP_DEMO = 0x89,
    DIGITAL_TV = 0x8A,
    PC = 0x8B,
    WEB_MEDIA = 0x8C, // Note uses address C0
    
    DOOR_CAM = 0x8D,
    AUDIO_TAPE = 0x91,
    CD = 0x92,
    PHONO = 0x93,
    NETRADIO = 0x93,
    AUDIO_TAPE_2 = 0x94,
    N_MUSIC = 0x94,
    SPOTIFY = 0x96, // Note used address C0
    CD2 = 0x97,
    LIGHT = 0x9B,
        MORNING = 0xF,
        HOME =0x25,
        DINNER =0x26,
        CINEMA =0x27,
        BED_TIME = 0x39,
        NIGHT = 0x3A,
        WELCOME_HOME = 0x3B,
        GOODBYE = 0x3C,
    CONTROL =0x9C,
        WINDOW1 = 0xF,
        CURTAIN1 = 0x1A,
        ON_OFF1 = 0x25,
        SHADE1 = 0x3B,
    
    DIMENSION_2D = 0xAD,
    DIMENSION_3D = 0xAE,

    AV = 0xBF,
    TRACKING = 0xC8,
    
    HDMI1 = 0xCE, // Note uses address C0
    HDMI2 = 0x1CE, // Note uses address C0
    HDMI3 = 0x2CE, // Note uses address C0
    HDMI4 = 0x3CE, // Note uses address C0
    
    MATRIX1 = 0xCF, // Note uses address C0
    MATRIX2 = 0x1CF, // Note uses address C0

    CINEMA_ON = 0xDA,
    CINEMA_OFF = 0xDB,


    YELLOW = 0xD4,
    GREEN = 0xD5,
    BLUE = 0xD8,
    RED = 0xD9,

    HOME_CONTROL = 0xE3,

    P_AND_P = 0xFA,
    STAND = 0xF7,

    YOUTUBE = 0x18C, // Note uses address C0
    DEEZER = 0x196, // Note uses address C0
    PATTERN_PLAY = 0x1D3, // Note uses address C0
    BLUETOOTH = 0x283, // Note uses address C0
    BLGW_APP = 0x28C, // Note uses address C0
    Q_PLAY = 0x296, // Note uses address C0

} beo_command;

#endif
samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Thu, Apr 23 2020 3:35 AM

djmp:

Thanks to crossbytje I have an Arduino Nano running and reporting back IR codes with GND/5V/IR Signal connected (see https://archivedforum2.beoworld.org/forums/p/16023/138995.aspx for wiring).

I have an IR eye with a 5 wire connection - the other two are TX/RX I believe - would like to get them hooked up. Right now I don't have the eye LEDs or local buttons responding - any idea on how to make that happen? Not sure of what protocol is going on via TX/RX.

 

--- Miniterm on /dev/tty.usbserial-14310  115200,8,N,1 ---

--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

initialized

0:160:96

0:160:100

0:160:50

0:160:53

0:160:67

0:160:202

Excellent, that's the hard stuff done.Those messages coming back are

[Link}:[Source addr]:[cmd]

 

  • AFAIK Link is whether the remote is sending a link command
  • Source Addr is the source the remote is set to - I generally only use this to detect which type of remote is in use. I have Beoremote 1, Beo4 and the cute little Beo1 from a beovision. I do that as I remap some of those buttons in software, so that the directional arrows act as arrows.
  • Cmd which maps to the button pressed.

 

You pressed 

Vol Up, Vol Dn, Left, Go, Info, Up, probably on a beoremote 1 in TV mode.

My most recent mappings are:

val convertBeoCode = [Integer codeInteger addr|
    var cmd = ""
    switch (code){
        case 0x00: cmd = "NUMBER_0"
        case 0x01: cmd = "NUMBER_1"
        case 0x02: cmd = "NUMBER_2"
        case 0x03: cmd = "NUMBER_3"
        case 0x04: cmd = "NUMBER_4"
        case 0x05: cmd = "NUMBER_5"
        case 0x06: cmd = "NUMBER_6"
        case 0x07: cmd = "NUMBER_7"
        case 0x08: cmd = "NUMBER_8"
        case 0x09: cmd = "NUMBER_9"
        case 0x0A: cmd = "CLEAR"
        case 0x0B: cmd = "STORE"
        case 0x0C: cmd = "STANDBY"
        case 0x0D: cmd = "MUTE"
        //case 0x0E: cmd = "INDEX"
        case 0x0E: cmd = "RESET"

        case 0x13: cmd = "GO"
        case 0x14: cmd = "BACK"

        case 0x1C: cmd = "PICTURE_OFF"
        
        case 0x1E: if (addr == 0x80cmd = "UP" else cmd = "CHANNEL_UP"
        case 0x1F: if (addr == 0x80cmd = "DOWN" else cmd = "CHANNEL_DOWN"
      //  case 0x20: cmd = "TUNE"
        case 0x20: cmd = "COUNTER"
        case 0x28: cmd = "CLOCK"
        case 0x2A: cmd = "FORMAT"

        case 0x32: if (addr >= 0xA0cmd = "REWIND" else cmd = "LEFT"
        case 0x33: cmd = "RETURN"
        case 0x34: if (addr >= 0xA0cmd = "FORWARD" else cmd = "RIGHT"
        case 0x35: if (addr >= 0xA0cmd = "PLAY" else cmd = "GO"
        
        
        //case 0x35: cmd = "GO"
        case 0x36: cmd = "PAUSE"
        // Map record to exit on older TV remotes
        case 0x37: if (addr == 0x80cmd = "EXIT" else cmd = "RECORD"
        case 0x3F: cmd = "SELECT"

        case 0x40: cmd = "GUIDE"

        case 0x43: cmd = "INFO"
        case 0x44: cmd = "SPEAKER"

        case 0x46: cmd = "TURN"
        case 0x46: cmd = "SOUND"
        case 0x47: cmd = "SLEEP"
        case 0x48: cmd = "LOUDNESS"
        case 0x4A: cmd = "PICTURE"

        case 0x4D: cmd = "BASS"
        case 0x4E: cmd = "TREBLE"
        case 0x4F: cmd = "BALANCE"

        case 0x58: cmd = "LIST"
        case 0x5C: cmd = "MENU"
        
        case 0x60: cmd = "VOLUME_UP"
        case 0x64: cmd = "VOLUME_DOWN"

        //REPEAT Section
        case 0x70: cmd = "LEFT"
        case 0x71: cmd = "RIGHT"
        case 0x72: cmd = "UP"
        case 0x73: cmd = "DOWN"
        case 0x75: cmd = "GO"
        case 0x76: cmd = "GREEN"
        case 0x77: cmd = "YELLOW"
        case 0x78: cmd = "BLUE"
        case 0x79: cmd = "RED"

        case 0x7F: cmd = "EXIT"

        case 0x80: cmd = "TV"
        case 0x81: cmd = "RADIO"
        case 0x82: cmd = "VIDEO_AUX"
        case 0x83: cmd = "AUDIO_AUX"
        case 0x84: cmd = "HOME_MEDIA"
        case 0x85: cmd = "VIDEO_TAPE"
        case 0x86: cmd = "DVD"
        case 0x87: cmd = "CAMCORD"
        case 0x88: cmd = "TEXT"
        case 0x89: cmd = "SP_DEMO"
        case 0x8A: cmd = "DIGITAL_TV"
        case 0x8B: cmd = "PC"
        case 0x8C: cmd = "WEB_MEDIA"
        case 0x8D: cmd = "DOOR_CAM"
        
        case 0x91: cmd = "AUDIO_TAPE"
        case 0x92: cmd = "CD"
        //case 0x93: cmd = "PHONO"
        case 0x93: cmd = "NETRADIO"
        //case 0x94: cmd = "AUDIO_TAPE_2"
        case 0x94: cmd = "N_MUSIC"
        case 0x96: cmd = "SPOTIFY"
        case 0x97: cmd = "CD2"
        case 0x9B: cmd = "LIGHT"
        //case 0xF: cmd = "MORNING"

        case 0xAD: cmd = "DIMENSION_2D"
        case 0xAE: cmd = "DIMENSION_3D"

        case 0xBF: cmd = "AV"
        case 0xC8: cmd = "TRACKING"

        case 0xC1: cmd = "RANDOM"

        case 0xCA: cmd = "UP"
        case 0xCB: cmd = "DOWN"
        case 0xCC: cmd = "LEFT"
        case 0xCD: cmd = "RIGHT"

        case 0xCE: cmd = "HDMI1"
        case 0x1CE: cmd = "HDMI2"
        case 0x2CE: cmd = "HDMI3"
        case 0x3CE: cmd = "HDMI4"
        case 0xCF: cmd = "MATRIX1"
        case 0x1CF: cmd = "MATRIX2"

        case 0xDA: cmd = "CINEMA_ON"
        case 0xDB: cmd = "CINEMA_OFF"

        case 0xD4: cmd = "YELLOW"
        case 0xD5: cmd = "GREEN"
        case 0xD8: cmd = "BLUE"
        case 0xD9: cmd = "RED"

        case 0xE3: cmd = "HOME_CONTROL"

        case 0xFA: cmd = "P_AND_P"
        case 0xF7: cmd = "STAND"

        case 0x18C: cmd = "YOUTUBE"
        case 0x196: cmd = "DEEZER"
        case 0x1D3: cmd = "PATTERN_PLAY"
        case 0x283: cmd = "BLUETOOTH"
        case 0x28C: cmd = "BLGW_APP"
        case 0x296: cmd = "Q_PLAY"
/*
        case 0x25: cmd = "HOME"
        case 0x26: cmd = "DINNER"
        case 0x27: cmd = "CINEMA"
        case 0x39: cmd = "BED_TIME"
        case 0x3A: cmd = "NIGHT"
        case 0x3B: cmd = "WELCOME_HOME"
        case 0x3C: cmd = "GOODBYE"
        case 0x9C: cmd = "CONTROL"
        case 0xF: cmd = "WINDOW1"
        case 0x1A: cmd = "CURTAIN1"
        case 0x25: cmd = "ON_OFF1"
        case 0x3B: cmd = "SHADE1"
*/
    }
    cmd
]
djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Thu, Apr 23 2020 5:03 AM

Thanks! Should have been more clear in my question though. I have the IR codes via USB and thanks for the remote control mappings.

I'm talking about accessing the LEDs and the Timer/Play/Up/Down buttons on the eye. I'm guessing that's i2c coming out of the TX/RX connections on the eye? Haven't hooked them up yet to the Arduino but was wondering if someone had.

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Thu, Apr 23 2020 5:03 AM

dupe

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Thu, Apr 23 2020 5:03 AM

dupe

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

The older eyes have connectors for both LEDs which you can simply feed 5V to light up. But I guess that's not very helpful to you.

I experimented a little with the buttons on mine, but I didn't find a way to read any signal from pressing them. I finally gave up on the button use, since I have the eye installed in a hidden place anyway. 

Beolit 12 - Beolab 4 pc (dead now) - Beoplay H5 - Beolab 9 - BeoRemote One BT - Beoplay M3

Page 1 of 2 (54 items) 1 2 Next > | RSS