GPIO IR Transmitter?

Moderators: mdrjr, odroid

GPIO IR Transmitter?

Unread postby mattrix » Mon Jun 15, 2015 2:38 pm

Hi all,

So, I tried following this:
viewtopic.php?f=24&t=2426&p=19021&hilit=lirc+gpio#p19021

But, when I configure the kernel, I only have Homebrew Serial Port Receiver.
No option for Homebrew GPIO Port Receiver.

Basically, I just want to use LIRC to send some IR commands via a GPIO connected IR transmitter.

Maybe the setting has been renamed?

I try doing in LIRC config

TRANSMITTER_MODULES="lirc_dev lirc_odroid"

But, it can't find lirc_odroid.

Can someone please advise how I can compile the lirc_odroid module?

Hopefully, it's not required or built-in to the latest kernel already (saves me compiling)

Any help would be appreciated.

Thank you,

Matt
mattrix
 
Posts: 87
Joined: Tue Jan 13, 2015 7:12 am
languages_spoken: english
ODROIDs: C1

Re: GPIO IR Transmitter?

Unread postby mdrjr » Tue Jun 16, 2015 5:59 am

Those instructions are for ODROID-X not C1.
Different kernel/options.

Why not use the native IR receiver on C1 ?
mdrjr
Site Admin
 
Posts: 11620
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: GPIO IR Transmitter?

Unread postby mattrix » Tue Jun 16, 2015 8:43 am

I read that was only a receiver?

I need to transmit / blast.
I want to control Air Conditioner :)
mattrix
 
Posts: 87
Joined: Tue Jan 13, 2015 7:12 am
languages_spoken: english
ODROIDs: C1

Re: GPIO IR Transmitter?

Unread postby mdrjr » Tue Jun 16, 2015 9:18 am

Ahh.. nvm.. I haven't tried this :(

Yes, C1 is a receiver only :(
mdrjr
Site Admin
 
Posts: 11620
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: GPIO IR Transmitter?

Unread postby mcreed » Tue Oct 20, 2015 8:26 am

Since I found this thread on my quest to use a GPIO port on the U3 to drive an IR LED I will leave my 2 cents here for the next person.
I needed the IR Transmitter to access vital config screens in a dumpster dive trophy with no remote. So I don't use a receiver but it should work as well.

I wired my IR LED as is shown in the other thread:

ircircuit.png
(74.49 KiB) Downloaded 1991 times


odroidu3.jpeg
(11.87 KiB) Downloaded 1991 times


Be sure to connect the odroid ground pin to the ground pin of your 5V power supply for your LED. As output I used GPIO204 (right next to ground in the top left).

Put a normal LED in for testing.

1) On the odroid enable the gpio and set it to output mode:
Code: Select all
cd /sys/class/gpio/
echo 204 > export
cd gpio204
echo out > direction


Turn the LED on and off to test if the gpio and your wiring works:
Code: Select all
cd /sys/class/gpio/gpio204
echo 1 > value


(put 0 into value to turn it off)
(Source: viewtopic.php?f=80&t=4894)

Now you are pretty much good to go but you are missing the lirc_odroid kernel module. You can probably just compile the module but I didn't know how so I compiled the whole kernel and took just the module. It works.

Download the kernel:
Code: Select all
git clone https://github.com/hardkernel/linux.git -b odroid-3.8.y


In the kernel directory configure stuff (not sure if necessary):
Code: Select all
make odroidu_defconfig


Then enable the lirc_odroid module in the menuconfig:
Code: Select all
make menuconfig

It's hidden really well under Device Drivers > Staging drivers > Media staging drivers > Linux Infrared Remote Control IR receiver/transmitter drivers > Homebrew GPIO Port Receiver/Transmitter for the Odroid. Enable it as module [m].

Personally I edited the default lirc output gpio in the lirc_odroid.c but you can change that on the fly. The path to the file and later the compiled module is closely resembling the path in the menuconfig.

Now you can compile the modules:
Code: Select all
make modules


It will take a while, afterwards you should find a file named lirc_odroid.ko in the path described above. Put it in /lib/modules/3.8.13.30/kernel/drivers/media/rc/ or somewhere in there.

For the rest you should follow the guide at viewtopic.php?f=24&t=2426&p=19021&hilit=lirc+gpio#p19021 . For me it worked great!
mcreed
 
Posts: 1
Joined: Tue Oct 20, 2015 7:49 am
languages_spoken: english
ODROIDs: U3

Re: GPIO IR Transmitter?

Unread postby penrod » Fri Feb 19, 2016 3:52 am

Anybody have any luck with this yet on a C0/C1/1+? I have already connected the hardware and can turn on my IR emitter LEDs using the "gpio" command, but now I need to hook it up to LIRC. I'm gonna try following the U3 instructions above to create lirc_odroid allowing me to make the gpio_out_pin association, but was hoping for a (infrared) light at the end of the tunnel. :D

