http://mightyohm.com/forum/viewtopic.php?f=2&t=413&p=1897 ------------ MightyOhm.com Create, share, discuss. Join the resistance. Skip to content Advanced search Board index ‹ Project Forums ‹ Wifi Radio Project / Hacking the Asus WL-520gU Change font size Print view FAQRegisterLogin Adding an infrared remote: lirc + mic input Post a reply 9 posts • Page 1 of 1 Adding an infrared remote: lirc + mic input by danitool » Wed Jul 13, 2011 4:13 pm First of all I'm using a bcm63xx board (livebox dv4210). The Openwrt version I'm using is one of latest trunks: bleeding edge, r27198 The board has not many differences with the wl-520gu, small ram (16 MiB), small processor (mips 256 MHz), one usb 1.1, and a b43 minipci wifi with opensource drivers ( it works quite fine in latest trunks). For getting it work i used this schematic for the IR receiver: http://files.myopera.com/danitool/liveb ... rcalsa.jpg Probably you don't need to solder the mic input ground, because the usb is already grounded to it and shares the ground with the board, I didn't and it works. Consequently you only need to solder one wire to the usb card. Or if you prefer make an external receiver to plug it with a stereo jack, I did it the first time for testing, but I don like stuff hanging on the board, so finally i fitted it inside my router. The second thing is to prepare the lirc package. Unfortunatelly the receiver type is hardcoded into the makefile package, and in the trunk I'm using there are some lost utilities, I fixed it, this is the makefile and my files for the lirc package (located under trunk/feeds/packages/utils/lirc/) , it includes my remote keys, and irexec commands for the remote. http://files.myopera.com/danitool/liveb ... ackage.zip Because the new mpd is fat as a cow, and my board has little resources, I ported and striped mpd 0.13.2 to this trunk I'm using. (trunk/feeds/packages/sound/mpd/) http://files.myopera.com/danitool/liveb ... ackage.zip Finally I compiled unselecting stuff I don't need (ie: I dont need ssh or iptables..). You know mpd is a RAM eater, little kernels, and elimiating daemons will give you more available ram. Ok for making the receiver work first lets launch the lircd: CODE: SELECT ALL lircd --driver=audio_alsa -d plughw@12000 You need to calibrate the reception, it can be done adjusting the Mic input in alsamixer (capture devices pressing F4). For me putting Mic to 62 does the job. You can set it with the command: CODE: SELECT ALL amixer set Mic capture 62% launch the irexec daemon for executing the stuff you want on receiving IR signals: CODE: SELECT ALL irexec --daemon /etc/wifiradio/lircrc I used spare parts for the Ir circuit, also the remote is an unused one I had (almost every remote can work with alsa), Then the cost was 0 € for me, except some hours of fun . Ok, all working fine, I can select internet radios with the remote and I love it, isn't it cool?. Also as an extra and because I didnt build the lcd panel I added the package ssmtp, associated with a button at the remote. When I listen a cool song i like i press that button and automagically my wifiradio sends an email to my account with the title of the song, artist, etc. Also I soldered a buzzer to a gpio, for beeping on some events (just fun). and this is the result I can provide more details if someone interested danitool Posts: 8 Joined: Tue Dec 01, 2009 12:02 pm Top Re: Adding an infrared remote: lirc + mic input by gerben » Thu Jul 14, 2011 11:48 am Very cool. Didn't know it was possible to use the mic for IR input. I would love IR on my radio, but I think this is solution is way over my noob-head. Thanks for sharing though. I love it. gerben Posts: 24 Joined: Sat Oct 16, 2010 11:41 am Location: Netherlands Top Re: Adding an infrared remote: lirc + mic input by Muffinman » Sun Jul 17, 2011 4:22 am http://www.machoe.com/wp-content/upload ... remote.jpg Can I use an Apple Remote? Muffinman Posts: 17 Joined: Thu Mar 03, 2011 4:51 pm Top Re: Adding an infrared remote: lirc + mic input by danitool » Sun Jul 17, 2011 4:37 am Almost every remote should work. BTW I've read the ones which uses rc5 protocol are more convenient for lircalsa. Here is a list of working remotes with lirc: http://lirc.sourceforge.net/remotes/ If you don't find yours in the list, you'll can record your keys with the lirc receiver. danitool Posts: 8 Joined: Tue Dec 01, 2009 12:02 pm Top Re: Adding an infrared remote: lirc + mic input by dext3r » Fri Sep 09, 2011 2:29 pm danitool (and anyone else who can help!), I am trying to add the lirc package to my OpenWRT developer setup but i am having the WORST luck. I have the sources for 8.09. I put your Makefile into CODE: SELECT ALL /feeds/packages/utils/lirc and i run CODE: SELECT ALL make menuconfig but it doesn't show up in the package list! I tried a different makefile from here: https://forum.openwrt.org/viewtopic.php?id=13339 CODE: SELECT ALL # # Copyright (C) 2006 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # # $Id: Makefile 5624 2007-09-04 00:29:07Z Dottout $ include $(TOPDIR)/rules.mk # we use the $LINUX_DIR variable, which is defined in kernel.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=lirc PKG_VERSION:=0.8.3pre1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://lirc.sourceforge.net/software/snapshots PKG_CAT:=bzcat PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install include $(INCLUDE_DIR)/package.mk define Package/lirc/Default SECTION:=utils CATEGORY:=Utilities URL:=http://lirc.org/ endef define Package/lirc $(call Package/lirc/Default) TITLE:=LIRC - Linux Infrared Remote Control MENU:=1 endef define Package/lirc/description LIRC is a package that allows you to decode and send infra-red signals of many (but not all) commonly used remote controls. This package contains only lircd and lircd.conf! endef define Package/lircdaemonadd $(call Package/lirc/Default) DEPENDS:=lirc TITLE:=Daemon Additional Files endef define Package/lircdaemonadd/description Contains those additional daemon-tools: -irrecord -lircmd endef define Package/lirctools $(call Package/lirc/Default) DEPENDS:=lirc TITLE:=LIRC tools endef define Package/lirctools/description This package contains those lirc-tools: -ircat: prints config strings to standard output, can be used to provide remote control input to scripts -irexec: execute programs according to the pressed remote control buttons -irpty: pseudo tty driver. Connects to lircd via socket to receive infra-red codes and converts them to key strokes -irsend: application for sending IR-codes via lirc -irw: watch the codes as lircd recognize them -lircrcd: daemon that manages current mode for all applications -mode2: shows the pulse/space length of a remote button endef # --with-driver="all" \ CONFIGURE_ARGS += \ --disable-nls \ --disable-static \ --with-kerneldir="$(LINUX_DIR)" \ --with-driver="alsa_usb,sir" \ --without-x \ --with-pic \ --with-gnu-ld \ --enable-sandboxed \ define Package/lirc/conffiles /etc/lircd.conf endef MAKE_FLAGS += \ DESTDIR="$(PKG_INSTALL_DIR)" \ all \ define Package/lirc/install $(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemons/lircd $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc $(INSTALL_CONF) $(PKG_BUILD_DIR)/contrib/lircd.conf $(1)/etc/ endef define Package/lircdaemonadd/install $(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemons/irrecord $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemons/lircmd $(1)/usr/sbin/ endef # $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemons/{lircmd,irrecord} $(1)/usr/sbin/ define Package/lirctools/install $(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/ircat $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/irexec $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/irpty $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/irsend $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/lircrcd $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/irw $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mode2 $(1)/usr/sbin/ endef $(eval $(call BuildPackage,lirc)) $(eval $(call BuildPackage,lircdaemonadd)) $(eval $(call BuildPackage,lirctools)) and this shows up in the menu...so I select to build package... CODE: SELECT ALL make[3]: Entering directory `/home/dext3r/8.09/feeds/packages/utils/lirc' Makefile:124: *** missing separator. Stop. ...which means I need TAB at line 124, right? I add a TAB... CODE: SELECT ALL dext3r@dext3r-VirtualBox:~/8.09$ make menuconfig Collecting package info: package/feeds/packages/lircERROR: please fix package/feeds/packages/lirc/Makefile ...and it won't show up in the menu again! WTF! dext3r Posts: 7 Joined: Thu Nov 18, 2010 2:32 am Top Re: Adding an infrared remote: lirc + mic input by danitool » Fri Sep 09, 2011 5:49 pm Don't use my makefile for an older version of Openwrt. Try to install lirc instead: CODE: SELECT ALL ./scripts/feeds update -a ./scripts/feeds install lirc lirctools lircdaemonadd Then modify the makefile CODE: SELECT ALL --with-driver="audio_alsa" Btw, I don't know if lirc-alsa works in that old Openwrt version. Good luck danitool Posts: 8 Joined: Tue Dec 01, 2009 12:02 pm Top Re: Adding an infrared remote: lirc + mic input by dext3r » Fri Sep 09, 2011 7:19 pm thanks for your response! danitool wrote: Don't use my makefile for an older version of Openwrt. Try to install lirc instead: CODE: SELECT ALL ./scripts/feeds update -a ./scripts/feeds install lirc lirctools lircdaemonadd Then modify the makefile CODE: SELECT ALL --with-driver="audio_alsa" i think i did this originally but then it never showed up in the menuconfig menu...i'm gonna delete some stuff and try fresh... Btw, I don't know if lirc-alsa works in that old Openwrt version. Good luck no worries, i need to patch it for a different driver anyways. dext3r Posts: 7 Joined: Thu Nov 18, 2010 2:32 am Top Re: Adding an infrared remote: lirc + mic input by dext3r » Fri Sep 09, 2011 8:39 pm dang, it didnt work. i deleted the lirc directory from feeds/packages/util and then re-updated from the feeds (feeds update -a) to make sure i had an 'unfcked with' version did CODE: SELECT ALL ./scripts/feeds/install lirc lirctools lircdaemonadd went off without a complaint... ...then running: CODE: SELECT ALL menu makeconfig ..and lirc doesn't show up in the list of packages to build. hrm.. (it sucks i have to use this old version of openwrt...backfire isn't compatible with my router ) dext3r Posts: 7 Joined: Thu Nov 18, 2010 2:32 am Top Re: Adding an infrared remote: lirc + mic input by dext3r » Tue Sep 13, 2011 4:41 pm i noticed backfire DOES work with my router. i grabbed backfire RC5 from the sources and eventually figured out how to build all this stuff. i have lirc working now with my USB IR Toy from Dangerous Prototypes dext3r Posts: 7 Joined: Thu Nov 18, 2010 2:32 am Top Display posts from previous: Sort by Post a reply 9 posts • Page 1 of 1 Return to Wifi Radio Project / Hacking the Asus WL-520gU Jump to: WHO IS ONLINE Users browsing this forum: Yahoo [Bot] and 3 guests Board indexThe team • Delete all board cookies • All times are UTC - 6 hours [ DST ] Powered by phpBB® Forum Software © phpBB Group