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 replied on Thu, Apr 23 2020 11:55 AM

djmp:

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.

With the above arduino code, this part:

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;
    }
handles the puck buttons. They come back as 0:254:x over usb.

 

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

djmp:

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.

With the above arduino code, this part:

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;
    }
handles the puck buttons. They come back as 0:254:x over usb.

 

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Fri, Apr 24 2020 2:58 PM

Thanks samsp!  I got the buttons and also LED control going.

For IR I do notice that I’ll get occasional misreads of the IR remote, incorrect code reported. Maybe that’s to be expected?

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

I get that too. Luckily, the wrong codes don't map to any other real functionality in my case. At least not that I'm aware of. Sometimes it doesn't do what I wanted, but it never did anything else instead.

I get more errors if I use the remote from far away, needing it to bounce of several walls before it reaches the eye.

I thought it had something to do with the frequency of the arduino not exactly being that of the IR signals, so it sometimes misses part of the signal..

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

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Wed, May 6 2020 5:22 PM

Just to say that the IR eye is working well. Buttons & IR commands report over USB. For fun I added a BLINK command which sets selected LEDs blinking at a 1 HZ rate - I use this to show the attached system is starting up. Thanks to all in the thread for advice and code fragments. I ended up using a Pro Micro Arduino, very small and fits fine in the IR eye. 

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Wed, May 6 2020 5:25 PM

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Wed, May 6 2020 9:14 PM

I'd love a copy of the LED code, I have tried to set the LED state in the past and just seemed to hang the I2C communications. It would be nice to have a flash when a command is received, and also during startup.

It is slick the way the arduino fits in the back, and turns a pretty proprietary device (B&O remotes) into something that can work with all sorts of home automation.

Are you using a PI or something else at the other end of the USB?

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Wed, May 6 2020 9:21 PM

djmp:

Thanks samsp!  I got the buttons and also LED control going.

For IR I do notice that I’ll get occasional misreads of the IR remote, incorrect code reported. Maybe that’s to be expected?

I have a feeling that the output of the IR Receiver is pretty noisy. I looked at the output with a cheap USB scope, and it seemed to have quite a lot of flicker in it, even when no signals were being received.

Is this coming back as misreads in the serial data over USB? I have seen those occasionally but wasn't sure if that was user error or not. Do you have an idea of the frequency of the misreads? For me its probably in the single digit percent - so I haven't noticed enough of a problem to spend more time investigating it.

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Tue, May 19 2020 6:12 AM

Sorry for the delay, was busy with work. I’ll send you a zip of the source.

I have it connected to a Pi with some code handling IR events. I’m swapping out a Beosystem 3 for a newer processor but still want to use the Beoremote.

djmp
Not Ranked
Posts 14
OFFLINE
Bronze Member
djmp replied on Tue, May 19 2020 6:19 AM

I’ve noticed that IR reliability goes way down if I use in a room with a plasma screen. That produces a ton of IR interference so I think the timing code is getting thrown off and misdecoding the pulse sequence. I’ve seen it go into debug reporting too which meant that it got a bit lost. Haven’t had time to dig further and I don’t have a scope.

TWG
Top 75 Contributor
Posts 1,672
OFFLINE
Gold Member
TWG replied on Wed, May 20 2020 7:23 AM

djmp:

I’ve noticed that IR reliability goes way down if I use in a room with a plasma screen. That produces a ton of IR interference so I think the timing code is getting thrown off and misdecoding the pulse sequence. I’ve seen it go into debug reporting too which meant that it got a bit lost. Haven’t had time to dig further and I don’t have a scope.




This is a common problem with Plasma screens; I can't remember correctly if there's a plasma safe IR eye from B&O (maybe some member know it) but they had this installation hint in the Beosystem 1 manual:

"(...) When mounting the IR receiver in a setup
with a plasma screen, make sure to place the
receiver on the same wall as the screen. If the
IR receiver is placed incorrectly, the light
emitted by the screen can impede remote
control operation of BeoSystem 1! (...)"

 

crossbytje
Top 500 Contributor
Posts 224
OFFLINE
Bronze Member

There are indeed versions of the IR eye with plasma filter layer. I read this in the IR eye overview that you can find with a google search.

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

david656
Not Ranked
Posts 29
OFFLINE
Silver Member

Hi,

I hope you don't mind me asking a question about your posts, I found an old thread that had some other information in I've found useful/interesting reading. https://archivedarchivedforum2.beoworld.org/forums/t/30181.aspx

I think I'm trying to achieve something similar to your project and was wondering if you could point me in the right direction.

I basically want to listen in on the data line of a datalink cable via a raspberry pi and then trigger a command in linux. So essentially if someone pressed an arrow key on a beo4 remote say 'the up key' the pi realised that and then posted in linux 'the up key has been pressed'.

I've experimented with the Pi and LIRC and whilst I can get it to monitor and hear commands on the databus I can't get it to understand what those commands are or do anything with them.

Would you be able to perhaps enlighten me? I feel really stupid for not being able to get over this hurdle.

Thanks,!

Bristol based B&O fan with a collection including the following: BC9500, Beogram 9500, Beosystem 3, BeoVision Avant DVD 32, AV9000, Beolab 3500, Beolab 3000s, Beolab 4s, Beolab 6000s, Beovox Pentas, Beovox 3000s.

samsp
Not Ranked
Posts 44
OFFLINE
Bronze Member
samsp replied on Fri, Jun 12 2020 7:58 PM

I haven't read through the full description of the data link info, but one line said it follows the same structure as the IR codes.

To handle something like IR or the databus, you need to be doing real-time processing of the signal - while that is probably possible with a Pi, its a lot easier with an arduino as you are working at much lower level - essentially a big loop, and its happy doing that uninterrupted 24x7. So I'd suggest using an Arduino for handling the bus interface, and then provide a higher level view of the data to the RPi. The great thing about the combo, is most Arduino have a USB port for serial comms, and that will connect directly to the USB on the RPI - and be mapped to an I/O file on the RPI as something like /dev/USBSerial01, and the RPI will supply power via USB.

 

If you look at the Arduino code, Bemote.cpp, this is what is doing the hard work. It maps the remote input to an interrupt pin, and creates a timer. When the timer ticks, an function is called which increments a counter for the number of ticks. When a pulse from the remote is detected, the interrupt occurs, it collects the timer info, and maps that into the command structure. Once the command is complete, it gets written out over USB.

You may or may not have the same timing thing to do, but I'd suggest using an interrupt pin on the arduino to collect the data, and then send it to the RPI will be simplest. Given you can get a handful of arduino nano for $20, and the nano is ~20x43mm, its small enough to fit almost anywhere, such as acting as a dongle on a cable.

Page 2 of 2 (54 items) < Previous 1 2 | RSS