LaFonera Hardware IR Receiver

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:06, 25 November 2007 (edit)
Wildblue (Talk | contribs)
(added new contend)
← Previous diff
Current revision (12:06, 14 May 2010) (edit) (undo)
Glenn (Talk | contribs)
(-cat)
 
(3 intermediate revisions not shown.)
Line 1: Line 1:
 +
 +[[Category:LaFonera_Hardware_(en)]]
 +You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[LaFonera_(en)|LaFonera]] / [[:Category:LaFonera_Hardware_(en)|Hardware]] / IR Receiver'''
 +
 +
= La Fonera with IR receiver = = La Fonera with IR receiver =
Line 86: Line 91:
Ugly, i know. But it works. Ugly, i know. But it works.
 +
 +
 +
 +==Refrences==
 +
 +* http://www.lefinnois.net/wpen/index.php/2007/11/04/la-fonera-with-ir-receiver/
 +
 +
 +
 +----
 +
 +this page was made by [[User:wildblue|wildblue!]]

Current revision

You are here: DD-WRT wiki mainpage / LaFonera / Hardware / IR Receiver


[edit] La Fonera with IR receiver

Using DIY IR receiver with GNU/Linux is quite simple. All you need is a TSOP receiver, a diode, a resistor and a78L05 regulator as explained here. But this wont work with USB/serial adapter and it need a kernel module to directly drive DCD line.

But there is Paul Fox’s avrlirc project, using AVR Attiny2313 to connect IR receiver to the serial RX line. It can be used with USB/serial and embedded system with simple serial port like… La Fonera.


Image:LaFonera_Hardware_IR_Receiver_-_01_pcb.jpg


Hardware part is very simple. You need an AVR Attiny2313 from Atmel, a TSOP1736 receiver, a 14.7475 Mhz quartz, 22pf ceramic capacitors and, if you want, led and 330 Ohm resistor. You can also use internal 8 Mhz resonator from the AVR (low speed, 9600bps) but you will get better results with a quartz (115200bps, see page 140 of the Attiny2313 datasheet).

Beware ! Never connect AVR to serial TX of RS232 interface. Voltages are very different. You may burn the AVR. You can use a MAX232 circuit to connect the AVR and RS232 or use you homemade Fonera console adapter to convert TTL/RS232. See Paul’s code for more information.

Software is in two parts. First you have the firmware for the AVR. Configure sources like explained by Paul, compile and burn the AVR Flash with AVRdude. Second part is avrlirc2udp. It’s the host part that run on your computer, listen the serial port and send IR data to lircd.


Register new remote with :

 % ./avrlirc2udp -H -t /dev/ttyUSB0 -h localhost

Then :

% sudo irrecord --driver=udp my_file

Just follow what’s appear on the screen and copy the generated file to /etc/lirc/lircd.conf then configure /etc/lirc/hardware.conf :

LOAD_MODULES=false
DRIVER="udp"
DEVICE="none"


Create your ~/.lircrc to associate buttons and actions for softwares that’s support Lirc (xmms, mplayer, etc). Everything work via UDP and you can run Paul’s code on one computer and Lirc demon on another. Because of using RX serial line, we can run Paul’s code on La Fonera.


Image:LaFonera_Hardware_IR_Receiver_-_02_overview.jpg


Look at the serial console connector inside the router :


Image:LaFonera_Hardware_IR_Receiver_-_03_serial_pinout.gif


Just connect pin 3 of the AVR to RX pin, add the ground and get +5V from inside the router, close to the power connector. You cannot use Vcc here, it’s +3.3V.


You need to build a new OpenWRT from source to deactivate serial console :

  • Configure the kernel by make kernelconfig and change default kernel command string, deleting console use (Kernel Hacking / Default kernel command string).
  • In the kernel configuration too, remove serial console : Device Drivers / Character devices / Serial drivers / Console on 8250/16550 and compatible serial must be unchecked.
  • Remove serial login support by deleting the ttyS0 line in package/base-files/files/etc/inittab.


Build and upload the firmware via RedBoot. After the first boot you can login with Telnet. Add password for root, this remove telnet support and add SSH.


Configure ipkg and install avrlirc2udp :


And run :

avrlirc2udp -H -t /dev/ttyS0 -h 192.168.0.1

You can still use RedBoot with serial port at boot time. But, if you want you can use IP by contacting RedBoot on port 9000 via telnet. You need to send ^C to stop the boot process :

% cd /tmp
% cat > break
[CTRL+V][CTRL+C][Entrée]
[CTRL+D]

then

% nc -vvv 192.168.0.12 9000 < break; telnet 192.168.0.12 9000


Ugly, i know. But it works.


[edit] Refrences



this page was made by wildblue!