Install C library to ESP IDF VS Code(open62541)

lubos123
Posts: 1
Joined: Mon Oct 16, 2023 2:47 pm

Install C library to ESP IDF VS Code(open62541)

Postby lubos123 » Mon Oct 16, 2023 2:49 pm

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.

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Tue Oct 17, 2023 1:13 pm

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)

Who is online

Users browsing this forum: Baidu [Spider] and 67 guests