Arduino API Connection Issues

Hey guys,

im trying to connect my Arduino with an API but im stuck.

I tried to install ArduinoBearSSL with Arduino Yun Rev 2 but i got following error:

i tried asking ChatGPT

The error message shows two candidates for the requestFrom function from the Wire library:

  1. uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
  2. uint8_t TwoWire::requestFrom(int, int, int)

now im should search for a missing file "common_inc.h" but im stuck. I even tried the crys_common & crys_common_error file.

Help appreciated

All Love

eyyuebcoban, welcome to the forum.

Could you post the complete error message please?

1 Like

First, thank you for responding!
Sure,
but some of the text is german.

WARNUNG: Bibliothek ArduinoECCX08 behauptet auf samd, megaavr, mbed, mbed_nano, mbed_portenta, mbed_opta, mbed_giga, esp32 Architektur(en) ausgeführt werden zu können und ist möglicherweise inkompatibel mit Ihrer derzeitigen Platine, welche auf avr Architektur(en) ausgeführt wird.
C:\Users\Aiuk\Documents\Arduino\libraries\ArduinoECCX08\src\ECCX08.cpp: In member function 'int ECCX08Class::receiveResponse(void*, size_t)':
C:\Users\Aiuk\Documents\Arduino\libraries\ArduinoECCX08\src\ECCX08.cpp:912:80: error: call of overloaded 'requestFrom(uint8_t, size_t, bool)' is ambiguous
   while (_wire->requestFrom((uint8_t)_address, (size_t)responseSize, (bool)true) != responseSize && retries--);
                                                                                ^
In file included from C:\Users\Aiuk\Documents\Arduino\libraries\ArduinoECCX08\src\ECCX08.h:24:0,
                 from C:\Users\Aiuk\Documents\Arduino\libraries\ArduinoECCX08\src\ECCX08.cpp:22:
C:\Users\Aiuk\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:66:13: note: candidate: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
     uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
             ^~~~~~~~~~~
C:\Users\Aiuk\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:69:13: note: candidate: uint8_t TwoWire::requestFrom(int, int, int)
     uint8_t requestFrom(int, int, int);
             ^~~~~~~~~~~

exit status 1

Compilation error: exit status 1

Ok the first part in German is just a warning saying that the ArduinoECCX08 library is compatible with the boards listed but may not be compatible with (i.e. has not been tested by the author on) the board you are currently using.

Regarding the error, the compiler was expecting a call to requestFrom() in the form:

uint8_t requestFrom(uint8_t, uint8_t, uint8_t);

or

uint8_t requestFrom(int, int, int);

The form it found in ECCX08.cpp:912:80, was:

requestFrom(uint8_t, size_t, bool)

which does not match either of those, hence the compiler considers it ambiguous. As it stands, this library is not compatible with the architecture library of the board you are using.

May I ask which version of the Arduino IDE and Arduino AVR library you are using?

I would suggest first to check an make sure that you have a recent version of the IDE and the latest version of the Arduino AVR Boards library.

Hey Bitseeker,

thank you again for responding. That clarifys a lot!

I actually installed Adurino IDE 2.3.2 and the 1.8.9 Arduino AVR Boards in my Boards Manager yesterday.

Should I also install the library Arduino AVRSTL from Mike ... too?

All Love :sparkles:

What made you consider installing the AVRSTL library? From what I can tell this adds a number of C++ style functions, but I don't think that is the issue here. I also checked the ArduinoECCX08 Github and I don't see any mention of AVTSTL as a dependency either in the readme or the code.

1.8.9? I think perhaps that is a typo. I checked my installation of IDE 2.3.2 and see 1.8.6 and no update. I also checked the library Github page just to confirm and the latest version does appear to be 1.8.6. In fact, if I had looked closer at your previous post I would have seen the clue in your output :man_facepalming::

C:\Users\Aiuk\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:66:13:

I did a bit more research and an examination of TwoWire.h (as referenced and used by ArduinoECCX08) actually shows 5 overloads for the .requestFrom() function:

 65   uint8_t requestFrom(uint8_t, uint8_t);
 66   uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
 67   uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t);
 68   uint8_t requestFrom(int, int);
 69   uint8_t requestFrom(int, int, int);

Looking at that line 912 in ECCX08.cpp, it reads as follows:

while (_wire->requestFrom((uint8_t)_address, (size_t)responseSize, (bool)true) != responseSize && retries--);

As we already said, it doesn't match any of those. The overload to most closely match this (three unsigned parameters) would be the one in line 66. The actual function definition in the corresponding .cpp file looks like this:

uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity)
{
  return requestFrom((uint8_t)address, (uint8_t)quantity, (uint8_t)true);
}

The two parameter version is actually very similar:

uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity)
{
  return requestFrom((uint8_t)address, (uint8_t)quantity, (uint8_t)true);
}

You see the return is actually the same. Given that the ECCx08, e.g. ECC608 chip returns either a 256 or 512 bit (32 or 64 byte) result, then it should be safe, as a temporary workaround, to rewrite line 912 as follows:

while (_wire->requestFrom((uint8_t)_address, (uint8_t)responseSize, (uint8_t)true) != responseSize && retries--);

Or even slightly shorter by dropping the third parameter:

while (_wire->requestFrom((uint8_t)_address, (uint8_t)responseSize) != responseSize && retries--);

Your output shows the path to the ECCX08.cpp file.

Initially I thought it might be worth re-installing the AVR Boards library, but from your output it is evident that you have the same version as on the Github and as I have in my installation. So I think this situation is rather odd. Perhaps Wire.h has changed since the ArduinoECCX08 was released? The ArduinoECCX08 library does seem to be being maintained and was updated only two months ago. Although it does not mention support for any of the boards based on the 32u4 chip, such as the Yun, this same AVR Boards library is used by the other Arduino boards that are supported.

I therefore think it might also be worth contacting the author via their Github repository and logging this as an issue:

https://github.com/arduino-libraries/ArduinoECCX08/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

They should at least be able confirm whether their library should work with 32u4 based boards. If the above works then you at least have temporary solution and hopefully the author will work on and provide a more permanent solution.

Sorry my post is a bit long-winded.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.