arduino / ArduinoCloudProviderExamples

Examples of how to connect various Arduino boards to cloud providers.
72 stars 26 forks source link

exit status 1 when compiling. #19

Closed Jorin-Post closed 1 year ago

Jorin-Post commented 1 year ago
...\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 1 year ago

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

Jorin-Post commented 1 year ago

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

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 1 year ago

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 https://github.com/arduino/ArduinoCloudProviderExamples/blob/4ce13b8f37d3059aca7dd791b2ee9ba496921394/examples/Azure%20IoT%20Hub/Azure_IoT_Hub_NB/Azure_IoT_Hub_NB.ino#L117

to

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