Open atfox98 opened 1 week ago
Found some advice on the espressif forums (buried on page 2) to add a build flag to the platformio configuration. I added the following to platformio.ini
and am now getting a successful build:
build_flags =
-DCOMPONENT_EMBED_TXTFILES=components/golioth-firmware-sdk/src/isrgrootx1.der
I really wonder why this was needed as golioth-firmware-sdk/port/esp_idf/components/golioth_sdk/CMakeLists.txt
clearly has this in lines 50-51. I have pushed this changed into my minimal example repository. I plan to test a few of the golioth examples to make sure everything is working then close the issue.
Hey @atfox98, great find, glad you can now build your application.
I started having problems again when I adapted the golioth hello example. There were a ton of linker errors - undefined references to every golioth function I called. I inspected all the build artifacts and tried several things to fix this before finally posting on the PlatformIO forums.
Turns out the problem here was between C and C++. There are some changes you can make to the golioth header files to address this. maxgerhardt provides several links in his response to my forum post with more details.
In the meantime, I was able to fix the linker errors by throwing an extern "C" { }
around the includes for the golioth headers.
I overlooked the fact that PlatformIO applications are written in C++. We do have a minimal example for ESP-IDF to verify that a C++ application can be used with Golioth. It also uses the extern "C"
around the includes as your application. We'll take a look at adding changes to header files to address the issue.
Golioth Firmware SDK Commit Hash
bb11ba9bd2388f30215dd345b3061a946f69003c
Platform/OS
PlatformIO (framework = arduino, espidf). Appears to be ESP-IDF 4.4.6
Hardware Target
ESP32
What host OS are you using?
Windows 10
Current Behavior
Problems including golioth-firmware-sdk into PlatformIO project. Golioth settings show up in menuconfig but compilation fails. See repo @ https://github.com/atfox98/golioth-pio.
Expected Behavior
Successful build
Steps To Reproduce
Clone minimal example repository @ https://github.com/atfox98/golioth-pio
Logs, console output, or any kind of debug information