I can't get OpenCat.ino to compile. The error message says it's too big for the Uno:
I've commented out all of the decoders in IRremote.h (except NEC):
Just to be sure there isn't another version of IRremote.h lurking around somewhere, I tried renamed it and that broke the compilation of OpenCat, so I know I've edited the right file.
I'm especially confused because this worked fine about a week ago, when I first assembled Bittle. I got as far as compiling and uploading OpenCat back then, but I was too tired to do the calibration properly. I finally got back to it this morning and started the calibration from scratch with WriteInstinct. That worked fine, but OpenCat won't compile.
The only thing that has changed in between is that I pulled from the OpenCat repo. I don't expect that that would be a problem, but just in case I tried reverting to an earlier commit and that didn't help either.
Just in case, I also tried re-installing the IRremote library and using a new download of the OpenCat repo, but neither helped.
Any pointers or advice would be greatly appreciated.
Problem solved! It seems to have been an issue with the tool chain version.
I was using the avr tools installed by my distribution (archlinux), so under "Tools > Boards" I have "Archlinux Arduino AVR boards > Arduino Uno". I installed "Arduino AVR boards" from the board manager and now it works. When I select the Uno from the "Archlinux AVR" submenu, the compiler is:
$ avr-g++ --version avr-g++ (GCC) 11.1.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
but from the "Arduino AVR" submenu it's:
$ .arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ --version avr-g++ (GCC) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
With the older version (7.3.0), OpenCat.ino compiles fine:
Sketch uses 29054 bytes (90%) of program storage space. Maximum is 32256 bytes.
That doesn't really explain why it worked earlier and gave me trouble now, but that's fine. At least I've got it working, and hopefully this will be helpful to someone else sometime!
I noticed in the verbose compilation that there are many lines for IRremote. I guess it's making an object file for each decoder even though they're disabled? Looking at the temp files from the compilation, almost all except the NEC one are 4K. The NEC one and the overall IRremote.cpp.o are 12K. Does that seem right?
$ ls -s1h /tmp/arduino_build_404831/libraries/IRremote/ total 256K 4.0K IRremote.cpp.d 12K IRremote.cpp.o 4.0K esp32.cpp.d 4.0K esp32.cpp.o 4.0K irPronto.cpp.d 20K irPronto.cpp.o 4.0K irRecv.cpp.d 20K irRecv.cpp.o 4.0K irSend.cpp.d 12K irSend.cpp.o 4.0K ir_Aiwa.cpp.d 4.0K ir_Aiwa.cpp.o 4.0K ir_BoseWave.cpp.d 4.0K ir_BoseWave.cpp.o 4.0K ir_Denon.cpp.d 4.0K ir_Denon.cpp.o 4.0K ir_Dish.cpp.d 4.0K ir_Dish.cpp.o 4.0K ir_JVC.cpp.d 4.0K ir_JVC.cpp.o 4.0K ir_LG.cpp.d 4.0K ir_LG.cpp.o 4.0K ir_Lego_PF.cpp.d 4.0K ir_Lego_PF.cpp.o 4.0K ir_MagiQuest.cpp.d 4.0K ir_MagiQuest.cpp.o 4.0K ir_Mitsubishi.cpp.d 4.0K ir_Mitsubishi.cpp.o 4.0K ir_NEC.cpp.d 12K ir_NEC.cpp.o 4.0K ir_Panasonic.cpp.d 4.0K ir_Panasonic.cpp.o 4.0K ir_RC5_RC6.cpp.d 4.0K ir_RC5_RC6.cpp.o 4.0K ir_Samsung.cpp.d 4.0K ir_Samsung.cpp.o 4.0K ir_Sanyo.cpp.d 4.0K ir_Sanyo.cpp.o 4.0K ir_Sharp.cpp.d 4.0K ir_Sharp.cpp.o 4.0K ir_Sharp_alt.cpp.d 4.0K ir_Sharp_alt.cpp.o 4.0K ir_Sony.cpp.d 4.0K ir_Sony.cpp.o 4.0K ir_Template.cpp.d 4.0K ir_Template.cpp.o 4.0K ir_Whynter.cpp.d 4.0K ir_Whynter.cpp.o 4.0K sam.cpp.d 4.0K sam.cpp.o
Yes, I'm using v2.6.1. I'm running Linux using v1.8.15 of the Arduino IDE. Here are the library versions reported in a verbose compile:
Using board 'uno' from platform in folder: /usr/share/arduino/hardware/archlinux-arduino/avr Using core 'arduino' from platform in folder: /usr/share/arduino/hardware/archlinux-arduino/avr Detecting libraries used... <<<snip>>> Alternatives for Wire.h: [Wire@1.0] ResolveLibrary(Wire.h) -> candidates: [Wire@1.0] <<<snip>>> Alternatives for Adafruit_PWMServoDriver.h: [Adafruit_PWM_Servo_Driver_Library@2.4.0] ResolveLibrary(Adafruit_PWMServoDriver.h) -> candidates: [Adafruit_PWM_Servo_Driver_Library@2.4.0] <<<snip>>> Alternatives for EEPROM.h: [EEPROM@2.0] ResolveLibrary(EEPROM.h) -> candidates: [EEPROM@2.0] <<<snip>>> Alternatives for I2Cdev.h: [I2Cdev] ResolveLibrary(I2Cdev.h) -> candidates: [I2Cdev] <<<snip>>> Alternatives for MPU6050_6Axis_MotionApps20.h: [MPU6050] ResolveLibrary(MPU6050_6Axis_MotionApps20.h) -> candidates: [MPU6050] <<<snip>>> Alternatives for IRremote.h: [IRremote@2.6.1] ResolveLibrary(IRremote.h) -> candidates: [IRremote@2.6.1]
OpenCat compiled fine a week ago, and literally the only thing I did before it stopped working was 'git pull' and reopen the file -- I hadn't even quit the IDE in the interim.
Did you auto updated the IRremote library? It should still be 2.6.1.
What's your system? Windows/Mac?
The OpenCat.ino code uses 92% flash on my Mac.
You are using the older IRremote library 2.6.1 correct?