Sending file over mqtt using mqttClient-for-Legato

hi i am using mqttClient-for-Legato.
I am able to publish data.
But i am not able to send file using “mqtt pubfile topic filename”
It says cannot open file and I have already given all the permissions.

Any help would be appreciated

Zehra

1 Like

From the code, it is simply using mqttClient_PublishFileContent() and readFile() in mqttClientApi.c to read the file you specified.
Suggest you debugging by trying to open it by copying those code to another hello world project.

hi any documents related to mqtt commands are available like mqtt_CreateSession, mqtt_SetConnectOptions

you can read the comment above the API:

sir i am using this mqtt to connect throgh command line
GitHub - nhonchu/mqttClient-for-Legato: mqttClient application for Legato framework
but it is getting error that some file is missing

$ mkapp -t wp76xx mqttClient.adef
** ERROR:
/home/nayan/myworkspace/mangOH/apps/mqttClient-for-Legato/mqttClientApi/mqttClientApiComponent/Component.cdef:120:8: error: * Couldn’t find file ‘le_info.api.’

you can see here:

you need to add the -i path:

sir but this le_info.api. file is missing

i can see it is in here:

TARGETS := $(MAKECMDGOALS)

CURDIR = $(shell pwd)

.PHONY: all $(TARGETS)
all: $(TARGETS)

$(TARGETS):
@echo ${MQTT_API_ROOT}
mkapp -v -t $@
-i $(LEGATO_ROOT)/interfaces/modemServices
-i $(CURDIR)/mqttClientApiComponent/paho
-i $(CURDIR)/mqttClientApiComponent/mqttAirVantage
-i $(CURDIR)/mqttClientApiComponent/mqttGeneric
-i $(CURDIR)/mqttClientApiComponent/tlsInterface
-i $(CURDIR)/mqttClientApiComponent/mbedtls/include
-i ${LEGATO_ROOT}/interfaces/modemServices
mqttClient.adef

clean:
rm -rf build* *.update

i have modified like this but still same error

maybe you first compile this application which will use le_info.api:

i am working in leaf ,know only i dowloaded the legato-af ,directly i tried ur infotest but it is showing same error

(lsh:wp76stable) nayan@nayan:~/myworkspace/legato-af/apps/infoTest$ mkapp -t wp76xx infoTest.adef
** ERROR:
/home/nayan/myworkspace/legato-af/apps/infoTest/infoTest/Component.cdef:10:8: error: * Couldn’t find file ‘le_info.api.’

You need to use the makefile inside

sir i copied the file directly to the mqtt folder it copiled and build the app
will it be okay!

Do you mean you can compile now?

yes i compiled and got .update file
but i don’t know will it work

sir when i update the file to board it is atomatically restart again and again and app is not staying why i don’t know sir do you have any reason

I don’t know, you need to comment out those code and add it line by line to see which line makes the reset

sir i want to connect to thingsboard application through mqtt connection , i am using leaf workspace to build apps ,and i am using ‘mangOH-yellow-wp76xx_0.7.0’ version set up please tell me which app i can modify and build to use

Thanks in advance

do these work?

no sir these are not able to build in leaf environment,and another one is related to datahub