If I do get this working, I'd like to create a definitive guide to setting up an IR transmitter for people to follow in the future. This seems like a fairly common need around here.
penrod
 
Posts: 3
Joined: Fri Feb 19, 2016 3:21 am
languages_spoken: English
ODROIDs: C1/C1+/C0

Re: GPIO IR Transmitter?

Unread postby ronaldlees » Thu Feb 25, 2016 12:24 am

penrod wrote:Anybody have any luck with this yet on a C0/C1/1+? I have already connected the hardware and can turn on my IR emitter LEDs using the "gpio" command, but now I need to hook it up to LIRC. I'm gonna try following the U3 instructions above to create lirc_odroid allowing me to make the gpio_out_pin association, but was hoping for a (infrared) light at the end of the tunnel. :D

If I do get this working, I'd like to create a definitive guide to setting up an IR transmitter for people to follow in the future. This seems like a fairly common need around here.


A guide would be great! It seems most are taking the raspberry pi kernel driver mods to add gpio to the irc driver (historically serial). Really think this should be baked into the distributions.

There's also an article at https://wiki.openwrt.org/doc/howto/lirc-gpioblaster that is a good read.
User avatar
ronaldlees
 
Posts: 82
Joined: Sat Mar 29, 2014 3:52 am
languages_spoken: english
ODROIDs: Odroid C1
Odroid C1+
Odroid XU4

Re: GPIO IR Transmitter?

Unread postby penrod » Tue Mar 29, 2016 5:47 am

I'm taking a crack at modifying this code: viewtopic.php?f=24&t=2426

I'm looking into using the /sys/class/gpio exports right now. I'm very experienced in C++ but new to Linux, so still feeling all of this out. I finally can compile and install a new kernel, so hopefully it won't take me too much longer.

ODROID or mdrjr, there is a bum link on the wiki. The "Pin description" link at the top of http://odroid.com/dokuwiki/doku.php?id= ... ent_gpio40 links to the C2 hardware -- you just need to change the "2" to "1" in the link and it will be all good.
penrod
 
Posts: 3
Joined: Fri Feb 19, 2016 3:21 am
languages_spoken: English
ODROIDs: C1/C1+/C0

Re: GPIO IR Transmitter?

Unread postby odroid » Tue Mar 29, 2016 11:59 am

We've updated the WiKi. There were some mixed stuff between C1 and C2.

For C1/C1+ users.
http://odroid.com/dokuwiki/doku.php?id= ... ent_gpio40

For C2 users.
http://odroid.com/dokuwiki/doku.php?id= ... ent_gpio40
User avatar
odroid
Site Admin
 
Posts: 23677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: GPIO IR Transmitter?

Unread postby penrod » Wed Apr 06, 2016 2:16 am

UPDATE: I'm probably 3/4 of the way there. It took me a bit to figure out the limitations of kernel programming (no access to /sys/class/gpio, etc), but I now have a driver I can get installed and registered. I know it initializes correctly via the dmesg log, and I know it is talking to the GPIO because I can (for debugging) initialize the output to high, which lights the LED. This is really the first I've used LIRC, so it took a while to get the LIRC conf files correct to where I can use the 'irsend' command. Although it acts like it is working, I'm not seeing any of the dmesg logs that are supposed to happen when it does a send_pulse()/send_space()/etc.

So close, but no cigar yet.

I'm going to take a break from this for a while (want to try integrating CEC), but will get back to it. If anybody wants to dig in, I'm happy to share what I have so far. Just PM me.
penrod
 
Posts: 3
Joined: Fri Feb 19, 2016 3:21 am
languages_spoken: English
ODROIDs: C1/C1+/C0

Re: GPIO IR Transmitter?

Unread postby Riiio » Thu Oct 06, 2016 7:05 pm

Has there been any movement on transmitting IR from C2 board?
Riiio
 
Posts: 26
Joined: Thu Jun 30, 2016 12:56 am
languages_spoken: english
ODROIDs: XU4

Re: GPIO IR Transmitter?

Unread postby joy » Tue Nov 22, 2016 10:53 am

Hello Riiio,

Please refer to the following wiki page of GPIO based IR transmitter.
We've released it on Ubuntu and the version is as following.

- wiki
http://odroid.com/dokuwiki/doku.php?id= ... io_blaster

- version
ODROID-C2 : 3.14.79-94 (Nov 21 2016)
ODROID-C1 : 3.10.104-175 (Nov 21 2016)
joy
 
Posts: 281
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: GPIO IR Transmitter?

Unread postby rooted » Tue Nov 22, 2016 11:49 am

@joy do you know of a comparable IR emitter that isn't so hard to source?
User avatar
rooted
 
