arduino/ArduinoCloudProviderExamples

exit status 1 when compiling.

Closed this issue · 3 comments

...\Documents\Arduino\libraries\MKRNB\src\NBFileUtils.cpp: In member function 'uint32_t NBFileUtils::downloadFile(String, const char*, uint32_t, bool)':
...\Documents\Arduino\libraries\MKRNB\src\NBFileUtils.cpp:115:32: error: variable-sized object 'hex' may not be initialized
         char hex[size * 2] { 0 };
                                ^
...\Arduino\libraries\MKRNB\src\NBFileUtils.cpp: In function 'void printFiles(NBFileUtils)':
...\Arduino\libraries\MKRNB\src\NBFileUtils.cpp:359:33: error: deducing from brace-enclosed initializer list requires #include <initializer_list>
     auto count { fu.fileCount() };
                                 ^
...\Arduino\libraries\MKRNB\src\NBFileUtils.cpp:366:18: error: 'files' was not declared in this scope
     fu.listFiles(files);
                  ^
...\Arduino\libraries\MKRNB\src\NBFileUtils.cpp:368:19: error: unable to deduce 'auto&&' from 'files'
     for (auto f : files) {
                   ^

exit status 1

These are the error codes when compiling. I can change the source code, but I rather have someone more familiar looking at it.

I'm using a MKR NB 1500 bought last month & Arduino IDE 2.2.1.

pennam commented

Hi @Jorin-Post what example are you trying to build?

@pennam
The Azure IoT Hub NB.
When I use the old libraries the code does upload.

  • #include <ArduinoBearSSL.h> // 1.2.0
  • #include <ArduinoECCX08.h> // 1.2.0
  • #include <utility/ECCX08SelfSignedCert.h>
  • #include <ArduinoMqttClient.h> // 0.1.0
  • #include <MKRNB.h> // 1.3.1

So problem solved sort of.

There is always a next question..
Do you know if I need to fill in my ANP somewhere?
Now I get the return

AT+CEREG?
+CEREG: 0,2

From other modems I know I needed to fill in my ANP to get connected.

pennam commented

That is strange, i'm able to build without issues using this libraries:

Using library ArduinoBearSSL at version 1.7.3
Using library ArduinoECCX08 at version 1.3.7
Using library Wire at version 1.0
Using library ArduinoMqttClient at version 0.1.7
Using library MKRNB at version 1.6.0

Do you know if I need to fill in my ANP somewhere?

I would say yes, you can configure the APN changing this line

while ((nbAccess.begin(pinnumber) != NB_READY) ||

to

while ((nbAccess.begin(pinnumber, "your_apn") != NB_READY) ||