Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 43 12311 ... LastLast
Results 1 to 10 of 427
  1. #1
    Senior Member
    Join Date
    Oct 2008
    Location
    Huntingdon, UK
    Posts
    583

    Lightbulb Announce: SqueezeIR - A Generic Infra-Red Remote Control Applet for the Duet's SBC

    SqueezeIR - A Generic Infra-Red Remote Control Applet for the Logitech Squeezebox Duet Controller

    NB: This is my first attempt at an applet for the SBC so I cannot guarantee that it won't cause problems but it works for me.

    NNB: There has been a major re-write of SqueezeIR and any posts on this thread prior to #158 are now largely meaningless.


    After much pulling of hair (I'm almost bald now!) I have finally completed the first release candidate of my promised remote-control applet. I hope it's of some use to you guys!


    Overview:
    SqueezeIR (pronounced "squeezier") is an applet for the Logitech Squeezebox Duet Controller (SBC). It's purpose is to provide a set of user-customisable menus to send infra-red remote control codes (IR codes) to auxillary equipment such as amplifiers, CD players etc... Each menu can also have any of the SBC's physical keys mapped to send IR codes instead of, or in addition to, the keys' default behaviour. Macro commands are supported as are having different IR codes defined for the press and hold actions of keys or menu items. Holding a key can optionally repeat the IR code or just send it once.

    The functionality of the applet is defined within a configuration file (SqueezeIR.xml). My file has been included with the distribution and includes a selection of device IR codes, examples and help with the syntax.

    Limitations:
    - The Scroll-Wheel cannot have its functionality changed (but hold events allow for continuous changes).
    - Very little (make that no) error checking of SqueezeIR.xml, so if your file has the slightest error then the applet won't work. You have been warned!
    - Only a small set of common IR protocols are supported at the moment (RC5, RC5ex, RC6M0, NEC, NECx, Panasonic (old & new), NAD, Denon, Pronto learned, and testir's native "raw hex" format as used in some other remote control applets).
    - Toggle bits are not toggled. Doesn't seem to matter with my devices.

    Installation:
    - Unzip the zip file.
    - Edit SqueezeIR.xml to suit your devices and preferences.
    - Create a backup your SqueezeIR.xml file onto your computer!
    - Copy the entire SqueezeIR folder to your SBC (See http://wiki.slimdevices.com/index.ph...zePlay_Applets and follow the "Manual Installation" method).
    - Restart your SBC.

    Upgrading:
    - Create a backup your SqueezeIR.xml file onto your computer!
    - Delete the existing SqueezeIR folder on your SBC.
    - Unzip the zip file.
    - Overwrite the sample SqueezeIR.xml file with your version (that you backed up earlier).
    - Copy the new SqueezeIR folder to your SBC.

    Uninstall:
    - Remove the entire SqueezeIR folder from your SBC.
    - Restart your SBC.

    Usage:
    Select "Squeeze IR" from the Extras Menu. What happens next depends on your SqueezeIR.xml configuration file!

    Help:
    - docs\ReadMe.txt - this text
    - My SqueezeIR.xml - info on the data format, and supported protocols
    - docs\ChangeLog.txt ~ Version changes, bug fixes etc.
    - http://forums.slimdevices.com (of course!) - support thread
    - http://lirc.sourceforge.net/remotes/ - source of ir Codes (will need work to be made compatible with SqueezeIR)
    - http://www.hifi-remote.com/johnsfine/DecodeIr.html - IR theory and protocol definitions
    - http://www.remotecentral.com/ - general stuff
    - http://www.sbprojects.com/knowledge/ir/ir.htm - IR theory


    I'm hoping that the community will get on-board and publish successful device IR codes on the forums. I'm also hoping the developers amongst you will increase the number of supported protocols by adding protocol conversion functions for your devices into the applet. It should be fairly obvious from the source code how the protocols can be implemented (hint: see lines 565 onwards!)

    Please don't ask me to write functions to support your devices as I can't test them, nor can I magically discover what protocol or codes your devices use!

    NEW VERSION!!
    RC3 is now here and attached below. Changes sinse RC2 are:
    - Fixed bug where an error was logged at startup (didn't affect operation though).
    - KEY_BACK is now usable.
    - NEC Protocol renamed to NECx.
    - New Protocol!! NEC:ddd:sss:ccc. Depending on device, sss may equal ddd (eg Samsung), or may be 255-ddd (eg Yamaha), or may be something completely different (eg Toshiba)! Very similar to the old NEC protocol (now called NECx) but has a different header pulse length and different repeat rate (makes a differemce to some devices, thanks Bluegaspode!).
    - Danish localisation now included (Thanks Pokersut!)

    TO DO:
    - Add error trapping to log and gracefully skip over dodgy lines in SqueezeIRData.txt.
    - Make the applet installable from SqueezeCenter via the SBC applet installer.

    NEW VERSION!
    0.2 Is available from the link below. There are too many changes to mention but they're all in the included ReadMe.txt.

    NEW VERSION!
    0.3 Is available from the link below. See docs\ChangeLog.txt for details.

    NEW VERSION!
    04/02/2010 0.4 (BETA) is available from the link below.
    - Bug fix whereby volume control went haywire when in the SqueezeIR Settings screen.
    - Profiles linked to menus now work through screensaver.
    - Default value of <screensaver> element changed from FALSE to TRUE.

    NEW VERSION
    07/02/2010 0.41 (BETA) is available from the link below.
    - Custom icon for the controller's Home, Extras & Settings menus.

    I don't know if v0.41 will work with 7.3 firmware so v0.4 will remain available until I get confirmation.

    NEW VERSION
    08/02/2010 0.5 (BETA) is available from the link below. Changes are:
    - A <key> element can now contain a <target> element so that any button can open one of your SqueezeIR menus, not just the Go button.
    - The <target> element can now contain the following "special" menus; _HOME (go Home), _Back (go back), _SETTINGS (SqueezeIR settings) as well as the ID of any of your own SqueezeIR menus.

    I don't know if v0.5 will work with 7.3 firmware so v0.4 will remain available until I get confirmation.

    NEW VERSION
    09/05/2010 0.6 (BETA) is available from the link below. Changes are:
    - _HOME Target action fixed.
    - Now works with SBSv7.5 & 7.6.
    - Command & Action pauses and counts now work as expected even if there is only one action.
    - Logging tweaked to circumvent maximum message length in log file.
    - Sample config has been greatly simplified.

    NEW VERSION
    12/05/2010 0.61 (BETA) is available from the link below. Changes are:
    - bug fix involving Pronto codes.

    Have fun!
    indifference_engine
    Last edited by indifference_engine; 2010-05-12 at 11:56. Reason: New Version!

  2. #2
    Senior Member
    Join Date
    Dec 2007
    Posts
    157
    Hey. This looks really cool - but unfortunately I can't get my NAD receiver to react ...

    I have found the relevant IR codes at http://lirc.sourceforge.net/remotes/nad/SR6 and put this line in the SqueezeIRData.txt file:

    Code:
    ROOT ; ACTION ; NAD ; ; ; RAW_HEX:0xA45B ; RAW_HEX:0x13EC
    As far as I can tell, the codes from LIRC are hex-codes, right? So the line above should issue an ON-command on DATA_PRESS and an OFF-command on DATA_HOLD, but nothing happens.

    Do I need to add anything else?

  3. #3
    Senior Member
    Join Date
    Oct 2008
    Location
    Huntingdon, UK
    Posts
    583
    Thanks for your interest!

    It's unfortunate that there's no real standard for descibing ir protocols and it takes a bit of lateral thinking to work out exactly what's going on but I'll try to explain a bit...

    The RAW_HEX protocol that the applet uses takes a great big long string of parameters that looks a bit like this:
    "0x0000ABCD 0x800001234 0x00001234 0x800001234"...

    It is essentially raw binary data that says the led modulation frequency is 0xABCD Hz, turn the led on for 0x1234us, then off for 0x1234us, then on again and so on. This is the format that all the protocols ultimately end up like as it is the format supported by the hardware diver in the SBC (look for testir in the developer forums for more info).

    What is published in LIRC is the command codes and protocol specification (the bit at the top that details how the 1's and 0's are encoded). You need to combine both bits together to get the raw hex, or write a protocol conversion function to do it for you.

    That said, from the LIRC header info, the protocol looks very similar to what I have called DENON (compare the header info with http://lirc.sourceforge.net/remotes/denon/RC-861), so you could try this:

    ROOT ; ACTION ; NAD ; ; ; DENON:135:124:37 ; -DENON:135:124:200

    I took the liberty of adding a "-" before the repeat code as you probably only want to turn the amp off once ;-)

    Incidentally, DENON is actually a slightly modified version of the ubiquitous NEC protocol using the same encoding but with different pulse timings.

    I'll explain how I got those seemingly random numbers...
    The predata from LIRC (0xE1E3) is the bit-reversed first and second parameters (LIRC seems to assume all codes are sent MSB first which is not necessarily the case). The command is the bit-reversed last parameter and then the same again but inverted as a checksum:

    Device = 0xE1 > binary 11100001 > bit reversed binary 10000111 > decimal 135
    SubDevice = 0x3E > 00111110 > 01111100 > 124

    Command = 0xA4 > 10100100 > 00100101 > 37
    checksum = 0x5B > 01011011 (inverse of command, calculated by SqueezeIR).

    Command = 0x13 > 00010011 > 11001000 > 200
    checksum = 0xEC > 11101100 (inverse of command, calculated by SqueezeIR).

    If the denon protocol works for you then that should be all the info you need to convert the LIRC codes into something SqueezeIR can use, and we can add NAD to the list of supported devices!

    I may write a gizmo at some point to convert LIRC formatted codes to RAW_HEX as LIRC seems to be the place to go for codes!

    hope that helps.
    Last edited by indifference_engine; 2009-08-19 at 09:54.

  4. #4
    Senior Member
    Join Date
    Dec 2008
    Posts
    122

    Question Help!!!

    Hi -- I really want to try your app out, but due to my own ignorance I really don't know where to begin (although I have programmed my Pronto TSU7000 and other remotes). A couple of questions -- 1)What is the format of the SqueezeIRData.txt file. I can bring it up but it seems without formatting and is impossible to follow. 2)The Manual Installation on the Wiki is pretty unhelpful --ie. "enable ssh access on the SBC" -- how does one do that? Is installing your app beyond the ken of normal human beings?

    Thanks :-)

  5. #5
    Senior Member
    Join Date
    Oct 2008
    Location
    Huntingdon, UK
    Posts
    583
    Quote Originally Posted by chenrikson View Post
    Hi -- I really want to try your app out, but due to my own ignorance I really don't know where to begin (although I have programmed my Pronto TSU7000 and other remotes). A couple of questions -- 1)What is the format of the SqueezeIRData.txt file. I can bring it up but it seems without formatting and is impossible to follow. 2)The Manual Installation on the Wiki is pretty unhelpful --ie. "enable ssh access on the SBC" -- how does one do that? Is installing your app beyond the ken of normal human beings?

    Thanks :-)
    Hi and thanks for looking.
    The SqueezeIRData.txt file is just plain ascii text but, like most jive applets, it's in unix format (lines are terminated with lf rather than crlf). I'm guessing you're using windows and opening the file in notepad? There's no shame in that (I have vista) but if so, it will look screwy as notepad doesn't like other text formats. I don't think the applet actually cares about line termination so I'll try a windows-formatted version of the file once I get some time and post it if it works, or you can use the excellent Crimson editor which can cope with unix-formatted text files (http://www.crimsoneditor.com/). Crimson is what I used to write the applet btw.

    To enable SSH on the SBC, got to settings>advanced>enable SSH. It will give you a password once activated which you will need later. You will also need the IP address of the SBC which can be got from settings>advanced>diagnostics (I think). Then you'll need WinSCP (http://winscp.net/eng/index.php) to browse the SBC filesystem - it's a bit like ftp or telnet.

    As for entering your codes into SqueezeIR.txt, you shouldn't have too much of a problem if you've done pronto as it's quite similar to RAW_HEX. IIRC, pronto is a string of hex that indicates how many modulation cycles the led is on and off for, whereas RAW_HEX is a string of hex indicating the time (in us) the led is on and off for, prefixed with the modulation frequency (in Hz, in hex)

    Out of interest, what devices are you planning to control?

    Correction:
    "To enable SSH on the SBC, got to settings>advanced>enable SSH" should be settings>advanced>remote login>enable SSH
    "You will also need the IP address of the SBC which can be got from settings>advanced>diagnostics (I think)." That is correct!
    Last edited by indifference_engine; 2009-08-20 at 01:31. Reason: correction

  6. #6
    Senior Member
    Join Date
    Oct 2008
    Location
    Huntingdon, UK
    Posts
    583
    A little bit of interest here which is nice to see!

    I'm working on the next version (RC2) which will address some of the issues people have experienced, namely:
    - Text files have been changed to DOS format (CrLf line termination).
    - "RAW_HEX" Protocol renamed to "NATIVE" to avoid confusion with other "raw hex" protocols.
    - LIRC Protocol added to enable codes from LIRC to be placed straight into SqueezeIRData.txt. This will only cope with some (but probably most) LIRC commands as LIRC is not really a protocol but rather a notation for captured codes.
    - Slight adjustment to the timing within PAN_NEW to make it a bit more reliable.
    - ChangeLog.txt added to keep track of changes!

    There's a few other bits of tidying up I want to do before releasing it but it shouldn't be too far away...

    In the meantime, attached is a DOS formatted version of SqueezeIR.txt to help chenrikson and Windows users to see what's going on.

  7. #7
    Senior Member
    Join Date
    Dec 2007
    Posts
    157
    Quote Originally Posted by indifference_engine View Post
    That said, from the LIRC header info, the protocol looks very similar to what I have called DENON (compare the header info with http://lirc.sourceforge.net/remotes/denon/RC-861), so you could try this:

    ROOT ; ACTION ; NAD ; ; ; DENON:135:124:37 ; -DENON:135:124:200
    It works!

    Thank you for your brilliantly detailed explanation - I actually think I got some of it :-D

    I can now successfully control my NAD receiver, except for the volume which doesn't react. I have added these commands to SqueezeIRData.txt:

    Code:
    #LOC	; TYPE		; TITLE		; POPUP_PRESS	; POPUP_HOLD	; DATA_PRESS		; DATA_HOLD
    ROOT 	; ACTION 	; ON/OFF	; ON		; OFF		; DENON:135:124:37 	; -DENON:135:124:200
    ROOT 	; ACTION 	; AUX		; AUX		; 		; DENON:135:124:155 	; 
    ROOT 	; ACTION 	; CD		; CD		; 		; DENON:135:124:137 	; 
    ROOT 	; ACTION 	; Vol+		; Vol+		; Vol+ 		; DENON:135:124:17 	; DENON:135:124:17
    ROOT 	; ACTION 	; Vol-		; Vol- 		; Vol-		; DENON:135:124:35 	; DENON:135:124:35
    ON/OFF, AUX and CD commands work, but not Vol+ and Vol-. Have I done something wrong ...? The corresponding LIRC codes are 0x11EE and 0x31CE.

    Two additional questions:

    1) Can I somehow strengthen the level of the IR signal? At the moment, the SBC works exactly like the native NAD remote in the sense that you have to point it straight towards the receiver for it to work. It would be cool if you could adjust the signal strength, but I suspect that the limitation may be in the IR receiving unit in the receiver ...

    2) Is it possible to issue multiple commands with one buttton press, e.g. make a "Turn on and switch to AUX"-command?

    Thanks for all your work - can't wait to see RC2.

  8. #8
    Senior Member
    Join Date
    Oct 2008
    Location
    Huntingdon, UK
    Posts
    583
    Quote Originally Posted by Pokersut View Post
    It works!

    Thank you for your brilliantly detailed explanation - I actually think I got some of it :-D

    I can now successfully control my NAD receiver, except for the volume which doesn't react. I have added these commands to SqueezeIRData.txt:

    Code:
    #LOC	; TYPE		; TITLE		; POPUP_PRESS	; POPUP_HOLD	; DATA_PRESS		; DATA_HOLD
    ROOT 	; ACTION 	; ON/OFF	; ON		; OFF		; DENON:135:124:37 	; -DENON:135:124:200
    ROOT 	; ACTION 	; AUX		; AUX		; 		; DENON:135:124:155 	; 
    ROOT 	; ACTION 	; CD		; CD		; 		; DENON:135:124:137 	; 
    ROOT 	; ACTION 	; Vol+		; Vol+		; Vol+ 		; DENON:135:124:17 	; DENON:135:124:17
    ROOT 	; ACTION 	; Vol-		; Vol- 		; Vol-		; DENON:135:124:35 	; DENON:135:124:35
    ON/OFF, AUX and CD commands work, but not Vol+ and Vol-. Have I done something wrong ...? The corresponding LIRC codes are 0x11EE and 0x31CE.

    Two additional questions:

    1) Can I somehow strengthen the level of the IR signal? At the moment, the SBC works exactly like the native NAD remote in the sense that you have to point it straight towards the receiver for it to work. It would be cool if you could adjust the signal strength, but I suspect that the limitation may be in the IR receiving unit in the receiver ...

    2) Is it possible to issue multiple commands with one buttton press, e.g. make a "Turn on and switch to AUX"-command?

    Thanks for all your work - can't wait to see RC2.
    It's great that it's not just me that it works for!
    OK, the easy bits first.
    1) I've noticed that too but I think it's to do with the width of the beam rather than the power. I doubt anything can be done about it though and there's no documentation about increasing the emitter power or beam-width. It's probably a limitation of the hardware but maybe a future version of the SBC firmware may allow me to do something...

    2) YES! Just put all the commands in seperated by a comma. There's examples of this in the sample SqueezeIRData.txt file. eg To turn the player on and select aux you'd put the following into the DATA_PRESS field:
    Code:
    DENON:135:124:37,DENON:135:124:155
    If the aux command is being sent too soon (eg before the amp has powered up properly) then you can introduce a delay between the commands by adding more commas. Each comma represents 200 ms, so for a 1 second delay it would be:
    Code:
    DENON:135:124:37,,,,,DENON:135:124:155
    Regarding problems with the volume, it looks like your maths is wrong. I forgot to mention that in the DENON protocol each field is 8-bit so you must pad the binary with leading zeroes:
    Code:
    Vol+ = 0x11EE (ignore the EE, it's a checksum)
    0x11 > 00010001 > 10001000 > 136
    
    Vol- = 0x31CE (ignore the CE, it's a checksum)
    0x31 = 00110001 > 10001100 > 140
    You may want to try prefixing the volume commands in the DATA_HOLD field with '+' as it might provide a smoother response when holding the key down. Try it and see. The '+' prefix instructs SqueezeIR to mimic a true hold of a button, without the prefix it mimics pressing the button repeatedly every 200ms. Also, don't forget that you can use the physical volume keys on the SBC to control the volume by changing the TYPE field to 'KEY' and the TITLE field to KEY_VOLUME_UP or KEY_VOLUME_DOWN. You can also have KEY_VOLUME_MUTE which corresponds to pressing both volume keys on the SBC simultaneously.

    I also forgot to mention (but you must have worked it out) that if you change the SqueezeIR.txt file then you must restart your SBC for the changes to take effect.

    Version RC2 is not going to be that different from RC1 from a usage point of view but it will allow people without a maths PhD to enter (some, probably most) commands from LIRC!

    My "holy grail" is to get the Back key working so you can open a sub-menu and fire a command to turn something on and then when you go back it can turn it off again. Would be good for setup modes, TV guide etc. That may be sometime off though as the back key seems to work very differently to the others and I haven't made any progress figuring it out.

  9. #9
    Senior Member
    Join Date
    Dec 2007
    Posts
    157
    Quote Originally Posted by indifference_engine View Post
    It's probably a limitation of the hardware but maybe a future version of the SBC firmware may allow me to do something...
    Well, as long as the original remote behaves the same way, I don't expect there is much you can do - then NAD would probably have done it.

    I have been using Bang & Olufsen equipment for many years, and as far as I know they operate with higher(?) IR frequencies, which means that you can control your music system, tv, whatever from almost anywhere, no matter where you point your remote, so I'm probably just spoiled in that sense!

    2) YES! Just put all the commands in seperated by a comma. There's examples of this in the sample SqueezeIRData.txt file. eg To turn the player on and select aux you'd put the following into the DATA_PRESS field:
    Code:
    DENON:135:124:37,DENON:135:124:155
    I knew I had seen it somewhere, but somehow I couldn't find it again - your code works brilliantly (though I had to add a 2 second pause between the commands).

    Regarding problems with the volume, it looks like your maths is wrong. I forgot to mention that in the DENON protocol each field is 8-bit so you must pad the binary with leading zeroes:
    Excellent - I didn't know about the 8 bit lenght, but everything works with the ammended code (and the + sign)!

    Version RC2 is not going to be that different from RC1 from a usage point of view but it will allow people without a maths PhD to enter (some, probably most) commands from LIRC!
    Admittedly, that would have made it somewhat easier for me. Luckily I had you to guide me :-D

    My "holy grail" is to get the Back key working so you can open a sub-menu and fire a command to turn something on and then when you go back it can turn it off again. Would be good for setup modes, TV guide etc. That may be sometime off though as the back key seems to work very differently to the others and I haven't made any progress figuring it out.
    I wish I could help - but I can't :-(

    Thanks for a great app - I'm sure this will be useful to a lot of people and add even more wow-effect to a lot of SBC's!

  10. #10
    Senior Member
    Join Date
    Oct 2008
    Location
    Huntingdon, UK
    Posts
    583
    Quote Originally Posted by Pokersut View Post
    I have been using Bang & Olufsen equipment for many years, and as far as I know they operate with higher(?) IR frequencies, which means that you can control your music system, tv, whatever from almost anywhere, no matter where you point your remote, so I'm probably just spoiled in that sense!
    That surprises me. I was always under the impression that higher frequencies were more directional (eg FM radio vs TV vs satellite signals). Maybe they just use super high-powered emitters in their remotes?

    Quote Originally Posted by Pokersut View Post
    I knew I had seen it somewhere, but somehow I couldn't find it again - your code works brilliantly (though I had to add a 2 second pause between the commands).
    That's a long time! My Marantz amp takes ages to produce sound after being turned on but accepts remote commands almost instantly. Maybe yours is the same? - I think my pause is around 600ms.

    Quote Originally Posted by Pokersut View Post
    Thanks for a great app - I'm sure this will be useful to a lot of people and add even more wow-effect to a lot of SBC's!
    No worries, I'm glad you like it. Incidently, I now have (limited) support for LIRC data, and I've got the back key working (I think!) but for some reason it won't do the popups :-( It's a minor niggle so the next version may be released with that issue still there.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •