Closed derteufelqwe closed 3 months ago
These errors seem to be breaking changes of Arduino ESP32 core version 3.x (based on ESP-IDF 5.1). I will resolve them but this would take some weeks.
For now you can consider to downgrade to Arduino ESP32 core version 2.x (based on ESP-IDF 4.4), which is likely to work.
Arduino ESP32 core version 3.x is now supported. https://github.com/yoursunny/NDNph/commit/c9fec76b9d8a0d20772238df2169246871df6fc5 https://github.com/yoursunny/esp8266ndn/commit/e6da0598f921c38547f3e81283f1b25d991d2665
Hello,
I am really interested in your NDN libraries and tried to get one of your examples to work on my ESP-WROOM-32 but unfortunately I get compiler errors. I have done the following things (on my Windows machine):
<User>/Documents/Arduino/libraries
But when I now run this simple program
I get the following exception
Expand Stacktrace
``` In file included from c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:4, from c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/port.hpp:8, from c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/NDNph.h:4, from c:\Users\myuser\Documents\Arduino\libraries\esp8266ndn\src/port/port.hpp:28, from c:\Users\myuser\Documents\Arduino\libraries\esp8266ndn\src/esp8266ndn.h:11, from C:\Users\myuser\Downloads\arduino_sketch\arduino_sketch.ino:1: c:\users\myuser\documents\arduino\libraries\ndnph\src\ndnph\port\mbed-common.hpp: In constructor 'ndnph::mbedtls::Sha256::Sha256()': c:\users\myuser\documents\arduino\libraries\ndnph\src\ndnph\port\mbed-common.hpp:37:12: error: 'mbedtls_sha256_starts_ret' was not declared in this scope; did you mean 'mbedtls_sha256_starts'? 37 | m_ok = mbedtls_sha256_starts_ret(&m_ctx, 0) == 0; | ^~~~~~~~~~~~~~~~~~~~~~~~~ | mbedtls_sha256_starts c:\users\myuser\documents\arduino\libraries\ndnph\src\ndnph\port\mbed-common.hpp: In member function 'void ndnph::mbedtls::Sha256::update(const uint8_t*, size_t)': c:\users\myuser\documents\arduino\libraries\ndnph\src\ndnph\port\mbed-common.hpp:47:20: error: 'mbedtls_sha256_update_ret' was not declared in this scope; did you mean 'mbedtls_sha256_update'? 47 | m_ok = m_ok && mbedtls_sha256_update_ret(&m_ctx, chunk, size) == 0; | ^~~~~~~~~~~~~~~~~~~~~~~~~ | mbedtls_sha256_update c:\users\myuser\documents\arduino\libraries\ndnph\src\ndnph\port\mbed-common.hpp: In member function 'bool ndnph::mbedtls::Sha256::final(uint8_t*)': c:\users\myuser\documents\arduino\libraries\ndnph\src\ndnph\port\mbed-common.hpp:52:20: error: 'mbedtls_sha256_finish_ret' was not declared in this scope; did you mean 'mbedtls_sha256_finish'? 52 | m_ok = m_ok && mbedtls_sha256_finish_ret(&m_ctx, digest) == 0; | ^~~~~~~~~~~~~~~~~~~~~~~~~ | mbedtls_sha256_finish c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp: In constructor 'ndnph::port_ec_mbed::EcKeyBase::EcKeyBase()': c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:40:37: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'grp' 40 | mbedtls_ecp_group_copy(&keypair.grp, mbedtls::P256::group()); | ^~~ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp: In member function 'bool ndnph::port_ec_mbed::EcPvt::import(const uint8_t*)': c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:61:51: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'd' 61 | return mbedtls_mpi_read_binary(&this->keypair.d, bits, mbedtls::P256::PvtLen::value) == 0 && | ^ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:62:53: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'grp' 62 | mbedtls_ecp_check_privkey(&this->keypair.grp, &this->keypair.d) == 0; | ^~~ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:62:73: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'd' 62 | mbedtls_ecp_check_privkey(&this->keypair.grp, &this->keypair.d) == 0; | ^ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp: In member function 'ssize_t ndnph::port_ec_mbed::EcPvt::sign(const uint8_t*, uint8_t*) const': c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:75:42: error: invalid conversion from 'size_t*' {aka 'unsigned int*'} to 'size_t' {aka 'unsigned int'} [-fpermissive] 75 | &sigLen, nullptr, nullptr) == 0 | ^~~~~~~ | | | size_t* {aka unsigned int*} c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:74:41: error: too few arguments to function 'int mbedtls_ecdsa_write_signature(mbedtls_ecdsa_context*, mbedtls_md_type_t, const unsigned char*, size_t, unsigned char*, size_t, size_t*, int (*)(void*, unsigned char*, size_t), void*)' 74 | return mbedtls_ecdsa_write_signature(ctx, MBEDTLS_MD_SHA256, digest, NDNPH_SHA256_LEN, sig, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | &sigLen, nullptr, nullptr) == 0 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:5: C:\Users\myuser\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-6b1f40b9bf/esp32/include/mbedtls/mbedtls/include/mbedtls/ecdsa.h:483:5: note: declared here 483 | int mbedtls_ecdsa_write_signature(mbedtls_ecdsa_context *ctx, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp: In member function 'bool ndnph::port_ec_mbed::EcPub::import(const uint8_t*)': c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:86:57: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'grp' 86 | return mbedtls_ecp_point_read_binary(&this->keypair.grp, &this->keypair.Q, bits, | ^~~ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:86:77: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'Q' 86 | return mbedtls_ecp_point_read_binary(&this->keypair.grp, &this->keypair.Q, bits, | ^ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:88:52: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'grp' 88 | mbedtls_ecp_check_pubkey(&this->keypair.grp, &this->keypair.Q) == 0; | ^~~ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:88:72: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'Q' 88 | mbedtls_ecp_check_pubkey(&this->keypair.grp, &this->keypair.Q) == 0; | ^ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp: In member function 'bool ndnph::port_ec_mbed::EcKeyGen::generate(uint8_t*, uint8_t*)': c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:109:51: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'grp' 109 | return mbedtls_ecp_gen_keypair(&this->keypair.grp, &this->keypair.d, &this->keypair.Q, | ^~~ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:109:71: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'd' 109 | return mbedtls_ecp_gen_keypair(&this->keypair.grp, &this->keypair.d, &this->keypair.Q, | ^ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:109:89: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'Q' 109 | return mbedtls_ecp_gen_keypair(&this->keypair.grp, &this->keypair.d, &this->keypair.Q, | ^ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:111:52: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'd' 111 | mbedtls_mpi_write_binary(&this->keypair.d, pvtBits, mbedtls::P256::PvtLen::value) == 0 && | ^ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:112:58: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'grp' 112 | mbedtls_ecp_point_write_binary(&this->keypair.grp, &this->keypair.Q, | ^~~ c:\Users\myuser\Documents\Arduino\libraries\NDNph\src/ndnph/port/ec/mbed.hpp:112:78: error: 'mbedtls_ecp_keypair' {aka 'struct mbedtls_ecp_keypair'} has no member named 'Q' 112 | mbedtls_ecp_point_write_binary(&this->keypair.grp, &this->keypair.Q, | ^ In file included from c:\Users\myuser\Documents\Arduino\libraries\esp8266ndn\src/esp8266ndn.h:18: c:\Users\myuser\Documents\Arduino\libraries\esp8266ndn\src/transport/ble-server-transport.hpp: In member function 'String esp8266ndn::BleServerTransport::getAddr() const': c:\Users\myuser\Documents\Arduino\libraries\esp8266ndn\src/transport/ble-server-transport.hpp:78:56: error: 'class String' has no member named 'data' 78 | return String(::BLEDevice::getAddress().toString().data()) + " (addr-type=public)"; | ^~~~ c:\Users\myuser\Documents\Arduino\libraries\esp8266ndn\src/transport/ble-server-transport.hpp: In member function 'virtual void esp8266ndn::BleServerTransport::CsCallbacks::onWrite(BLECharacteristic*)': c:\Users\myuser\Documents\Arduino\libraries\esp8266ndn\src/transport/ble-server-transport.hpp:117:40: error: conversion from 'String' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string'} requested
117 | std::string value = chr->getValue();
| ~~~~~~~~~~~~~^~
exit status 1
Compilation error: exit status 1
```
which is weired as the file does in fact exist.
But when I try to compile this program (I just import the file which couldn't be found in the previous step)
I get a file not found exception
Expand Stacktrace 2
``` C:\Users\myuser\Downloads\arduino_sketch\arduino_sketch.ino:1:10: fatal error: ndnph/port/ec/mbed.hpp: No such file or directory 1 | #include
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: ndnph/port/ec/mbed.hpp: No such file or directory
```
It would be awesome if you could help me.