Framework:
ESP-IDF v4.3.1 - Eclipse Plugin
Project with 1 active component (my plan is to add ble scanning, mqtt messaging and wifi access)
IDF_PATH: C:\Users\username\source\esp-idf-v4.3.1\
IDF_TOOLS_PATH: C:\Users\username\.espressif
Goal:
Add MQTT capability to a custom component in ESP-IDF
Issue:
../components/mqtt/include/mqtt.h:24:10: fatal error: mqtt_client.h: No such file or directory
#include "mqtt_client.h"
Project Directory Contents:
Contents of /components/mqtt/CMakeLists.txt:
idf_component_register(SRCS "mqtt.c"
INCLUDE_DIRS "include"
REQUIRES mqtt esp-tls)
I added the mqtt and esp-tls required components to the CMakeLists.txt file as directed by the ESP-IDF documentation here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#idf-component-commands
Attempt to Fix 1
My first attempt at fixing this code was to update the contents of /components/mqtt/CMakeLists.txt to directly reference the required include files:
idf_component_register(SRCS
"mqtt.c"
"C:/Users/user/source/esp-idf-v4.3.1/components/mqtt/esp-mqtt/mqtt_client.c"
"C:/Users/user/source/esp-idf-v4.3.1/components/esp-mqtt/lib/mqtt_msg.c"
"C:/Users/user/source/esp-idf-v4.3.1/components/esp-mqtt/lib/mqtt_outbox.c"
"C:/Users/user/source/esp-idf-v4.3.1/components/esp-mqtt/lib/platform_esp32_idf.c"
INCLUDE_DIRS
"include"
"C:/Users/user/source/esp-idf-v4.3.1/components/mqtt/esp-mqtt/include"
"C:/Users/user/source/esp-idf-v4.3.1/components/esp-tls"
"C:/Users/user/source/esp-idf-v4.3.1/components/mbedtls/mbedtls/include"
"C:/Users/user/source/esp-idf-v4.3.1/components/mbedtls/port/include"
"C:/Users/user/source/esp-idf-v4.3.1/components/tcp_transport/include"
"C:/Users/user/source/esp-idf-v4.3.1/components/nghttp/port/include"
PRIV_INCLUDE_DIRS "C:/Users/user/source/esp-idf-v4.3.1/components/mqtt/esp-mqtt/lib/include"
REQUIRES lwip nghttp mbedtls)
This builds, but there has to be a better way to build the mqtt component. Can anyone help me modify my CMakeLists.txt file to properly pull the esp-idf mqtt component in?
You have a naming conflict. You're trying to create a custom component named mqtt which requires the system component named mqtt and you expect the build system to figure it out. That's just asking for trouble :)
Name your component myproject-mqtt or something. Watch out for similar problems with your components wifi and ble.
Related
I already create an .aar (android library) files in android studio and want to call/use it in nativescript-vue project.
I have placed the aar file in "app/App_Resources/Android/libs" folder.
Based on my reading, in typescript the way to call the method in aar files is by calling com.package.MyClass.
My question is , how to call it in .vue files. I have tried to call the method using the same approach but its produce an error :
Module not found: Error: Can't resolve com.package.MyClass
Can someone please help me on this.
Your help is very much appreciated.
You may simply place your AAR file in your App_Resources/Android/libs directory, CLI will pick it up at build time and the native APIs should be available at runtime within your project.
Try a clean build if you see errors, make sure the AAR is picked up. You might be able to verify it from the CLI logs. If you still see issues, make sure the class you are trying to access is public.
I'm not sure it's possible to use the android lib directly in the main project or not. In my way, I create a NS plugin that includes the .aar library, then add this plugin to the main project & use the methods defined in the .aar library without problem.
If you place the .aar library in the main project, you should check if that .aar library is installed by running tns build command & look at console log. If it's installed together with the project, that means you can use the lib method in .vue or any .js files.
My team and I are currently working on a project that involve a ST board (the STM32L072CZYxx) to create a bidirectionnal GSM-LoRa gateway.
As we've already succeeded in implementing the GSM side of the gateway, we are currently working on the LoRa part of the project. To achieve this, we're trying to use the I-CUBE-LRWAN, but can't figure out how to add this library to the STM32CubeMX project. It seems like, this library can't be added to our project through STM32CubeMX. The only solution we have is to add manually the library to the project but we can't figure out how to do it. We imported the middlewares we needed into the project however, the IDE we use (Atollic TRUEStudio or SW4STM32) detects a lot of errors in the project and we really don't understand why (the source for middlewares were coded by ST, so basically no errors).
I'm guessing that is Murata LoRa Module. First time I tried that I was not able to add library to existing project.
There is some error that occur because of length of path names -on windows- you can copy and paste the project to shorten the path name and then i was able to program the module to use it as AT command slave.
And also there is 3 target project on that project file you need to select the proper target for it.
I'm trying to compile custom ejabberd module which has multiple files in src/ and include/.
My module is conforming to https://github.com/processone/ejabberd-contrib guidelines and using ejabberdctl module_check produces "ok".
When I'm compiling and installing module with only one source, everything works as expected and ejabberdctl module_install installs module.
But when I have multiple source files, ejabberdctl module_install doesn't compile anything but file with exact name of my module.
I want to avoid manual compilation and rebar if possible. So my question is how to configure my module and where so that ejabberdctl module_install can build and install my module.
If that is not possible could you point me to some rebar script that can serve that purpose.
And finally can someone point me to some resource that explains why Erlang/OTP projects seem to have rigid file structure (I'm coming form c++ world and there IMO, tools and projects are way more forgiving in respect to file structure)
Details:
Erlang 18
ejabberd 15.11.120 (built from source)
if you install module by "ejabberdctl" you don't have to config in ejabberd.yml
other way is install module with source, you must copy file beam to lib/ejabberd... and config file config like README.TXT
I am developing a library (JAR) that is meant to be used across many projects. I am using SLF4j for logging, and so I have declared the SLF4J API JAR to be a compile configuration.
When I'm developing this library locally on my machine, I'd like to run tests and see the output from all the SLF4J log statements. Or, outside of a test, it helps to add a temporary main(String[]) method to a random class and test functionality and log output as if the lib was an executable JAR. Since SLF4J's default binding is a No-Op (no output whatsoever), I have been getting by so far by adding the SLF4J Simple binding as a compile configuration dependency while I am developing & testing. Then, before I commit and publish, I simply remove the Simple binding as a dependency (since each developer who uses my lib should be able to select their own binding).
This is hacky and I know Gradle support custom configs, but I have yet to see a coherent example that could act as a guide. Ideally I'd like to define a custom dev configuration so that as a dependency I could have:
dependencies {
compile 'org.slf4j:slf4j-api:1.7.5'
dev 'org.slf4j:slf4j-simple:1.7.5' // Only used when running/testing locally
}
...but then ony the SLF4J API JAR gets added to my pom. Any ideas as to how to accomplish this? Perhaps Gradle already has such a concept built into it, or perhaps a custom configuration isn't even the right approach.
I have a dll which provides a simple functionality (called HelloCpp.dll) and
I need to access to the content of this library from Karaf container via REST calls.
I created a simple maven bundle which provides the REST api and a class (HelloJNI) which loads HelloCpp.dll using: System.loadLibrary("HelloCpp");
I have also addressed this dll in my POM file using: <Bundle-NativeCode>HelloCpp.dll</Bundle-NativeCode>
I have coppied the dll in both project directory and also karaf/lib folder.
I can successfuly install the bundle and I don't receive any compilation error as well, but when I deploy my bundle into Karaf container and try to start bundle, I get this error message: No matching native libraries found.
Could you please help me to solve the problem? Maybe I don't address the dll correctly in the POM file.
Thanks in advance,
Mandana