Skip to content
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

showng header file error like no such dictionary #382

Closed
Vishal-Birajdar opened this issue Dec 13, 2023 · 29 comments
Closed

showng header file error like no such dictionary #382

Vishal-Birajdar opened this issue Dec 13, 2023 · 29 comments
Assignees

Comments

@Vishal-Birajdar
Copy link

  • "wolfmqtt/mqtt_client.h" , "wolfmqtt/mqtt_packet.h" , "wolfmqtt/mqtt_sn_client.h" , "wolfmqtt/mqtt_client.h" error on these header file.
  • I just download latest release file and i build it in my stm32cube ide . but header file error showing
@dgarske
Copy link
Contributor

dgarske commented Dec 13, 2023

@lealem47 can you review this? Seems like they need the include path for Middlewares/Third_Party/wolfSSL_wolfMQTT_wolfMQTT added.
In my testing the pack did this automatically.

@lealem47
Copy link
Contributor

Hi @Vishal-Birajdar,
Can you confirm that you are using the wolfMQTT STM32Cube Pack? https://www.wolfssl.com/files/ide/I-CUBE-wolfMQTT.pack

More docs: https://github.com/wolfSSL/wolfMQTT/blob/master/IDE/STM32CUBE/README.md

Thanks,
Lealem @ wolfSSL

@lealem47
Copy link
Contributor

Note: Duplicate of ZD#17181

@Vishal-Birajdar
Copy link
Author

@lealem47 can you review this? Seems like they need the include path for Middlewares/Third_Party/wolfSSL_wolfMQTT_wolfMQTT added. In my testing the pack did this automatically.

I am giving direct folder path in library path option in stm32cube ide. this is not path issue, actually " wolfmqtt/mqtt_client.h ,
wolfmqtt/mqtt_sn_client.h "these three-header file defined or declared in some file but it not available in library.

@Vishal-Birajdar
Copy link
Author

Hi @Vishal-Birajdar, Can you confirm that you are using the wolfMQTT STM32Cube Pack? https://www.wolfssl.com/files/ide/I-CUBE-wolfMQTT.pack

More docs: https://github.com/wolfSSL/wolfMQTT/blob/master/IDE/STM32CUBE/README.md

Thanks, Lealem @ wolfSSL

I install pack in stm32cube ide as per document but in software pack then select component there is only wolfSSl otion available not a wolf mqtt
Screenshot 2023-12-13 230607

@lealem47
Copy link
Contributor

Looks like you only have the wolfSSL software pack installed. You can install the wolfMQTT pack following the instructions here https://github.com/wolfSSL/wolfMQTT/blob/master/IDE/STM32CUBE/README.md

@Vishal-Birajdar
Copy link
Author

there is no option wolfMQTT. (In stm32cube ide -> .ioc -> software packs -> select components ) Ifollow proper root but there is only wolfssl option
check below screenshoot
2023-12-13 230607

@lealem47
Copy link
Contributor

lealem47 commented Dec 13, 2023

Vishal,

I understand that it is not listed in your locally available pack list. In order to get it installed and onto that list, follow the documentation at the link I provided. https://github.com/wolfSSL/wolfMQTT/blob/master/IDE/STM32CUBE/README.md

The first few steps are:

  • Download the pack.
  • Run the “STM32CubeMX” tool.
  • Under “Manage software installations” pane on the right, click “INSTALL/REMOVE” button.
  • Select "From Local" and choose the downloaded pack “I-CUBE-wolfMQTT.pack”.
  • Accept the GPLv2 license.

@Vishal-Birajdar
Copy link
Author

Vishal-Birajdar commented Dec 13, 2023 via email

@Vishal-Birajdar
Copy link
Author

Hii,
I am using ethernet connetion with LWIP in stm32 and also configure the wolfmqtt with tls enable and lwip enable in IO option.
and In example- simplemqtt.c file paste in my main src folder and change broker credential like host,port usename,password.
but it not connected to host or broker.
what is implemetation step for stm32

@lealem47
Copy link
Contributor

Hi @Vishal-Birajdar,

and In example- simplemqtt.c file paste in my main src folder

I'm not sure what that means. Can me you tell about your setup? Is the broker expecting TLS? When you say it can't connect, is there an error code that you are seeing?

Can you confirm that you are calling the mqttsimple_test() function?

Thanks,
Lealem @ wolfSSL

@Vishal-Birajdar
Copy link
Author

problem solved now .

@Vishal-Birajdar
Copy link
Author

how can i use 'mqttclient_publish ,netconnect function in my main.c file.(showing error)
main.c generated by HAL ,
if I including wolfmqtt header file in main.c sowing error

@lealem47
Copy link
Contributor

I'm glad you solved the initial problem. What are the new errors that you are seeing?

To call MqttClient_Publish() from your main function, just add the following include to your main.c.

#include "wolfmqtt/mqtt_client.h"

Attach any relevant logs/errors if the build still fails.

@Vishal-Birajdar
Copy link
Author

main.txt
Screenshot from 2023-12-23 11-17-51
Screenshot from 2023-12-23 11-18-05
I am copy mqttsimple.c in my main.c file but showing error .

@lealem47
Copy link
Contributor

It looks like you missed copying some of the includes from mqttsimple.c to main.c. Mainly these ones:

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>

Also, in main.c you do not have to include userio_template.h if you are using lwIP

@Vishal-Birajdar
Copy link
Author

I add this library and call mqttsimple_test() function in main.c .
mqttsimple.h add in core-> Inc and mqttsimple.c add in core-> Src.
if callin mqttsimple_test showing following error.

/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.linux64_1.0.200.202301161003/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: ./Core/Src/main.o: in function main': /home/pvipl/STM32CubeIDE/workspace_1.12.1/wolfmqtt/Debug/../Core/Src/main.c:81: undefined reference to mqttsimple_test'
collect2: error: ld returned 1 exit status
make: *** [makefile:83: wolfmqtt.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

13:24:08 Build Failed. 3 errors, 1 warnings. (took 11s.713ms)

Screenshot from 2024-01-03 13-24-34
Screenshot from 2024-01-03 13-25-56
Screenshot from 2024-01-03 13-26-14

@lealem47
Copy link
Contributor

lealem47 commented Jan 3, 2024

It looks like that the mqttsimple example is guarded by the HAVE_SOCKET macro. Try adding #define HAVE_SOCKET to the wolfSSL.I-CUBE-wolfMQTT_conf.h file and recompiling

@Vishal-Birajdar
Copy link
Author

after adding #define HAVE_SOCKET showing error in mqttsimple.c -> #include <netinet/in.h> no such file error
compilation terminated.
make: *** [Core/Src/subdir.mk:37: Core/Src/mqttsimple.o] Error 1
make: *** Waiting for unfinished jobs....
../Core/mqttsimple/mqttsimple.c:38:10: fatal error: netinet/in.h: No such file or directory
38 | #include <netinet/in.h>
| ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Core/mqttsimple/subdir.mk:19: Core/mqttsimple/mqttsimple.o] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

23:42:11 Build Failed. 5 errors, 0 warnings. (took 1s.693ms)

@lealem47
Copy link
Contributor

lealem47 commented Jan 3, 2024

That header should not be included if using lwip (The desired functionality is already provided in lwip/netdb.h). I will make that modification to the example but for your case you can just comment it out.

@Vishal-Birajdar
Copy link
Author

showing error when i comment out it.
Screenshot from 2024-01-04 00-18-15

@Vishal-Birajdar
Copy link
Author

this is my mqtt configuration
Screenshot from 2024-01-04 00-36-49
Screenshot from 2024-01-04 00-37-13

@lealem47
Copy link
Contributor

lealem47 commented Jan 3, 2024

I'm able to successfully able to compile your exact scenario after commenting out that header. Can you share your generated wolfSSL.I-CUBE-wolfMQTT_conf.h file?

@Vishal-Birajdar
Copy link
Author

/home/pvipl/STM32CubeIDE/MQTT_E/wolfMQTT/wolfSSL.I-CUBE-wolfMQTT_conf.h

wolfSSL.I-CUBE-wolfMQTT_conf.txt

@lealem47
Copy link
Contributor

Could you try adding #include "examples/mqttport.h" to the top of the mqttsimple.c file?

@lealem47
Copy link
Contributor

lealem47 commented Jan 15, 2024

Could you also try manually adding #define WOLFSSL_LWIP to the wolfSSL.I-CUBE-wolfMQTT_conf.h file?

@Vishal-Birajdar
Copy link
Author

showing error .
Can I copy mqttsimple.c function in main.c. as it to implement mqtt .
like read,write,connect function as it is in my main.c file.

@lealem47
Copy link
Contributor

We are not making progress this way. I see that you have opened a support ticket regarding this issue. I will reach out to you there and we can schedule a call to debug and get this working for you.

@lealem47
Copy link
Contributor

Resolved offline. The issue was fixed by enabling LWIP_DNS (DNS Module) in the LWIP general settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants