Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error with ESP8266 (ESP-01) #67

Closed
gazialankus opened this issue Dec 22, 2018 · 8 comments
Closed

Compile error with ESP8266 (ESP-01) #67

gazialankus opened this issue Dec 22, 2018 · 8 comments

Comments

@gazialankus
Copy link

I'm trying to make the DaiseikaiTest.ino sketch on a ESP-01 flavor of ESP8266 with no luck. I made it work on an Arduino Nano earlier, but after switching the board to "Generic ESP8266 Module" it won't compile anymore.

I first installed HeatpumpIR via the Library Manager, which was v1.0.8. Later I moved to the version in GitHub. I had the error below in both cases:

Here's the error. Why might this be happening?

In file included from C:\Users\gazihan\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include/sys/stdio.h:6:0,

                 from C:\Users\gazihan\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include/stdio.h:63,

                 from C:\Users\gazihan\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Arduino.h:32,

                 from C:\Users\gazihan\Documents\Arduino\libraries\HeatpumpIR/HeatpumpIR.h:10,

                 from C:\Users\gazihan\Documents\Arduino\libraries\HeatpumpIR/AIRWAYHeatpumpIR.h:8,

                 from C:\Users\gazihan\Documents\Arduino\libraries\HeatpumpIR\AIRWAYHeatpumpIR.cpp:1:

C:\Users\gazihan\Documents\Arduino\libraries\HeatpumpIR\AIRWAYHeatpumpIR.cpp: In constructor 'AIRWAYHeatpumpIR::AIRWAYHeatpumpIR()':

C:\Users\gazihan\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:25:130: error: section of 'model' conflicts with previous declaration

   #define PROGMEM __attribute__((section( "\".irom.text." __FILE__ "." __STRINGIZE(__LINE__) "."  __STRINGIZE(__COUNTER__) "\"")))

                                                                                                                                  ^

C:\Users\gazihan\Documents\Arduino\libraries\HeatpumpIR\AIRWAYHeatpumpIR.cpp:6:37: note: in expansion of macro 'PROGMEM'

   static const char PROGMEM model[] PROGMEM = "AIRWAY";

                                     ^

C:\Users\gazihan\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:25:130: error: section of 'info' conflicts with previous declaration

   #define PROGMEM __attribute__((section( "\".irom.text." __FILE__ "." __STRINGIZE(__LINE__) "."  __STRINGIZE(__COUNTER__) "\"")))

                                                                                                                                  ^

C:\Users\gazihan\Documents\Arduino\libraries\HeatpumpIR\AIRWAYHeatpumpIR.cpp:7:37: note: in expansion of macro 'PROGMEM'

   static const char PROGMEM info[]  PROGMEM = "{\"mdl\":\"AIRWAY\",\"dn\":\"AIRWAY\",\"mT\":18,\"xT\":31,\"fs\":3}";

                                     ^

Using library HeatpumpIR at version 1.0.8 in folder: C:\Users\gazihan\Documents\Arduino\libraries\HeatpumpIR 
Using library IRremoteESP8266 at version 2.5.3 in folder: C:\Users\gazihan\Documents\Arduino\libraries\IRremoteESP8266 
exit status 1
Error compiling for board Generic ESP8266 Module.

@gazialankus
Copy link
Author

And here is the beginning of the sketch:

#include <Arduino.h>
#include <ToshibaDaiseikaiHeatpumpIR.h>

// worked fine with arduino nano
//IRSenderPWM irSender(9);     // IR led on Duemilanove digital pin 3, using Arduino PWM
IRSenderBitBang irSender(0);

ToshibaDaiseikaiHeatpumpIR *heatpumpIR;

@gazialankus
Copy link
Author

I just replaced static const char PROGMEM with static const char throughout the library and I was able to upload it fine. It also ran fine, turned on and off my A/C unit.

Looking at the docs here made me think one PROGMEM after the variable should be enough.

I wonder why nobody else ran into this. Could it be the Arduino IDE ESP8266 board library version?

@whatsupskip
Copy link

May be, but it is more likely to be a problem with the ESP-01. They are a very difficult board to work with. You did well to get it working as well as you did. I just gave up on mine and now mostly use the Wemos D1 mini clones. Much easier starting point.

@gazialankus
Copy link
Author

Yeah they are a pain to work with but I like the tiny form factor:)

Is there a reason for having two PROGMEMs, though?

   static const char PROGMEM model[] PROGMEM = "AIRWAY";

I haven't seen anything like that in docs here: https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html

If modifying them to look like this below does not break anything, maybe it's worth changing them for the sake of ESP-01 compatibility. I can confirm that it works this way in ESP-01.

   static const char model[] PROGMEM = "AIRWAY";

Thank you so much for this very useful library, btw.

@N-Storm
Copy link
Contributor

N-Storm commented Mar 28, 2019

It doesn't related to ESP-01 model, in fact I could confirm this issue related to 2.5.0 version of ESP8266 toolchain. Indeed, the double PROGMEM macro cause the issue. It works fine on 2.4.2, but causes compilation errors on 2.5.0 (including betas) and needs to be fixed. Will look into this further tomorrow.
Might be related to some of these:
esp8266/Arduino#5048
esp8266/Arduino#5049
esp8266/Arduino#5050

@N-Storm
Copy link
Contributor

N-Storm commented Apr 2, 2019

Fixed in #73

@N-Storm
Copy link
Contributor

N-Storm commented Jun 17, 2019

@ToniA could confirm this was fixed & working in hardware. You may close this issue. :)

@ToniA ToniA closed this as completed Jun 17, 2019
@ToniA
Copy link
Owner

ToniA commented Jun 17, 2019

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants