AlmightyTech
Posts: 24
Joined: Thu Oct 11, 2012 11:16 am

Re: LIRC GPIO driver for homebrew adapter

Sun Nov 03, 2013 6:56 am

rwcherry wrote:
AlmightyTech wrote:I cant attach whole file so..
download
http://www.ostan.cz/IR_protocol_analyzer/
and load the attached sample..
In looking at your data & spreadsheets, it would appear that Mitsubishi & YMGI heat pumps use the same controllers/protocol; so I am very interested in your status & progress. Last summer I did some reverse engineering and made some notes, attached as a .pdf here. (pdf not allowed?)
hi,,
you can attach pdf file by zip. make zip than upload.
my code is 144 bit long. and now i can send it. and it works fine..
special thanks to MBA.
now ahead...
does anyone try or test lirc on beaglebone black..??????
I am really very interested...

rwcherry
Posts: 10
Joined: Mon Oct 28, 2013 3:37 am

Re: LIRC GPIO driver for homebrew adapter

Sun Nov 03, 2013 1:07 pm

I now have Raspberry Pi with LIRC able to send 4 commands to my hangar heat pump:
OFF
AUTO_ON
HEAT_ON
COOL_ON
These are 'captured' streams. I still have not fully reverse engineered the bit stream, in particular the checksum at the end.

rwcherry
Posts: 10
Joined: Mon Oct 28, 2013 3:37 am

Re: LIRC GPIO driver for homebrew adapter

Sun Nov 03, 2013 7:31 pm

"hi,,
you can attach pdf file by zip. make zip than upload.
my code is 144 bit long. and now i can send it. and it works fine..
special thanks to MBA.
now ahead..."

I am still interested in more details. Have you reverse engineered all 144 bits? If so, can you send me the results?

How do you create the 144 bits you send?

Thanks

AlmightyTech
Posts: 24
Joined: Thu Oct 11, 2012 11:16 am

Re: LIRC GPIO driver for homebrew adapter

Tue Nov 05, 2013 8:54 am

rwcherry,
I already upload all my detail in this forum.
see page 7 .and you may download my files..
and to send code more than 64 bit, you have to make your own code.(change in lirc code).
just do some mathematics to calculate check-sum.
.

rwcherry
Posts: 10
Joined: Mon Oct 28, 2013 3:37 am

Re: LIRC GPIO driver for homebrew adapter

Tue Nov 05, 2013 2:37 pm

I have already dowloaded your files and they do not contain the detail I'd like to see.
I'm not changing code for LIRC as mine works as it is.
Math to create checksum? What is the formula? (detail)
No description of the process, so I will assume you know what all 144 bits mean and you juts create the command by hand and then calculate a checksum with 'math'.

Thanks

Hendrikh3
Posts: 3
Joined: Sat Nov 16, 2013 11:40 am

Re: LIRC GPIO driver for homebrew adapter

Mon Nov 25, 2013 11:15 am

Hi,

I have a problem with irsend.
I'm using raspbmc, on that lirc is being installed
and I'm able to receive InfraRed Signals and save them into the lircd.conf with irrecord.

The testing tool irw also shows me the content (e.g. ... KEY_POWER2 ...) of the lircd.conf by pressing the button of my remote control.

Sending the command "irsend SEND_START FB KEY_POWER2" the infrared-diode remains off. But no errors occured. I tried also to control it manually with 'echo "1" > /sys/class/gpio/gpio24/value' and the diode turned constantly on.

My /etc/lirc/hardware.conf:

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--uinput" # I set both, --uinput and --listen.

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Don't start irexec, even if a good config file seems to exist.
#START_IREXEC=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="default"

# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""

I also set lirc_rpi gpio_in_pin=18 gpio_out_pin=24

Does anyone has a solution or idea for me?

Thanks.

cira
Posts: 4
Joined: Thu Oct 17, 2013 1:47 am

Re: LIRC GPIO driver for homebrew adapter

Tue Nov 26, 2013 3:01 am

@Hendrikh3

Have you tried to point irsend directly at the output of the lircd? ie.

Code: Select all

irsend -d <path to lircd output> SEND_ONCE <remotename> <your remote key name>
For example I have lircd outputting to /var/run/lirc/lircd-lirc0 and a remote named DELL in my lirc.conf and my power on key is named "key_power"

So my command is

Code: Select all

irsend -d /var/run/lirc/lircd-lirc0 SEND_ONCE DELL key_power

electronbelt
Posts: 1
Joined: Sun Dec 01, 2013 4:57 pm

Re: LIRC GPIO driver for homebrew adapter

Sun Dec 01, 2013 5:12 pm

