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

Compilation issues with ESP8266 #109

Closed
lcltech opened this issue Jun 15, 2015 · 13 comments
Closed

Compilation issues with ESP8266 #109

lcltech opened this issue Jun 15, 2015 · 13 comments

Comments

@lcltech
Copy link

lcltech commented Jun 15, 2015

The current version gives at lot compile errors/ warnings when using it with the ESP8266. The reveret-76 works fine.

@Rotzbua
Copy link
Collaborator

Rotzbua commented Jun 16, 2015

Too less information.. Share compiler version and those those error/warnings with us.

@anistor
Copy link
Contributor

anistor commented Jun 16, 2015

@lcltech Please post your errors otherwise we can do very little to help. But since you mentioned ESP8266 I have a hunch this may be caused by lack of Arduino specific types like int8_t on the ESP8266. I have used that type in this commit 68f0b68 to make it work on the STM32 but did not anticipate this code is also used on non-Arduino platforms. Please try signed char instead of int8_t and let us know.

@anistor
Copy link
Contributor

anistor commented Jun 16, 2015

@lcltech I've made a PR that replaces int8_t with signed char here #110 . Please give a try to my branch. Thanks!

@lcltech
Copy link
Author

lcltech commented Jun 16, 2015

The Arduino IDE is a modified version 1.6.1. due to some reset issues with ESP8266.
I think the types may be the way to go.
The amount of compile errors is massive, here is a random section:

C:\Program Files (x86)\Arduino\libraries\rfid-5c67ee3ac33c953750ef8a4f26f6a3a37dd779e8\MFRC522.cpp:1721:44: error: call of overloaded 'println(char* const_)' is ambiguous
Serial.println(GetStatusCodeName(status));
^
C:\Program Files (x86)\Arduino\libraries\rfid-5c67ee3ac33c953750ef8a4f26f6a3a37dd779e8\MFRC522.cpp:1721:44: note: candidates are:
In file included from C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Stream.h:26:0,
from C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/HardwareSerial.h:32,
from C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Arduino.h:212,
from C:\Program Files (x86)\Arduino\libraries\rfid-5c67ee3ac33c953750ef8a4f26f6a3a37dd779e8\MFRC522.cpp:7:
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:79:16: note: size_t Print::println(char)
size_t println(char);
^
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:79:16: note: no known conversion for argument 1 from 'char_ const_' to 'char'
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:80:16: note: size_t Print::println(unsigned char, int)
size_t println(unsigned char, int = DEC);
^
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:80:16: note: no known conversion for argument 1 from 'char_ const_' to 'unsigned char'
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:81:16: note: size_t Print::println(int, int)
size_t println(int, int = DEC);
^
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:81:16: note: no known conversion for argument 1 from 'char_ const_' to 'int'
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:82:16: note: size_t Print::println(unsigned int, int)
size_t println(unsigned int, int = DEC);
^
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:82:16: note: no known conversion for argument 1 from 'char_ const_' to 'unsigned int'
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:83:16: note: size_t Print::println(long int, int)
size_t println(long, int = DEC);
^
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:83:16: note: no known conversion for argument 1 from 'char_ const_' to 'long int'
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:84:16: note: size_t Print::println(long unsigned int, int)
size_t println(unsigned long, int = DEC);
^
C:\Users\LCL\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.h:84:16: note: no known conversion for argument 1 from 'char_ const*' to 'long unsigned int'
Error compiling.

@anistor
Copy link
Contributor

anistor commented Jun 16, 2015

So all those compile errors happen with master but everything compiles ok with this older branch https://github.com/miguelbalboa/rfid/tree/revert-76-master ?

@lcltech
Copy link
Author

lcltech commented Jun 16, 2015

Yes, revert-76 compiles.
I forgot to mention that I tried your modified version(int8_t -> un. signed), but it did not seem to change any thing.

@anistor
Copy link
Contributor

anistor commented Jun 16, 2015

Ok, I'll remove my branch. Thanks !

@anistor
Copy link
Contributor

anistor commented Jun 16, 2015

@lcltech The compilation issues do not seem to be related to my STM32 fixes, and given that it works ok on revert-76 branch that makes me suspect moving strings to flash may have something to do with it (maybe @Rotzbua could help here). I believe the title of the issue should be updated to something like 'Compilation issues with ESP8266'.

@Rotzbua
Copy link
Collaborator

Rotzbua commented Jun 16, 2015

Yes, it seems to bee a problem with the flash. The readme of esp8266 ide version says that there is a support of F("") macro (https://github.com/esp8266/Arduino#progmem).
I think the implementation of print() doesn't support const __FlashStringHelper* properly.

@Rotzbua
Copy link
Collaborator

Rotzbua commented Jun 16, 2015

Sorry, I can't reproduce your errors. I tried several examples.
But I didn't used the old releases from https://github.com/esp8266/Arduino .
I uses the new 1.6.4 version from arduino website and installed esp8266 libs with the board manager: https://github.com/esp8266/Arduino#installing-with-boards-manager .

@lcltech lcltech changed the title Compilation issues after STM32 fixes with ESP8266 Compilation issues with ESP8266 Jun 16, 2015
@lcltech
Copy link
Author

lcltech commented Jun 16, 2015

Removing the FlashStringHelper did the trick, now it compiles.
@anistor, I apologize and have changed the title.
@Rotzbua, it will see if I can try the 1.6.4 with out messing up my 1.6.1
The reason I am staying with the 1.6.1 is the auto reset issues with the serial monitor and some ESP8266 boards. Also I am not sure the boards manager def. files works with the Nodemcu v1.0 board that is connected to the RC522 board.

@anistor
Copy link
Contributor

anistor commented Jun 16, 2015

Cheers @lcltech! No harm done, you don't need to apologize.

@lcltech
Copy link
Author

lcltech commented Jun 16, 2015

Well, now it gets a bit strange. I have installed the new 1.6.5 and the rfid master lib. compile error, damn!
Now i tried changing the board til generic esp8266, this board definition is from the same place as @Rotzbua gets it, now it compiles.
So it seem to boil down to a bad board def. This lib just was the first to use F()/Flashstringhelper.
Thanks for your help!

I will take the issue up here instead:
esp8266/Arduino#387

@lcltech lcltech closed this as completed Jun 16, 2015
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

3 participants