-
Notifications
You must be signed in to change notification settings - Fork 85
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
Micro-XRCE-DDS on ESP8266 using PlatformIO + Arduino library #208
Comments
Hello @tieugiang91, Some points:
Please try to use the polling-less transports, and if it does not fit your requirements, we can talk here about how to use custom transports. It would be super nice to have some explanations and steps on how to replicate your use case. |
Thank you for the answer.
|
In which point you are building the XRCE-DDS Client library? |
I built it in /home/username/Micro-XRCE-DDS-Client directory. |
But how are you building the library? |
I cloned it from Github and followed the instructions in the documentation at: https://micro-xrce-dds.docs.eprosima.com/en/latest/installation.html#installing-the-client-stand-alone |
But you are building the XRCE-DDS Client library for your computer, it is not being cross-compiled for ESP8266, are you aware of that? |
Ah, thank you, I've got the point, let me try it then. |
@pablogs9, udp_transport_posix_nopoll was used and there's no more trouble with <poll.h>. However, some dependencies such as <sys/socket.h> and <netdb.h> in udp_transport_posix_nopool.c, ip_posix.c, etc. seems still not to be recognized. Are there any ways to work around this, please? |
Could you please provide some steps for reproducing your scenario and use case? |
I created a PIO project, copied both built header and source code of xrcedds library into the "lib" folder, disabled (by comment) posix poll and windows code. |
I guess that you should be cross-compiling the library using CMake and a CMake toolchain. Once you have a static library (.a) you should link your app against it. |
Oh, that's it. Thank you, let me try it then. |
@pablogs9 After using Cmake and CMake toolchain to build the library, I got the error:
Adding "" as:
Steps to reproduce:
May you kindly suggest a solution please? |
Can you paste here the error that appears when
The error pasted in your last comment is a CMake error but you say that the CMake step went well. |
Could you please copy-paste that text instead of screenshotting? |
The result of:
is:
And the result of
is:
|
Try with |
You will need to build separately Micro CDR and Micro XRCE-DDS Client and probably use the |
gives the same error. |
I have done this: mkdir my_project && cd my_project
export ROOT=$(pwd)
wget https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz # From here: https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/linux-setup.html
tar -xzf xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz
cd $ROOT
git clone -b v1.2.1 https://github.com/eProsima/Micro-CDR
cd Micro-CDR
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ROOT/toolchain.cmake -DCMAKE_INSTALL_PREFIX=$ROOT/install ..
make
make install
cd $ROOT
git clone -b master https://github.com/eProsima/Micro-XRCE-DDS-Client
cd Micro-XRCE-DDS-Client
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ROOT/toolchain.cmake -DUCLIENT_SUPERBUILD=OFF -DCMAKE_PREFIX_PATH=$ROOT/install -DCMAKE_INSTALL_PREFIX=$ROOT/install ..
make
make install This should give an error because of FreeRTOS includes that should be added to the toolchain. The toolchain.cmake is: include(CMakeForceCompiler)
set(CMAKE_SYSTEM_NAME Generic)
set(PLATFORM_NAME "FreeRTOS_Plus_TCP")
set(CMAKE_CROSSCOMPILING True)
SET (CMAKE_C_COMPILER_WORKS 1)
SET (CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_C_COMPILER $ENV{ROOT}/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc)
set(CMAKE_CXX_COMPILER $ENV{ROOT}/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++)
set(CMAKE_ASM_COMPILER $ENV{ROOT}/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
include_directories(SYSTEM
// Fill here your FreeRTOS includes
) |
Thank you for the reply. The problem is I also don't know the correct way to include ESP8266 RTOS SDK library without including the default project.cmake as in the hello-world template at |
After manually including FreeRTOS libraries and headers and following the steps above, I still got the following errors while buiding with CMake:
The toolchain file is:
May you point out what's wrong with the compilation please? |
Have you disabled TCP and serial profiles if you are not going to use them? Micro-XRCE-DDS-Client/CMakeLists.txt Line 47 in 69134a9
|
After disabling it gave the next error:
|
You need to include the header where those objects are defined in your FreeRTOS installation. |
After including the headers, it still gave the following errors:
The config.h is generated as:
|
#239 merged, try it now |
Thank you, the fix works well. The rest seems again my header trouble errors, I'll try to fix it then update later. |
Thank you for the support. Finally, the libmicroxrcedds_client.a has been built.
then it gave the linking errors after the "make" command:
Are there any wrong configurations, please? |
You are not linking against your FreeRTOS libraries, I guess that this is not related to micro-ROS |
I'm trying to apply Micro-XRCE-DDS on a NodeMCU board with ESP8266 microprocessor.
The IDE is Visual Studio Code with PlatformIO plugin, Arduino is used for Wifi connection. Micro-XRCE-DDS library is also included. However, there are errors in udp_transport_posix.h at:
#include <sys/socket.h>
#include <poll.h>
It seems that the 2 libraries is are Linux only, not on arduinoespressif8266. Is there any customization or configuration that I can do to make it work on that specific board, please?
The text was updated successfully, but these errors were encountered: