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

BUILD ERROR in Arduino MKR GSM 1400 and Arduino MKR NB 1500 #206

Closed
n9p7v opened this issue Jun 19, 2024 · 18 comments · Fixed by #223
Closed

BUILD ERROR in Arduino MKR GSM 1400 and Arduino MKR NB 1500 #206

n9p7v opened this issue Jun 19, 2024 · 18 comments · Fixed by #223

Comments

@n9p7v
Copy link

n9p7v commented Jun 19, 2024

I am working on both of the forementioned Arduino boards trying to connect to my ThingsBoard server using the 0000-arduino_send_telemetry example, modified with the relevant GSM/NB initializations.

I can build the example with the SDK v0.10.2, although it cannot connect to the server, for which I should probably create another issue topic. The next SDK versions are not compiling.

The output is the following:

In file included from c:\Workspace\Arduino\libraries\ThingsBoard\src/OTA_Handler.h:10:0,
                 from c:\Workspace\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:10,
                 from C:\Workspace\Arduino\nb1500\nb1500.ino:3:
c:\Workspace\Arduino\libraries\ThingsBoard\src/Callback_Watchdog.h:12:10: fatal error: Ticker.h: No such file or directory
 #include <Ticker.h>
          ^~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1
@MathewHDYT
Copy link
Contributor

Simply set THINGSBOARD_ENABLE_OTA to 0, before including ThingsBoard.

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

Simply set THINGSBOARD_ENABLE_OTA to 0, before including ThingsBoard.

I did define #define THINGSBOARD_ENABLE_OTA 0 before the ThingsBoard header file, but still is not compiling. I also added the Ticker, and Seeed_mbedtls libraries.

The output although has changed to:

C:\Workspace\Arduino\nb1500\nb1500.ino:21:44: error: no matching function for call to 'ThingsBoardSized<>::ThingsBoardSized(MqttClient&, const uint16_t&)'
 ThingsBoard tb(mqttClient, MAX_MESSAGE_SIZE);
                                            ^
In file included from C:\Workspace\Arduino\nb1500\nb1500.ino:4:0:
c:\Workspace\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:349:5: note: candidate: ThingsBoardSized<MaxFieldsAmount, MaxSubscribtions, MaxAttributes, MaxRPC, Logger>::ThingsBoardSized(IMQTT_Client&, const uint16_t&, const size_t&) [with unsigned int MaxFieldsAmount = 8; unsigned int MaxSubscribtions = 2; unsigned int MaxAttributes = 5; unsigned int MaxRPC = 0; Logger = DefaultLogger; uint16_t = short unsigned int; size_t = unsigned int]
     ThingsBoardSized(IMQTT_Client& client, uint16_t const & bufferSize = Default_Payload, size_t const & maxStackSize = Default_Max_Stack_Size)
     ^~~~~~~~~~~~~~~~