Posts: 3652
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1
C1+
C2
XU3 Lite
XU4
VU7+
HiFi Shield 2
Smart Power (original)

Re: GPIO IR Transmitter?

Unread postby mad_ady » Tue Nov 22, 2016 1:09 pm

@joy: this is great news, thanks! Is there any reason why this driver wouldn't work/couldn't be ported to the XU4 as well?
Finally I can make a remote for my AC unit :)
User avatar
mad_ady
 
Posts: 2052
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: GPIO IR Transmitter?

Unread postby joy » Tue Nov 22, 2016 3:10 pm

rooted wrote:@joy do you know of a comparable IR emitter that isn't so hard to source?


Hi rooted,

Well, for our test environment, part 'KID-05BW85' is used that is provided from one of parts providers.
It's a very common part,
but, I think the part's angle sensitivity or forward current spec. can be not good enough in some cases.
- Forward current : 20mA or 50mA
- Angle Sensitivity : +-20 deg, (narrow radiation angle)

I will check it internally . :)
joy
 
Posts: 281
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: GPIO IR Transmitter?

Unread postby joy » Tue Nov 22, 2016 3:16 pm

mad_ady wrote:@joy: this is great news, thanks! Is there any reason why this driver wouldn't work/couldn't be ported to the XU4 as well?
Finally I can make a remote for my AC unit :)

Hi mad_ady, :)

I've just confirmed normal operation with C1/C2 last week so, I haven't tried to work this driver on XU4 yet.
But, I think this driver is available with XU4, too.
I will try it on XU4 and share the result here.
joy
 
Posts: 281
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: GPIO IR Transmitter?

Unread postby mad_ady » Tue Nov 22, 2016 3:50 pm

Thank you!
User avatar
mad_ady
 
Posts: 2052
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: GPIO IR Transmitter?

Unread postby joy » Wed Nov 30, 2016 10:20 am

mad_ady wrote:@joy: this is great news, thanks! Is there any reason why this driver wouldn't work/couldn't be ported to the XU4 as well?
Finally I can make a remote for my AC unit :)

Hi mad_ady,

Now GPIO based-IR transmitter on XU3/4 is available.
I've done lirc_odroid driver porting and confirmed it's working normally on XU4.
The release version is 3.10.104-126 (Nov 29, 2016).

Please refer to the following wiki page and github commit.
- wiki
http://odroid.com/dokuwiki/doku.php?id= ... io_blaster
- commits
https://github.com/hardkernel/linux/com ... ba6a06d71d
https://github.com/hardkernel/linux/com ... 5ccb658090

In case of XU4, lirc package isn't built in by default and voltage level of VDD_IO and gpio port is 1.8V level,
so please note it. ;)
joy
 
Posts: 281
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: GPIO IR Transmitter?

Unread postby rooted » Wed Nov 30, 2016 10:46 am

Great work joy, very nice.
User avatar
rooted
 
Posts: 3652
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1
C1+
C2
XU3 Lite
XU4
VU7+
HiFi Shield 2
Smart Power (original)

Re: GPIO IR Transmitter?

Unread postby mad_ady » Wed Nov 30, 2016 5:15 pm

Indeed, great work joy! Thank you!
User avatar
mad_ady
 
Posts: 2052
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Mon Jun 26, 2017 5:36 pm

Hello joy:
Right now i am working with odroid Xu4 and i want to realize Irsend function with GPIO of this board. Actually I reviewed many documents and posts to make it work but when i run the command irsend, it runs successfully but no signal being sent. I really hope you can give me some tips.
The kernel version i uesd is 3.10.105, os is ubuntu 16.04.02 LTS. And i have download the source code of odroidxu3.10.y and compile it. I put the lirc_odroid.ko file into the directoy /lib/modules/3.10.105/kernel/drivers/staging/media/lirc/lirc_odroid.ko. Then i added lirc dev\n lirc_odroid\n in /etc/modules. the /etc/lirc/hardware.conf is below:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="None"
REMOTE_MODULES=""
REMOTE_DRIVER=""
REMOTE_DEVICE=""
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="odroid blaster"
TRANSMITTER_MODULES="lirc_odroid lirc_dev"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE="/dev/lirc0"
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Disable kernel support.
#Typically, lirc will disable in-kernel support for ir devices in order to
#handle them internally. Set to false to prevent lirc from disabling this
#in-kernel support.
#DISABLE_KERNEL_SUPPORT="true"

#Enable lircd
START_LIRCD="true"

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

#Try to load appropriate kernel modules
LOAD_MODULES="true"

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

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""

I dont know if my gpio setting is right because i use moprobe command to set.
I think thats all my work with the board and Can you help me to figure out the problem?

Best Regard,
GaoXun
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4

Re: GPIO IR Transmitter?

