Closed Kotochleb closed 2 years ago
Please copy here the whole build output log.
Can you share your whole code?
Why are you removing #include <micro_ros_arduino.h>
?
Here is main.cpp
file:
https://github.com/Kotochleb/microros_rp2040_robot/blob/main/src/main.cpp
I am not including micro_ros_arduino.h
since it does not add anything to the code. In case of specifying Raspberry Pi Pico it will force transport layer to be over wifi. If I don't define any target architecture, from what I understand from source code, it won't do anything. That is why I am defining transport layer myself.
In case of build log, the problem is that I exceed a boundary of how long my message on GitHub can be, and I tried to clip is as little as I could. Most of the logs are repetitive.
In some Arduino environments the include makes the build system to resolve the library:
Using board 'teensy41' from platform in folder: /home/pgarrido/.arduino15/packages/teensy/avr
Using core 'teensy4' from platform in folder: /home/pgarrido/.arduino15/packages/teensy/avr
Detecting libraries used...
/home/pgarrido/.arduino15/packages/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10607 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/pgarrido/.arduino15/packages/teensy/avr/cores/teensy4 /tmp/arduino-sketch-776FACD3F9198D5291708649B4419502/sketch/micro-ros_reconnection_example.ino.cpp -o /dev/null
CHECK HERE:
Alternatives for micro_ros_arduino.h: [micro_ros_arduino-0.0.1@2.0.4-rolling]
ResolveLibrary(micro_ros_arduino.h)
-> candidates: [micro_ros_arduino-0.0.1@2.0.4-rolling]
Maybe if you remove this line, the build system is not including the library and that's why the linker does not find the symbols.
I included the micro_ros_arduino.h
and I got error messages related to wifi.
I also added -U ARDUINO_NANO_RP2040_CONNECT
to ensure that this platform won't be compiled. But eventually, it still wants to include wifi anyway.
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: warning: extra tokens at end of #undef directive
Compiling .pio/build/maker_pi_cytron/lib0cf/SocketWrapper/MbedSSLClient.cpp.o
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: warning: extra tokens at end of #undef directive
Compiling .pio/build/maker_pi_cytron/lib0cf/SocketWrapper/MbedServer.cpp.o
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: warning: extra tokens at end of #undef directive
Compiling .pio/build/maker_pi_cytron/lib0cf/SocketWrapper/MbedUdp.cpp.o
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: warning: extra tokens at end of #undef directive
Compiling .pio/build/maker_pi_cytron/lib0cf/SocketWrapper/SocketHelpers.cpp.o
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: warning: extra tokens at end of #undef directive
Compiling .pio/build/maker_pi_cytron/lib0cf/SocketWrapper/utility/http_parser/http_parser.c.o
Compiling .pio/build/maker_pi_cytron/liba84/Ethernet/Ethernet.cpp.o
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: warning: extra tokens at end of #undef directive
<command-line>:0:2: warning: extra tokens at end of #undef directive
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:2: warning: extra tokens at end of #undef directive
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/http_parser/http_parser.c: In function 'http_parser_execute':
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/http_parser/http_parser.c:1817:31: warning: this statement may fall through [-Wimplicit-fallthrough=]
parser->upgrade = 1;
~~~~~~~~~~~~~~~~^~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/http_parser/http_parser.c:1819:13: note: here
case 1:
^~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/http_parser/http_parser.c: In function 'http_parser_parse_url':
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/http_parser/http_parser.c:2376:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
found_at = 1;
~~~~~~~~~^~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/http_parser/http_parser.c:2379:7: note: here
case s_req_server:
^~~~
*** [.pio/build/maker_pi_cytron/lib0cf/SocketWrapper/utility/http_parser/http_parser.c.o] Error 1
In file included from /home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedSSLClient.cpp:1:0:
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedSSLClient.h: In member function 'int arduino::MbedSSLClient::setRootCA()':
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedSSLClient.h:46:14: error: 'TLSSocket' was not declared in this scope
return ((TLSSocket*)sock)->set_root_ca_cert_path("/wlan/");
^~~~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedSSLClient.h:46:14: note: suggested alternative: 'DTLSSocket'
return ((TLSSocket*)sock)->set_root_ca_cert_path("/wlan/");
^~~~~~~~~
DTLSSocket
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedSSLClient.h:46:24: error: expected primary-expression before ')' token
return ((TLSSocket*)sock)->set_root_ca_cert_path("/wlan/");
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedSSLClient.h:46:25: error: expected ')' before 'sock'
return ((TLSSocket*)sock)->set_root_ca_cert_path("/wlan/");
^~~~
*** [.pio/build/maker_pi_cytron/src/main.cpp.o] Error 1
*** [.pio/build/maker_pi_cytron/lib0cf/SocketWrapper/MbedSSLClient.cpp.o] Error 1
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp: In member function 'int arduino::MbedClient::connectSSL(SocketAddress)':
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:123:16: error: expected type-specifier before 'TLSSocket'
sock = new TLSSocket();
^~~~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:134:19: error: 'TLSSocket' does not name a type; did you mean 'DTLSSocket'?
if (static_cast<TLSSocket *>(sock)->open(getNetwork()) != NSAPI_ERROR_OK) {
^~~~~~~~~
DTLSSocket
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:134:29: error: expected '>' before '*' token
if (static_cast<TLSSocket *>(sock)->open(getNetwork()) != NSAPI_ERROR_OK) {
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:134:29: error: expected '(' before '*' token
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:134:30: error: expected primary-expression before '>' token
if (static_cast<TLSSocket *>(sock)->open(getNetwork()) != NSAPI_ERROR_OK) {
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:134:39: error: 'class Socket' has no member named 'open'
if (static_cast<TLSSocket *>(sock)->open(getNetwork()) != NSAPI_ERROR_OK) {
^~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:134:77: error: expected ')' before '{' token
if (static_cast<TLSSocket *>(sock)->open(getNetwork()) != NSAPI_ERROR_OK) {
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:138:26: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
address = socketAddress;
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:141:42: error: 'TLSSocket' does not name a type; did you mean 'DTLSSocket'?
nsapi_error_t returnCode = static_cast<TLSSocket *>(sock)->connect(socketAddress);
^~~~~~~~~
DTLSSocket
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:141:52: error: expected '>' before '*' token
nsapi_error_t returnCode = static_cast<TLSSocket *>(sock)->connect(socketAddress);
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:141:52: error: expected '(' before '*' token
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:141:53: error: expected primary-expression before '>' token
nsapi_error_t returnCode = static_cast<TLSSocket *>(sock)->connect(socketAddress);
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/MbedClient.cpp:141:84: error: expected ')' before ';' token
nsapi_error_t returnCode = static_cast<TLSSocket *>(sock)->connect(socketAddress);
^
*** [.pio/build/maker_pi_cytron/lib0cf/SocketWrapper/MbedClient.cpp.o] Error 1
*** [.pio/build/maker_pi_cytron/lib0cf/SocketWrapper/MbedUdp.cpp.o] Error 1
*** [.pio/build/maker_pi_cytron/lib0cf/SocketWrapper/MbedServer.cpp.o] Error 1
In file included from /home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/SocketHelpers.cpp:104:0:
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:82:27: error: expected ')' before '*' token
HttpsRequest(TLSSocket* socket,
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h: In constructor 'HttpsRequest::HttpsRequest(NetworkInterface*, const char*, http_method, const char*, mbed::Callback<void(const char*, long unsigned int)>)':
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:62:23: error: expected type-specifier before 'TLSSocket'
_socket = new TLSSocket();
^~~~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:63:11: error: 'TLSSocket' was not declared in this scope
((TLSSocket*)_socket)->open(network);
^~~~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:63:11: note: suggested alternative: 'DTLSSocket'
((TLSSocket*)_socket)->open(network);
^~~~~~~~~
DTLSSocket
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:63:21: error: expected primary-expression before ')' token
((TLSSocket*)_socket)->open(network);
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:63:22: error: expected ')' before '_socket'
((TLSSocket*)_socket)->open(network);
^~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:65:23: error: expected primary-expression before ')' token
((TLSSocket*)_socket)->set_root_ca_cert(ssl_ca_pem);
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:65:24: error: expected ')' before '_socket'
((TLSSocket*)_socket)->set_root_ca_cert(ssl_ca_pem);
^~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:67:23: error: expected primary-expression before ')' token
((TLSSocket*)_socket)->set_root_ca_cert_path("/wlan/");
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:67:24: error: expected ')' before '_socket'
((TLSSocket*)_socket)->set_root_ca_cert_path("/wlan/");
^~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h: In member function 'virtual nsapi_error_t HttpsRequest::connect_socket(char*, uint16_t)':
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:103:18: error: 'TLSSocket' was not declared in this scope
return ((TLSSocket*)_socket)->connect(socketAddress);
^~~~~~~~~
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:103:18: note: suggested alternative: 'DTLSSocket'
return ((TLSSocket*)_socket)->connect(socketAddress);
^~~~~~~~~
DTLSSocket
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:103:28: error: expected primary-expression before ')' token
return ((TLSSocket*)_socket)->connect(socketAddress);
^
/home/user/.platformio/packages/framework-arduino-mbed@2.4.1/libraries/SocketWrapper/src/utility/https_request.h:103:29: error: expected ')' before '_socket'
return ((TLSSocket*)_socket)->connect(socketAddress);
^~~~~~~
*** [.pio/build/maker_pi_cytron/liba84/Ethernet/Ethernet.cpp.o] Error 1
*** [.pio/build/maker_pi_cytron/lib0cf/SocketWrapper/SocketHelpers.cpp.o] Error 1
Maybe you should add another target that is a bare RP2040 and is not related to RP2040 Nano. If you make those modifications in micro_ros_arduino.h
do not hesitate to contribute them via PR.
Sure. I will fork it and try to implement it.
Ok. I made it work over USB.
So far micro_ros_arduino.h
includes anything with wifi even though preprocessor should omit those includes. I will take a deeper look into that on the weekend.
It turned out the linker problem was solved in https://github.com/micro-ROS/micro_ros_arduino/issues/774.
With all that, I got nice 100 Hz published over USB. Right now, I will clean up all the stuff, make the code look better, do some more testing and hopefully the PR will be open in two weeks.
EDIT. Transport over Serial1 works as well, but so far, I only managed to get about 60 Hz out of it.
Nice, I'm closing. Please reopen if you have any related issue,
Hi. I tried to build micro_ros for RP2040 with Arduino support on a board with RP2040 that is not Arduino Nano RP2040 Connect. I would like not to use custom buildchains and use as much mainstrem code as possible. I want to connect with my SBC over UART, preferably UART 0, but right now serial over USB is fine. My code is modyfied micro-ros_publisher.ino without including
#include <micro_ros_arduino.h>
and withset_microros_transports()
changed to:My
platform.ini
looks as follows:While trying to build this code I get following warnings and finally build fails. I tried to rebuild the
libmicroros.a
from within the docker but it didn't fix the issue. Previously when I was experimenting with wizio-pico the code was building, but the SDK in this repo is too old and I had to move to someting more modern.Logs below show that the problem might be realted to linking to functions in
cortex-m0plus/libmicroros.a
file. (I had to clip part of the logs)