c:\Workspace\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:349:5: note:   no known conversion for argument 1 from 'MqttClient' to 'IMQTT_Client&'
c:\Workspace\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:330:7: note: candidate: ThingsBoardSized<>::ThingsBoardSized(const ThingsBoardSized<>&)
 class ThingsBoardSized {
       ^~~~~~~~~~~~~~~~
c:\Workspace\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:330:7: note:   candidate expects 1 argument, 2 provided
c:\Workspace\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:330:7: note: candidate: ThingsBoardSized<>::ThingsBoardSized(ThingsBoardSized<>&&)
c:\Workspace\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:330:7: note:   candidate expects 1 argument, 2 provided
Multiple libraries were found for "PubSubClient.h"
  Used: C:\Workspace\Arduino\libraries\PubSubClient
  Not used: C:\Workspace\Arduino\libraries\TBPubSubClient
exit status 1

Compilation error: no matching function for call to 'ThingsBoardSized<>::ThingsBoardSized(MqttClient&, const uint16_t&)'

@MathewHDYT
Copy link
Contributor

It seems to have issues with the constructor, perhaps with the interface?

Can you add this workaround for now.

IMQTT_Client& mqttClient = Arduino_MQTT_Client(espClient);
ThingsBoard tb(mqttClient, MAX_MESSAGE_SIZE);

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

Can you add this workaround for now.

Thanks for your effort, it seems that there is an incompatibility, I get the following error now.

error: invalid initialization of non-const reference of type 'IMQTT_Client&' from an rvalue of type 'MqttClient'
 IMQTT_Client& mqttClient = MqttClient(client);
                            ^~~~~~~~~~~~~~~~~~
Compilation error: invalid initialization of non-const reference of type 'IMQTT_Client&' from an rvalue of type 'MqttClient'

@MathewHDYT
Copy link
Contributor

Change it according to this, that should fix the rvalue being assigned to an lvalue reference and instead assign it to an rvalue-reference.

IMQTT_Client&& mqttClient = Arduino_MQTT_Client(espClient);
ThingsBoard tb(mqttClient, MAX_MESSAGE_SIZE);

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

These are the initializations I do in accordance with your suggestion.

NB nb;
GPRS gprs;
NBClient client;
IMQTT_Client& mqttClient = MqttClient(client);
ThingsBoard tb(mqttClient, MAX_MESSAGE_SIZE);

@MathewHDYT
Copy link
Contributor

No I changed it you have to use &&, this allows to use an rvalue (temporary object) and pass it to a refence. That will fix the compilation error you got previously.

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

No I changed it you have to use &&

Ohh, I did the same error, but the outcome is almost the same.

error: invalid initialization of reference of type 'IMQTT_Client&&' from expression of type 'MqttClient'
 IMQTT_Client&& mqttClient = MqttClient(client);

@MathewHDYT
Copy link
Contributor

Okay I've tried to not use pointers but I doesn't work I guess :(. Try the below code and sorry for the inconviences.

IMQTT_Client * mqttClient = new MqttClient(client);
ThingsBoard tb(*mqttClient, MAX_MESSAGE_SIZE);

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

IMQTT_Client * mqttClient = new MqttClient(client);
ThingsBoard tb(*mqttClient, MAX_MESSAGE_SIZE);

error: cannot convert 'MqttClient*' to 'IMQTT_Client*' in initialization
 IMQTT_Client * mqttClient = new MqttClient(client);

Compilation error: cannot convert 'MqttClient*' to 'IMQTT_Client*' in initialization

@MathewHDYT
Copy link
Contributor

MathewHDYT commented Jun 19, 2024

Try this perhaps there needs to be an additional cast

IMQTT_Client * mqttClient = (IMQTT_Client*) new Arduino_MQTT_Client(client);
ThingsBoard tb(*mqttClient, MAX_MESSAGE_SIZE);

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

IMQTT_Client * mqttClient = (IMQTT_Client*) new Arduino_MQTT_Client(client);

That seems to work, but a lot more errors show up, about Ticker.

This is all the log output.

Processing release (platform: atmelsam; board: mkrnb1500; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/mkrnb1500.html
PLATFORM: Atmel SAM (8.2.1) > Arduino MKR NB 1500
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink)
PACKAGES: 
 - framework-arduino-samd @ 1.8.13 
 - framework-cmsis @ 1.40500.0 (4.5.0) 
 - framework-cmsis-atmel @ 1.2.2 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 20 compatible libraries
Scanning dependencies...
Dependency Graph
|-- MKRNB @ 1.6.0
|-- ArduinoMqttClient @ 0.1.8
|-- ArduinoHttpClient @ 0.6.0
|-- ThingsBoard @ 0.13.0
|-- Ticker @ 4.4.0
|-- Seeed_Arduino_mbedtls @ 3.0.1
|-- PubSubClient @ 2.8.0
Building in release mode
Compiling .pio\build\release\src\main.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\GPRS.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\Modem.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NB.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NBClient.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NBFileUtils.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NBModem.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NBPIN.cpp.o
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp: In member function 'uint32_t NBFileUtils::downloadFile(arduino::String, const char*, uint32_t, bool)':
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp:117:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (auto i = 0; i < size; i++) {
                          ~~^~~~~~
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp: In member function 'uint32_t NBFileUtils::readFile(arduino::String, arduino::String*)':
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp:179:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (auto i = 0; i < size; i++) {
                      ~~^~~~~~
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp: In member function 'uint32_t NBFileUtils::readFile(arduino::String, uint8_t*)':
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp:226:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (auto i = 0; i < size; i++) {
                      ~~^~~~~~
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp: In member function 'uint32_t NBFileUtils::readBlock(arduino::String, uint32_t, uint32_t, uint8_t*)':
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp:273:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (auto i = 0; i < size; i++) {
                      ~~^~~~~~
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp: In member function 'int NBFileUtils::deleteFiles()':
.pio\libdeps\release\MKRNB\src\NBFileUtils.cpp:316:9: warning: unused variable 'num' [-Wunused-variable]
     int num = listFiles(files);
         ^~~
Compiling .pio\build\release\lib2b0\MKRNB\NBSSLClient.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NBScanner.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NBUdp.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\NB_SMS.cpp.o
Compiling .pio\build\release\lib2b0\MKRNB\utility\NBSocketBuffer.cpp.o
Compiling .pio\build\release\lib4f8\ArduinoMqttClient\MqttClient.cpp.o
Compiling .pio\build\release\lib6a7\ArduinoHttpClient\HttpClient.cpp.o
Compiling .pio\build\release\lib6a7\ArduinoHttpClient\URLEncoder.cpp.o
Compiling .pio\build\release\lib6a7\ArduinoHttpClient\WebSocketClient.cpp.o
Compiling .pio\build\release\lib6a7\ArduinoHttpClient\b64.cpp.o
Compiling .pio\build\release\lib6a7\ArduinoHttpClient\utility\URLParser\http_parser.c.o
Archiving .pio\build\release\lib2b0\libMKRNB.a
Compiling .pio\build\release\lib5c5\Ticker\Ticker.cpp.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\aes.c.o
Archiving .pio\build\release\lib4f8\libArduinoMqttClient.a
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\aesni.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\arc4.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\aria.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\asn1parse.c.o
Archiving .pio\build\release\lib6a7\libArduinoHttpClient.a
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\asn1write.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\base64.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\bignum.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\blowfish.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\camellia.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ccm.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\certs.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\chacha20.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\chachapoly.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\cipher.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\cipher_wrap.c.o
Archiving .pio\build\release\lib5c5\libTicker.a
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\cmac.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ctr_drbg.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\debug.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\des.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\dhm.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ecdh.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ecdsa.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ecjpake.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ecp.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ecp_curves.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\entropy.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\error.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\gcm.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\havege.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\hkdf.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\hmac_drbg.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\md.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\md2.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\md4.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\md5.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\md_wrap.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\memory_buffer_alloc.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\nist_kw.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\oid.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\padlock.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pem.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pk.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pk_wrap.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pkcs11.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pkcs12.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pkcs5.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pkparse.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\pkwrite.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\platform.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\platform_util.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\poly1305.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ripemd160.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\rsa.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\rsa_internal.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\sha1.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\sha256.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\sha512.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ssl_cache.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ssl_ciphersuites.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ssl_cli.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ssl_cookie.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ssl_srv.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ssl_ticket.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\ssl_tls.c.o
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\library\ssl_ticket.c: In function 'mbedtls_ssl_ticket_write':
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\library\ssl_ticket.c:337:17: warning: implicit declaration of function 'mbedtls_cipher_auth_encrypt'; did you mean 'mbedtls_cipher_crypt'? [-Wimplicit-function-declaration]
     if( ( ret = mbedtls_cipher_auth_encrypt( &key->ctx,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                 mbedtls_cipher_crypt
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\library\ssl_ticket.c: In function 'mbedtls_ssl_ticket_parse':
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\library\ssl_ticket.c:428:17: warning: implicit declaration of function 'mbedtls_cipher_auth_decrypt'; did you mean 'mbedtls_cipher_crypt'? [-Wimplicit-function-declaration]
     if( ( ret = mbedtls_cipher_auth_decrypt( &key->ctx, iv, 12,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                 mbedtls_cipher_crypt
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\threading.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\version.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\version_features.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\x509.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\x509_create.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\x509_crl.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\x509_crt.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\x509_csr.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\x509write_crt.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\x509write_csr.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\library\xtea.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\port\esp_hardware.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\port\esp_mem.c.o
Compiling .pio\build\release\lib8f9\Seeed_Arduino_mbedtls\port\mbedtls_debug.c.o
Compiling .pio\build\release\libac7\PubSubClient\PubSubClient.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\Arduino_ESP32_Updater.cpp.o
In file included from .pio\libdeps\release\Seeed_Arduino_mbedtls\src/mbedtls/esp_debug.h:21:0,
                 from .pio\libdeps\release\Seeed_Arduino_mbedtls\src\port\mbedtls_debug.c:21:
.pio\libdeps\release\Seeed_Arduino_mbedtls\src/arduino_config.h:7:0: warning: "CONFIG_MBEDTLS_AES_C" redefined
 #define CONFIG_MBEDTLS_AES_C 1

In file included from .pio\libdeps\release\Seeed_Arduino_mbedtls\src/mbedtls/config.h:30:0,
                 from .pio\libdeps\release\Seeed_Arduino_mbedtls\src/mbedtls/platform.h:37,
                 from .pio\libdeps\release\Seeed_Arduino_mbedtls\src\port\mbedtls_debug.c:18:
.pio\libdeps\release\Seeed_Arduino_mbedtls\src/mbedtls/sdkconfig.h:10:0: note: this is the location of the previous definition
 #define CONFIG_MBEDTLS_AES_C

.pio\libdeps\release\Seeed_Arduino_mbedtls\src\port\mbedtls_debug.c: In function 'mbedtls_esp_enable_debug_log':
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\port\mbedtls_debug.c:33:19: warning: variable 'level' set but not used [-Wunused-but-set-variable]
     unsigned char level = 0;
                   ^~~~~
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\port\mbedtls_debug.c: In function 'mbedtls_esp_debug':
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\port\mbedtls_debug.c:68:9: warning: implicit declaration of function 'xprintf'; did you mean 'dprintf'? [-Wimplicit-function-declaration]
         xprintf("%s:%d %s\r\n", file, line, str);
         ^~~~~~~
         dprintf
.pio\libdeps\release\Seeed_Arduino_mbedtls\src\port\mbedtls_debug.c:83:9: warning: implicit declaration of function 'ESP_LOGE' [-Wimplicit-function-declaration]
         ESP_LOGE(TAG, "Unexpected log level %d: %s", level, str);
         ^~~~~~~~
Compiling .pio\build\release\lib528\ThingsBoard\Arduino_ESP8266_Updater.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\Arduino_HTTP_Client.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\Arduino_MQTT_Client.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\Callback_Watchdog.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\Espressif_MQTT_Client.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\Espressif_Updater.cpp.o
.pio\libdeps\release\PubSubClient\src\PubSubClient.cpp: In member function 'boolean PubSubClient::publish_P(const char*, const uint8_t*, unsigned int, boolean)':
.pio\libdeps\release\PubSubClient\src\PubSubClient.cpp:523:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     return (rc == expectedLength);
             ~~~^~~~~~~~~~~~~~~~~
Compiling .pio\build\release\lib528\ThingsBoard\HashGenerator.cpp.o
Archiving .pio\build\release\lib8f9\libSeeed_Arduino_mbedtls.a
Compiling .pio\build\release\lib528\ThingsBoard\Helper.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\OTA_Update_Callback.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\Provision_Callback.cpp.o
Compiling .pio\build\release\lib528\ThingsBoard\RPC_Request_Callback.cpp.o
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp: In constructor 'Callback_Watchdog::Callback_Watchdog(std::function<void()>)':
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp:20:21: error: no matching function for call to 'Ticker::Ticker()'
   , m_oneshot_timer()
                     ^
In file included from .pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.h:12:0,
                 from .pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp:2:
.pio\libdeps\release\Ticker/Ticker.h:74:2: note: candidate: Ticker::Ticker(fptr, uint32_t, uint32_t, resolution_t)
  Ticker(fptr callback, uint32_t timer, uint32_t repeat = 0, resolution_t resolution = MICROS);
  ^~~~~~
.pio\libdeps\release\Ticker/Ticker.h:74:2: note:   candidate expects 4 arguments, 0 provided
.pio\libdeps\release\Ticker/Ticker.h:62:7: note: candidate: Ticker::Ticker(const Ticker&)
 class Ticker {
       ^~~~~~
.pio\libdeps\release\Ticker/Ticker.h:62:7: note:   candidate expects 1 argument, 0 provided
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp: In destructor 'Callback_Watchdog::~Callback_Watchdog()':
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp:33:21: error: 'class Ticker' has no member named 'detach'
     m_oneshot_timer.detach();
                     ^~~~~~
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp: In member function 'void Callback_Watchdog::once(const uint64_t&)':
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp:44:21: error: 'class Ticker' has no member named 'once_ms'
     m_oneshot_timer.once_ms(timeout_millis, &Callback_Watchdog::oneshot_timer_callback);
                     ^~~~~~~
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp: In member function 'void Callback_Watchdog::detach()':
.pio\libdeps\release\ThingsBoard\src\Callback_Watchdog.cpp:52:21: error: 'class Ticker' has no member named 'detach'
     m_oneshot_timer.detach();
                     ^~~~~~
.pio\libdeps\release\ThingsBoard\src\Arduino_MQTT_Client.cpp: In member function 'virtual void Arduino_MQTT_Client::set_data_callback(IMQTT_Client::data_function)':
.pio\libdeps\release\ThingsBoard\src\Arduino_MQTT_Client.cpp:18:33: error: no matching function for call to 'PubSubClient::setCallback(IMQTT_Client::data_function&)'
     m_mqtt_client.setCallback(cb);
                                 ^
In file included from .pio\libdeps\release\ThingsBoard\src\Arduino_MQTT_Client.h:10:0,
                 from .pio\libdeps\release\ThingsBoard\src\Arduino_MQTT_Client.cpp:2:
.pio\libdeps\release\PubSubClient\src/PubSubClient.h:136:18: note: candidate: PubSubClient& PubSubClient::setCallback(void (*)(char*, uint8_t*, unsigned int))
    PubSubClient& setCallback(MQTT_CALLBACK_SIGNATURE);
                  ^~~~~~~~~~~
.pio\libdeps\release\PubSubClient\src/PubSubClient.h:136:18: note:   no known conversion for argument 1 from 'IMQTT_Client::data_function {aka std::function<void(char*, unsigned char*, unsigned int)>}' to 'void (*)(char*, uint8_t*, unsigned int) {aka void (*)(char*, unsigned char*, unsigned int)}'
Archiving .pio\build\release\libac7\libPubSubClient.a
*** [.pio\build\release\lib528\ThingsBoard\Callback_Watchdog.cpp.o] Error 1
*** [.pio\build\release\lib528\ThingsBoard\Arduino_MQTT_Client.cpp.o] Error 1
========================================================================================== [FAILED] Took 22.77 seconds ==========================================================================================

@MathewHDYT
Copy link
Contributor

The ticker you've included does not seem to have the same API as the one we expect.

For now can you set THINGSBOARD_ENABLE_OTA to 0 in the Configuration.h file

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

The ticker you've included does not seem to have the same API as the one we expect.

Am I using the wrong library? It's the Ticker by Stefan Staub.

For now can you set THINGSBOARD_ENABLE_OTA to 0 in the Configuration.h file

It's done.

@MathewHDYT
Copy link
Contributor

MathewHDYT commented Jun 19, 2024

I'll probably have to implement a workaround the problem is that real non blocking behaviour is not possible with boards that do not support FreeRTOS / ESP32.

For now disable OTA updates alltogether and I might try to implement the aforementioned fix in the future.

@n9p7v
Copy link
Author

n9p7v commented Jun 19, 2024

Alright, thank you for your help, I really appreciate it.

@Dewieinns
Copy link
Contributor

@n9p7v - Did you ever get this example working? I am attempting to do the exact same thing right now (which I guess is how I found this error also)

@MathewHDYT
Copy link
Contributor

If you do this step from a previous comment it should fix the issue for now.

For now can you set THINGSBOARD_ENABLE_OTA to 0 in the Configuration.h file

The aforementioned issue has also already been fixed on my fork. I will merge it soon, but I have to wait for the dependency to release a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants