Page 1 of 1

Install C library to ESP IDF VS Code(open62541)

Posted: Mon Oct 16, 2023 2:49 pm
by lubos123
Hello, I am starting to program in ESP IDF in VSCode. I need to run open62541 library on ESP32 Ethernet dev kit. I used to program a lot in Arduino ide, but now I don't know where to bounce with Including the library. Can you have give some tutorials with redoing the library?
I found Publisher on github (https://github.com/cmbahadir/opcua-pubs ... ree/master). But I can't find it when I open the project. It reports errors as if OPEN62541 is not installed. Does it have to be installed somehow? I thought all the libraries were in the components folder.
I would be very grateful for help.

Re: Install C library to ESP IDF VS Code(open62541)

Posted: Tue Oct 17, 2023 1:13 pm
by MicroController
The CMakeLists.txt files don't look right. Try this:
opcua-pubsub-esp32/CMakeLists.txt:

Code: Select all

# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)


include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# Comment/remove this:
# set(EXTRA_COMPONENTS_DIRS "components/open62541lib" "components/DHT22" "components/ethernet")
project(opcua_pubsub_esp32)
and
opcua-pubsub-esp32/main/CMakeLists.txt:

Code: Select all

idf_component_register(SRCS "opcua_pubsub_esp32.c"
                    INCLUDE_DIRS "."
                    REQUIRES open62541lib DHT22 ethernet)