Converting Bang & Olufsen Raw code to Hex

Everything related to protocols and IR codes
Schmeling
Posts: 14
Joined: Tue Nov 27, 2018 6:13 pm

Converting Bang & Olufsen Raw code to Hex

Post by Schmeling »

Can anyone convert this raw code

Code: Select all

name beo4-light-green
          KEY_0                    3125                      #  Was: 200
          KEY_0                    3125                      #  Was: 200
          KEY_0                    6250                      #  Was: 200
          KEY_0                    3125                      #  Was: 200
          KEY_0                    6250                      #  Was: 200
          KEY_0                    9375                      #  Was: 200
          KEY_0                    3125                      #  Was: 200
          KEY_0                     #  Was: 200             
to a Hex code?

The raw code is from this LIRC configuration file: http://lirc.sourceforge.net/remotes/bang&olufsen/Beo4

And the same codes can be found here in hex: https://github.com/christianlykke9/Beom ... Commands.h

The commands are the same as in this project: viewtopic.php?f=5&t=548&p=1065&hilit=olufsen#p1065 which I'm trying to use.

My problem is, that the two last links only has codes for the individual keys, not combinations. I this case the projects have codes for “light” and for “green”, but not “light+green”. The combination gives a new unique code, as can be seen from the raw LIRC code, but this is not implemented in the two hex codesets.

Can anyone convert this raw code into hex?

I already have Georges project from the link above up and running on an Uno with a SEND.IR, and it seems to be working, I just need the right code, I think.

PS: The reason don’t just decode it from the remote is, that I don’t have the beolink 4 remote, or for that matter a 455khz IR receiver. I’m just trying to send this one IR code, so I can control a LK/Schneider 220V dimmer, that accepts this code from a Beolink4.
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Converting Bang & Olufsen Raw code to Hex

Post by AnalysIR »

I Believe the following is the signal for Green:

Code: Select all

Raw (43): 186,-2668,186,-2668,186,-14076,186,-2668,186,-5520,186,-5520,186,-5520,186,-5520,186,-5520,186,-5520,186,-5520,186,-5520,186,-8372,186,-5520,186,-2668,186,-8372,186,-2668,186,-8372,186,-2668,186,-8372,186,-11224,186
and for Light

Code: Select all

Raw (43): 186,-2668,186,-2668,186,-14078,186,-2668,186,-5520,186,-5520,186,-5520,186,-8372,186,-5520,186,-2668,186,-8372,186,-5520,186,-5520,186,-2668,186,-5520,186,-8372,186,-5520,186,-2668,186,-8372,186,-5520,186,-11222,186
You may be able to figure out how to combine from the above. (Is it not possible to send one signal after the other to get the same effect?)

Remember the carrier frequency is 455kHz.
Schmeling
Posts: 14
Joined: Tue Nov 27, 2018 6:13 pm

Re: Converting Bang & Olufsen Raw code to Hex

Post by Schmeling »

Great. would theese two codes correspond to the following HEX: Light: 0x9B and Green 0xD5?

From your suggestion about sending the two codes one after the other. I was actually under the impression from this link:

http://lirc.sourceforge.net/remotes/bang&olufsen/Beo4

that pressing Light and thereafter Green (not at the same time), would produce ONE single new and unique code? But I'm actually starting to wonder about this, since both George, who has been experimenting with the B&O protocol and this link:

https://github.com/christianlykke9/Beom ... Commands.h

suggests the same as you do, that they are sent after each other.

On the other hand, I have seen the remote Beo4 (dont have it), and if you press Light, the menu on the remot changes, and then you can control light things. If two codes are sent after each other, the Light meny transmits the Light code fist and the the button you press. Also there is a unique remote for the dimmer, I'm trying to control, and you only press one button, which made me think it would only be one unique code.

Do you have any idea whether It would be an entirely new code, that is produced when pressing the two buttons, or just two codes after each other as you suggest??
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Converting Bang & Olufsen Raw code to Hex

Post by AnalysIR »

I am not sure as to the HEX values at this point.

Nothing you mentioned, suggests that the real remote operates any differently. From what I have seen the last time I looked they were individual signals.

That does not guarantee that they can't also be combined.....just don't know enough about that particular device, sorry.

The remote could be designed to make it look like a combined operation, but could be individual signals...'under the covers'. The remote may also just send 2 signals when you press the colour button.

It looks like the only way to be sure is to try it out!
Schmeling
Posts: 14
Joined: Tue Nov 27, 2018 6:13 pm

Re: Converting Bang & Olufsen Raw code to Hex

Post by Schmeling »

