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

Error compiling #2

Closed
bchall opened this issue Jan 18, 2019 · 8 comments
Closed

Error compiling #2

bchall opened this issue Jan 18, 2019 · 8 comments

Comments

@bchall
Copy link

bchall commented Jan 18, 2019

I get the following error when compiling
variable 'iotc_scopeId' must be const in order to be put into read-only section by means of 'attribute((progmem))'

I get past it by changing the variables in the config.h

static char PROGMEM iotc_scopeId[]
static char PROGMEM iotc_deviceId[]
static char PROGMEM iotc_deviceKey[]
static char PROGMEM iotConnStr[]

to

static const char PROGMEM iotc_scopeId[
static const char PROGMEM iotc_deviceId[]
static const char PROGMEM iotConnStr[]

but now i am getting the following error.

'fcvt' was not declared in this scope

can you please help.

@firedog1024
Copy link
Owner

Can you look at what version of the Arduino IDE you are using please, also if you can let me know OS you are using that would be useful. I'm using version 1.8.8 on Windows 10 and not seeing these issues when compiling the code. I compiled the code as it is in the repo and also by adding in the const and both compiled fine.

So this is leading me to believe there may be some changes between Arduino IDE versions and I'm on a newer version. I have seen both these issues before when compiling for other boards, for example the Uno WiFi Rev2 does not like PROGMEM as it has I believe unified flash and also gives the fcvt error from the dtostrf function in util.h to do float to string conversion.

If you can provide me some more information I'll keep working the issue. Thanks!

@bchall
Copy link
Author

bchall commented Jan 18, 2019

I am using Arduino 1.8.5 on Windows 10. I start by upgrading to 1.8.8.

Thanks!

@firedog1024
Copy link
Owner

let me know if the newer version fixes the issue then I'll update the readme so others can avoid this pitfall :-)

@bchall
Copy link
Author

bchall commented Jan 18, 2019

User error I missed this in the log earlier.
Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

I changed it to Arduino/MKR1000 and it worked.

Thanks

@firedog1024
Copy link
Owner

OK no problem, the readme is a bit dense so it's easy to miss something, it's good to here where dev's miss stuff so I can optimize the documentation and add highlighting to key areas. I'll look at the rreadme and add an emphasis on a few things so hopefully others don't miss this. Closing out the issue.

@zhaodong2013062
Copy link

zhaodong2013062 commented Jun 25, 2019

I am getting the same 'fcvt' was not declared in this scope error. I've updated to the latest version of the IDE (1.8.9) and have verified that the board is Arduino/Genuino MKR 1000. I am not seeing the "must be const" error though.

I tried adding #include <stdlib.h> to the top of utils.h, but nothing changed.

@zhaodong2013062
Copy link

Fixed by adding #include <avr/dtostrf.h> to the top of mkr10x0_iotc.ino and commenting out the function dtostrf in utils.h. I'll make a PR for that change as well.

@mondragonsi
Copy link

Hi Guys, I was able to run this and resolce the mqtt failed, rc=-2 by updating the firmware and choosing actually the NINA firmware (1.2.3) (Arduino MKR Wifi 1010) if you are using the MKR 1010 like me.

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