bschwind / ir-slinger

A small C library for sending infrared packets on the Raspberry Pi
The Unlicense
99 stars 30 forks source link

Need help #4

Closed goloveychuk closed 8 years ago

goloveychuk commented 8 years ago

Hi, I working on little homekit project. Want to control air cond.

I made all except sending codes. Just can't make it working. When I run example.c it don't work (signals are going, tested with led). But when I copy exactly same codes to lircd.conf, reload lirc service and run irsend - it works. Conditioner is reacting. With same codes by irslinger.h (it changed from your's one). Could you please help, don't know where is mistake. https://github.com/goloveychuk/homekit/blob/master/cond/example.c https://github.com/goloveychuk/homekit/blob/master/cond/irslinger.h

bschwind commented 8 years ago

Hey, thanks for trying out the library! I'll take a look at your code and get back to you soon.

bschwind commented 8 years ago

Could you paste your lircd.conf here? I feel like the most likely issue is something to do with a trailing pulse, or a lack of one. Otherwise the modifications you made to my code seem correct.

goloveychuk commented 8 years ago

I'm on phone now, could send in half of hour. But in lircd.conf i have exact numbers from array, separated by space, in raw-codes section On Sat, Aug 13, 2016 at 8:43 PM Brian Schwind notifications@github.com wrote:

Could you paste your lircd.conf here? I feel like the most likely issue is something to do with a trailing pulse, or a lack of one. Otherwise the modifications you made to my code seem correct.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bschwind/ir-slinger/issues/4#issuecomment-239632816, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQrc80LFf7PsfsGg2JuUR4FJAb4Vde3ks5qfgIsgaJpZM4Jjt-S .

bschwind commented 8 years ago

No rush on the conf file, I'll be asleep within 30 minutes but I can take a look tomorrow if you paste it here. I can also give your altered version a try and see if there's something obvious I'm missing.

goloveychuk commented 8 years ago

cat /etc/lirc/lircd.conf

begin remote

   name  MY_REMOTE
   flags RAW_CODES
   eps            30
   aeps          100

   frequency    38000
# note ensure the modulation frequency above correctly matches your remote, default is set to 38kHz
# you can also try other common frequencies (36000,40000,56000) if you are unsure

       begin raw_codes

           name MY_TEST

begin remote

6125 7400 640 3350 640 3350 640 3350 640 3350 640 1400 640 3350 640 3350 640 3350 640 1400 640 1400 640 1400 640 1400 640 3350 640 1400 640 1400 640 1400 640 1400 640 3350 640 3350 640 1400 640 3350 640 1400 640 1400 640 3350 640 3350 640 1400 640 1400 640 3350 640 1400 640 3350 640 3350 640 1400 640 1400 640 3350 640 1400 640 3350 640 1400 640 3350 640 1400 640 1400 640 3350 640 1400 640 3350 640 1400 640 3350 640 1400 640 3350 640 3350 640 7400 640

     end raw_codes
end remote
goloveychuk commented 8 years ago

hmm, maybe I should read data without lirc, via pigpio. upd: read with your python code - same results. So problem not in input data

goloveychuk commented 8 years ago

hey! It wasn't problem in code. Looks like lirc sending more powerful signal (my prev scheme was + to gpio signal, - to ground). I added transistor add everything is ok! (I'm not good in schemes :) )

bschwind commented 8 years ago

@goloveychuk Good to hear! You were driving the LED with a GPIO pin, and LIRC worked while my library didn't? That sounds really strange, but you're correct to add a transistor. Glad it wasn't a problem with the code because I really couldn't find an issue with what you wrote.

goloveychuk commented 8 years ago

"You were driving the LED with a GPIO pin, and LIRC worked while my library didn't?" exactly

bschwind commented 8 years ago

That's really interesting and unexpected, I wonder what would cause such a result.

Anyway, is it okay if I close this issue?

goloveychuk commented 8 years ago

yes, thanks for help

ffleandro commented 7 years ago

could this be related to #9 ?

ffleandro commented 7 years ago

I know this is a closed issue, but perhaps a small duty cycle could cause this issue and a signal booster mitigated the issue.

Perhaps a bigger duty cycle, like 0.5, could solve the issue?

From the lirc documentation:

duty_cycle <on time>: The percentage of time during a pulse that infrared light is being sent. This is an integer between 1-100 inclusive. default is 50.

The default in irslinger is 0.33.

bschwind commented 7 years ago

@ffleandro that's true, the C code uses a 0.5 duty cycle while the python code defaults to 0.33. But the original post here says they tried running example.c and it still didn't work, so I'm not sure that's the issue here.