Naa, no Dice :(

Neither sending the raw codes via sendRawBuf or sending the HEX via sendHexBno worked, although strangely enough the Send.IR D1 led blinking behaviour seems to differ from raw to HEX as well as the TX led, which I find rather odd and is making me wonder if I'm doing this right.

I'm using void executor and void executor3 in BnOController.ino.cpp (remove .cpp extension)

Does anybody have any ideas? (not only as to the IR codes, but also if I'm using the code correctly)

Best Regards Max
You do not have the required permissions to view the files attached to this post.
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Converting Bang & Olufsen Raw code to Hex

Post by AnalysIR »

First thing I noticed is that you shouldn't have negative numbers in the sigArray, which would be a problem.

Code: Select all

unsigned int sigArray1[43]={186,2668,186,2668,.......
The first position should always be a mark and the second a space and so on.

Apologies, as I provided them in the incorrect format to you above. (I will put a note in the original post)

So retry and let me know how you get on (there may of course be other issues).
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Converting Bang & Olufsen Raw code to Hex

Post by AnalysIR »

First thing I noticed is that you shouldn't have negative numbers in the sigArray, which would be a problem.

The arrays should look like the following

Code: Select all

unsigned int sigArray1[] = {186,2668,186,2668,186,14076,186,2668,186,5520,186,5520,186,5520,186,5520,186,5520,186,5520,186,5520,186,5520,186,8372,186,5520,186,2668,186,8372,186,2668,186,8372,186,2668,186,8372,186,11224,186};
unsigned int sigArray2[] = {186,2668,186,2668,186,14078,186,2668,186,5520,186,5520,186,5520,186,8372,186,5520,186,2668,186,8372,186,5520,186,5520,186,2668,186,5520,186,8372,186,5520,186,2668,186,8372,186,5520,186,11222,186};

.............

      arduino.sendRawBuf(sigArray2, sizeof(sigArray2)/sizeof(sigArray2[0]), 455);     
      arduino.sendRawBuf(sigArray1, sizeof(sigArray1)/sizeof(sigArray1[0]), 455);
The first position should always be a mark and the second a space and so on.

Apologies, as I provided them in the incorrect format to you above. (I will put a note in the original post)

So retry and let me know how you get on (there may of course be other issues).

If you still have an issue, post your IR send circuit and pins used and/or a photo of your setup.
Schmeling
Posts: 14
Joined: Tue Nov 27, 2018 6:13 pm

Re: Converting Bang & Olufsen Raw code to Hex

Post by Schmeling »

Ahh, of course. I should have spotted that too, but it explains the differences in LED blinking behaviour from HEX to RAW. After the correction, the behaviour seems to be identical between HEX and RAW, but still no success. I've attatched pictures of the board + the corrected main file. The rest of the files are the same.

I'm beginning to think that Light+Green is not the correct code to send, and that the Light button actually produces different codes, but I'm unsure.

I have IR blinking (checked with mobile camera).
You do not have the required permissions to view the files attached to this post.
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Converting Bang & Olufsen Raw code to Hex

Post by AnalysIR »

That all looks good...
..except that you have a LED connected directly from D13 to GND (No series resistor???)....why not use the onboard LED

Also make sure that the mark timings are set to 200us instead of what I posted earlier
ERROR---> this line is incorrect===> Plus the space timings should be full multiples of 2925us. IGNORE
It should read the lenght of each Mark + the next space should be a multiple of 3125.

That leaves you with the following options for space lengths (Seems to match the #defines in your code)
2925
6050
9175
12300 (start space)
15425 (stop/end space)

So just change the timings in the signals I posted to the nearest of these timings (e.g 186=>200...2668=>2925 etc) and try again...
Schmeling
Posts: 14
Joined: Tue Nov 27, 2018 6:13 pm

Re: Converting Bang & Olufsen Raw code to Hex

Post by Schmeling »

Sorry, no relief.

I have changed all the timings, but no success. I guess, that leaves me with just the codes that must be the wrong ones. Supposing that I work in HEX. Is it correct, that the only codes, I can send is from 00 to FF?

If that is the case. Couldn't I expand void executor2 and make a double loop, to find the right two codes, provided, that the signal consists of two B&O codes.

I'm guessing, that the only other option would be to buy the remote, buy AnalysisIR + receiver (is there a module that supports reception and decoding of 455khz + the normal ones of course)? Do you see any other options?

PS:I know the LED from D13 isn't exactly kosher. It. was just there from the previous project. And it holds up well with a few blinks, but I suspect, that a permanent high on pin 13 would be the end of it ;-)
Post Reply