Unread postby mad_ady » Mon Jun 26, 2017 6:14 pm

You shouldn't need to manually compile the module. It's part of newer kernels.
What does dmesg say when you load the module and after irsend?
User avatar
mad_ady
 
Posts: 2052
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Mon Jun 26, 2017 9:27 pm

[ 16.689098] [c7] lirc_odroid: module is from the staging directory, the quality is unknown, you have been warned.
[ 16.690472] [c4] lirc_odroid lirc_odroid.0: lirc_dev: driver lirc_odroid registered at minor = 0
[ 16.690483] [c4] lirc_odroid: driver registered!
[ 6190.996179] [c4] lirc_odroid is opened
[ 6190.996488] [c4] lirc_odroid - SET_SEND_CARRIER 38000
[ 6190.996507] [c4] lirc_odroid - SET_SEND_DUTY_CYCLE 50
[ 6191.057919] [c4] lirc_odroid is closed
[ 6191.996950] [c5] lirc_odroid is opened
[ 6191.997004] [c5] lirc_odroid - SET_SEND_CARRIER 38000
[ 6191.997024] [c5] lirc_odroid - SET_SEND_DUTY_CYCLE 50
[ 6192.058319] [c5] lirc_odroid is closed
[ 6192.568667] [c6] lirc_odroid is opened
[ 6192.568719] [c6] lirc_odroid - SET_SEND_CARRIER 38000
[ 6192.568736] [c6] lirc_odroid - SET_SEND_DUTY_CYCLE 50
[ 6192.630032] [c6] lirc_odroid is closed
[ 6194.060364] [c6] lirc_odroid is opened
[ 6194.060415] [c6] lirc_odroid - SET_SEND_CARRIER 38000
[ 6194.060432] [c6] lirc_odroid - SET_SEND_DUTY_CYCLE 50
[ 6194.121716] [c6] lirc_odroid is closed

And can you tell me which kernel version is ok and post the link?

Best Regards,
Gao Xun
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Mon Jun 26, 2017 9:32 pm

And I find its strange when i run the command modprobe gpio_out_pin=191 softcarrier=1 invert=0, I run cat /sys/kernel/debug/gpio as below:
GPIOs 0-7, platform/13400000.pinctrl, gpy7:
gpio-0 (lirc_odroid ir/out ) out lo
.
.
.
.
.
GPIOs 185-192, platform/14010000.pinctrl, gpa2:
gpio-191 (sysfs ) out hi
.
.
I think the gpio setting is failed.

Best regards,
Gao Xun
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Tue Jul 04, 2017 10:25 pm

Problem sloved with add the irda.conf file in /etc/modules/ and set the gpio information.
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Tue Jul 04, 2017 10:27 pm

mad_ady wrote:You shouldn't need to manually compile the module. It's part of newer kernels.
What does dmesg say when you load the module and after irsend?


Hello,
Yep, we found in 105-139 version,the kernel had this file already and thx.

Best regards,
Gao
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4

Re: GPIO IR Transmitter?

Unread postby mad_ady » Wed Jul 05, 2017 12:57 am

Sorry, I forgot about this thread. Is everything working now?
User avatar
mad_ady
 
Posts: 2052
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Thu Jul 13, 2017 12:19 am

mad_ady wrote:Sorry, I forgot about this thread. Is everything working now?


Yep, everything is fine and thx for your help :D
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4

Re: GPIO IR Transmitter?

Unread postby mad_ady » Thu Jul 13, 2017 1:49 am

Do you get strange delays/timeouts after injecting the first code? I need to restart lirc after every code to have a reliable transmission
User avatar
mad_ady
 
Posts: 2052
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Tue Jul 18, 2017 1:05 am

mad_ady wrote:Do you get strange delays/timeouts after injecting the first code? I need to restart lirc after every code to have a reliable transmission

Hello.
Well, we run it on Odroid Xu4 and i think expect the noise voice of the fan when you run the command, there is no delay and timeout when you run the irsend command, but when we want to run irsend and irrecord simultaneously,we have to stop and start the service of lircd. And the same problem occurs on the raspberry Pi3.
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4

Re: GPIO IR Transmitter?

Unread postby mad_ady » Tue Jul 18, 2017 2:18 am

So you're running kernel 3.10, right?
User avatar
mad_ady
 
Posts: 2052
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: GPIO IR Transmitter?

Unread postby GaoXunLucky123 » Wed Jul 19, 2017 12:46 am

mad_ady wrote:So you're running kernel 3.10, right?

Yep, the version is 3.10.105-139 actually.(after upgrade)
GaoXunLucky123
 
Posts: 12
Joined: Mon Jun 26, 2017 5:12 pm
languages_spoken: english
ODROIDs: xu4


Return to General Chat

Who is online

Users browsing this forum: No registered users and 1 guest