Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AWain1
Novice
1,053 Views

IR Remote Library For Intel Edison

Hi, I am trying to use Intel Edison for home automation with the use of IR Remote. I tried installing/adding IRremote library and deleted the Robot_IR something so they won't conflict. Whenever I try to compile the demo code for IR Remote, it always gives me warning,

Arduino: 1.6.5 (Windows 8.1), Board: "Intel® Edison"

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremote.cpp:23:27: fatal error: avr/interrupt.h: No such file or directory

# include

^

compilation terminated.

Error compiling.

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

and sometimes, an "Sei(); is not declared."

Can somebody help me? Thank you.

5 Replies
GPrab
New Contributor I
90 Views

Its a good idea to check if Edison GPIOs are capable of speeds that are required for IR - You'd require 38kHz for IR. Also avr/interrupt.h library would not be supported on Intel boards. They are specific to AVR architecture. I was looking for a similar feature on Galileo but the IO speeds were slow because of multiplexing through the Cypress GPIO expander and I gave up the idea. Though Gen2 boards have Fast IO on Pin1 and Pin0 for UART Tx/Rx I haven't given it a try.

AWain1
Novice
90 Views

Hi, thanks for replying.

 

I tried another IR Remote Library and the AVR error is solve. but another problem arises,

Arduino: 1.6.5 (Windows 8.1), Board: "Intel® Edison"

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp: In member function 'void IRrecv::enableIRIn()':

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:115:6: error: 'cli' was not declared in this scope

cli();

^

In file included from D:\Intel\arduino-1.6.5\libraries\IRremote\IRremote.h:24:0,

from D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:1:

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:246:3: error: 'TCCR2A' was not declared in this scope

TCCR2A = _BV(WGM21); \

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:120:2: note: in expansion of macro 'TIMER_CONFIG_NORMAL'

TIMER_CONFIG_NORMAL();

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:246:16: error: 'WGM21' was not declared in this scope

TCCR2A = _BV(WGM21); \

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:120:2: note: in expansion of macro 'TIMER_CONFIG_NORMAL'

TIMER_CONFIG_NORMAL();

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:246:21: error: '_BV' was not declared in this scope

TCCR2A = _BV(WGM21); \

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:120:2: note: in expansion of macro 'TIMER_CONFIG_NORMAL'

TIMER_CONFIG_NORMAL();

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:247:3: error: 'TCCR2B' was not declared in this scope

TCCR2B = _BV(CS21); \

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:120:2: note: in expansion of macro 'TIMER_CONFIG_NORMAL'

TIMER_CONFIG_NORMAL();

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:247:16: error: 'CS21' was not declared in this scope

TCCR2B = _BV(CS21); \

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:120:2: note: in expansion of macro 'TIMER_CONFIG_NORMAL'

TIMER_CONFIG_NORMAL();

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:248:3: error: 'OCR2A' was not declared in this scope

OCR2A = TIMER_COUNT_TOP / 8; \

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:120:2: note: in expansion of macro 'TIMER_CONFIG_NORMAL'

TIMER_CONFIG_NORMAL();

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:249:3: error: 'TCNT2' was not declared in this scope

TCNT2 = 0; \

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:120:2: note: in expansion of macro 'TIMER_CONFIG_NORMAL'

TIMER_CONFIG_NORMAL();

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:222:30: error: 'TIMSK2' was not declared in this scope

# define TIMER_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:123:2: note: in expansion of macro 'TIMER_ENABLE_INTR'

TIMER_ENABLE_INTR;

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:222:43: error: 'OCIE2A' was not declared in this scope

# define TIMER_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:123:2: note: in expansion of macro 'TIMER_ENABLE_INTR'

TIMER_ENABLE_INTR;

^

D:\Intel\arduino-1.6.5\libraries\IRremote\IRremoteInt.h:222:49: error: '_BV' was not declared in this scope

# define TIMER_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:123:2: note: in expansion of macro 'TIMER_ENABLE_INTR'

TIMER_ENABLE_INTR;

^

D:\Intel\arduino-1.6.5\libraries\IRremote\irRecv.cpp:127:6: error: 'sei' was not declared in this scope

sei(); // enable interrupts

^

Error compiling.

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

Diego_V_Intel
Employee
90 Views

Hello itsmealex56,

The libraries you are using are based on the AVR architecture. That's why you are not able to compile the sketch. The Edison module has a different architecture, and when you try to compile the sketch, the library try to find the AVR registers but since they don't exist in Edison the compilation ends in an error. You would have to re-write the library in order to be Edison compatible avoiding the architecture dependencies.

Additionally, I recommend you to check the following thread where there is information about the sei() and cli() methods: . They are methods for the AVR architecture so they won't compile with Edison.

Regards,

Diego

AWain1
Novice
90 Views

Hi thank you for replying for my query. Is there other way, that I can use the IR Receiver in intel edison? My project is all about home automation, controlling the appliances via remote control. Or if there's no other way for me to be able to use the IR receiver in intel edison, is controlling the appliances (intel edison + relay) via wifi possible?

Diego_V_Intel
Employee
90 Views

Hi itsmealex56,

I recommend you to check the UPM libraries; you might find an example for the IR sensor you have: http://iotdk.intel.com/docs/master/upm/modules.html upm: UPM Libraries

UPM is a high level repository for sensors that use MRAA (MRAA is another library). UPM includes different sensors and there are example codes for those that are supported. Additional information about UPM and MRAA can be found in the following sites:

On the other hand, you could use Wi-Fi too. You could set your Edison as a web server and send data to the devices in your house, and receive data from them as well. There are many Arduino projects available in the web that are similar to the one that you want to do, I recommend you to look for them. The Wi-Fi examples in the Arduino IDE are Edison compatible so you could take the Arduino projects in the web as inspiration for your own project, and combining them with the Wi-Fi examples in the Arduino IDE.

Regards,

Diego