I've been tinkering with LIRC and it works great. However, I've noticed that if I'm doing something else on the PI audio wise, like streaming music, when I issue a irsend command the audio is interupted untill the command physically completes.

I can interact with the GPIOs in other ways as well as loadup/use the PI in general without any interuptions to the audio. It's so far only when I call on LIRC that it happens.

Any tips on where I should be looking?
Thanks.

Code: Select all

(Raspbian with current firmware)Linux raspberrypi 3.10.19+ #600 PREEMPT Sat Nov 16 20:34:43 GMT 2013 armv6l GNU/Linux

User avatar
mrgrey
Posts: 11
Joined: Tue Jul 17, 2012 12:32 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Dec 05, 2013 10:45 am

Hi all!

I'm having some weird problems with my gpio-lirc-setup, described here:

http://www.raspberrypi.org/phpBB3/viewt ... 34#p461334

Feedback/Opinions/Tips greatly appreciated.

regards,

chris

FlyingSander
Posts: 1
Joined: Mon Dec 09, 2013 8:20 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Dec 09, 2013 8:31 pm

Hello,

I have tried to setup LIRC but when i try mode2 to decode IR signals it doesn't show any pulses/spaces. I tripple checked if I wired the receiver correctely. I'm using TSOP31236 (38Khz) and RPi2 + Debian... I followed all stepts on http://alexba.in/blog/2013/01/06/settin ... spberrypi/ but when I am running mode2 It doesn't show any pulses/spaces, does someone has a clue how to fix this issue? I also tried multiple remotes BTW...

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Fri Jan 17, 2014 5:16 pm

I am sure this has came up but I missed it is it possible to have say 2 it emitters on 2 GPO pins and send them seperate codes? I have 4 devices I wish to control but 2 are the same model and I don't want to send them the same commands every time.

Thanks,
Yonu

elmicha
Posts: 26
Joined: Tue Jul 03, 2012 4:43 pm

Re: LIRC GPIO driver for homebrew adapter

Fri Jan 17, 2014 5:36 pm

yonubear wrote:is it possible to have say 2 it emitters on 2 GPO pins and send them seperate codes?
Yes, it's possible, search for "Bengt Martensson" in this thread. The last time I checked you still had to compile his version of the module on your own.

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Jan 20, 2014 12:05 am

Thanks for the quick reply I found the
C file but I have to be stupid now how do I compile it and so I install the normal LIRC first?

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Sat Feb 01, 2014 3:53 pm

would anyone mind helping me with the compile of the Bengt Martensson multi transmitter driver I m at a total lose how to compile and install it.

Thank,
Yonubear

elmicha
Posts: 26
Joined: Tue Jul 03, 2012 4:43 pm

Re: LIRC GPIO driver for homebrew adapter

Sun Feb 02, 2014 1:32 pm

You can use the RPi Kernel Compilation Guide from the Wiki. Or see if the attached kernel module for 3.10.28+ works.
Attachments
lirc_rpi.zip
Bengt Martensson's multi transmitter lirc_rpi.c + minor fixes for kernel 3.10, and lirc_rpi.ko for kernel 3.10.28+.
(13.96 KiB) Downloaded 272 times

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Sun Feb 02, 2014 3:59 pm

hey question I have the file in and am waiting to see if it works after rebooting but just for good measure which pin numbers does it use bcm, board, or wiringpi?

elmicha
Posts: 26
Joined: Tue Jul 03, 2012 4:43 pm

Re: LIRC GPIO driver for homebrew adapter

Sun Feb 02, 2014 5:08 pm

BCM, like the original.

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Sun Feb 02, 2014 6:11 pm

ok thanks I get no errors other than irsend telling me that it doesn't support multiple transmitters so I guess I am back to reading

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Feb 03, 2014 3:18 am

ok turns out I had the files in the wrong plce now I get failed on lirc start however I am on kernel 3.10.25+ can I simply upgrade to 3.10.28+ to solve the problem it did I need to attempt to compile it on my pi?

yonu

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Feb 03, 2014 4:09 am

I went ahead and updated the kernal to 28+ but I still get failed on lirc starting on kernel modules and kernel modules in hardware.conf

GeofP
Posts: 26
Joined: Fri Jan 31, 2014 9:59 am
Location: NE Hampshire UK

Re: LIRC GPIO driver for homebrew adapter

Thu Feb 06, 2014 11:51 am

elmicha wrote:
yonubear wrote:is it possible to have say 2 it emitters on 2 GPO pins and send them seperate codes?
Yes, it's possible, search for "Bengt Martensson" in this thread. The last time I checked you still had to compile his version of the module on your own.
An atlernaitve to modifying the lirc software would to drive 2 IR LEDs from one GPIO pin and use another GPIO pin to disable the one you don't want to transmit.
ir_led circuit.jpg
ir_led circuit.jpg (41.63 KiB) Viewed 5322 times
In my circuit, both the IR LED driver transistors go to GPIO 17. IR LED 'A' is disabled using GPIO 22. IR LED 'B' is disabled using GPIO 27.
The default condition for GPIO pins 22 and 27 is as an input and is high impedance.
When one of these pins is configured as an output, it switches to 0V and disables the IR LED drivers.
Note that the resistor values are chosen to work for this particular circuit. Circuits with a lower base resistor would need a different configuration.

I use the following bash script to control the GPIO pins with irsend to send a command to my satellite receiver:

Code: Select all

# foxsat-hdr is a satellite receiver with commands as defined in lircd.conf
# pass the command for foxsat-hdr to variable $ir-command e.g. key_power
# pass A or B to variable $ir_led the select the required IR LED transmitter

if [ "$ir_led" = "B" ]; then

        # disable ir tranmitter to IR LED A
        pin=22

elif [ "$ir_led" = "A" ]; then

        # disable ir tranmitter to IR LED B
        pin=27
fi

# disable ir transmitter
echo $pin > /sys/class/gpio/export
sleep 1  # to give time for export to complete
echo out > /sys/class/gpio/gpio$pin/direction # drives GPIO pin low

irsend send_once foxsat-hdr $ir_command

# re-enable ir transmitter
echo in > /sys/class/gpio/gpio$pin/direction # drives GPIO pin high impedance as an input
echo $pin > /sys/class/gpio/unexport


yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Feb 06, 2014 11:04 pm

ok I found my kernel issue but I am at a loss at how to fix it. Everytime i put the the lirc_rpi.ko int he rc folder it is erased after I reboot. Sorry I am new with dealing with kernels

Thanks,
Yonu

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Wed Feb 12, 2014 11:34 pm

ok I will more than likely get flamed for this but I have to ask why is it like pulling teeth to get any help with something that I assume is rather simple if you know what you are doing.

GeofP
Posts: 26
Joined: Fri Jan 31, 2014 9:59 am
Location: NE Hampshire UK

Re: LIRC GPIO driver for homebrew adapter

Thu Feb 13, 2014 10:25 am

Hi yonubear . Where are you putting the lirc_rpi.ko?

I have also tried some experiments with the Bengt Martensson lirc_rpi.ko, using the compiled copy from his web site, http://harctoolbox.org/lirc_rpi.html, (which I think is the same as in the zip file on the Feb 02 post above). I haven't been able to get it working.

I don't know much about kernels but searched in my pi software to see where the file was, as follows:

sudo find / -name lirc_rpi.ko
This produced the following output:

/lib/modules/3.10.25+/kernel/drivers/staging/media/lirc/lirc_rpi.ko
/lib/modules/3.6.11+/kernel/drivers/staging/media/lirc/lirc_rpi.ko
/lib/modules/3.10.28+/kernel/drivers/staging/media/lirc/lirc_rpi.ko
/root/.rpi-firmware/modules/3.10.28+/kernel/drivers/staging/media/lirc/lirc_rpi.ko

I think the 1st 3 lines are as a result of various apt-get installs that I had performed previously.

I made a back-up copy of the lirc_rpi.ko file in the last line. File size was 18192
I copied the Bengt Martensson file into /root/.rpi-firmware/modules/3.10.28+/kernel/drivers/staging/media/lirc/. File size was 20006
I then did a reboot and watched the console messages. All seemed OK.
The file size at /root/.rpi-firmware/modules/3.10.28+/kernel/drivers/staging/media/lirc/ was still 20006.
I did the following to find out if the Bengt Martensson lirc_rpi.ko file works

Modify the /etc/modules file:
sudo nano /etc/modules

change last line from
lirc_rpi gpio_in_pin=23 gpio_out_pin=17
to
lirc_rpi gpio_in_pin=23 gpio_out_pins=18,17

Did a reboot and noticed the console messages reported lirc_rpi '18,17' invalid argument for 'gpio_out_pins'
changed it to 17,24 and 17, 18 and just 17, none of these worked.

I have stopped working on this problem for the moment since I have a solution for 2 IR transmitters as posted Feb 06 above. However, I would really like to know how to make it work!

yonubear
Posts: 89
Joined: Thu Sep 12, 2013 11:11 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Feb 13, 2014 5:08 pm

thanks for the response I hadn't even thought about doing qa search for the ko file to see if there were any others in the system

if I figure it out I will let you know.

Thanks,
Yonu

Return to “HATs and other add-ons”