Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1427 Posts: 7608
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 81 Posts: 350
Good evening Franjo,
all changes you recommended were already correct within the project.
So i uncommented the try_nls.h header file --> then it looks again like the one you have sent.
Furhtermore the Main.c file is looking like you said in your previous post.
I tried now to use the hivemq broker (see snapshot attached) instead of a raspberry pi.
Furthermore, I tried it now within a different wifi network.
For that I changed the required data within the try_nls.c (application template).
I hope i did the changes regarding the snapshot within the application template correct.
Even so, there should be data at the console.But there isnt.
The workbench version I'm using is:
Version : 3.1.0 Build date : 2017-10-25T00:27:56Z Git Commit : before_generator_refactoring-181-g8789764
The only issue i could still imagine is within the makefile and the allocation of the h and c files. Now all c files expected the one within the XDK folder are located within the paho folder.
Additionally there is a header file within the paho/XDK folder and is named: mqttXDK.h.
So I changed this section of the makefile like the following:
for the header files:
export BCDS_XDK_INCLUDES = \ -I$(BCDS_APP_SOURCE_DIR)/paho \ $(BCDS_APP_SOURCE_DIR)/paho/XDK/mqttXDK.h
for the c files:
#List all the application source file under variable BCDS_XDK_APP_SOURCE_FILES in a similar pattern as below
export BCDS_XDK_APP_SOURCE_FILES = \ $(BCDS_APP_SOURCE_DIR)/Main.c \ $(BCDS_APP_SOURCE_DIR)/paho/try_nls.c \ $(BCDS_APP_SOURCE_DIR)/paho/XDK/mqttXDK.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTClient.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTConnectClient.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTConnectServer.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTDeserializePublish.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTFormat.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTPacket.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTSerializePublish.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTSubscribeClient.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTSubscribeServer.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTUnsubscribeClient.c \ $(BCDS_APP_SOURCE_DIR)/paho/MQTTUnsubscribeServer.c
But still nothing appearing at the console --> so the makefile seemed to be correct.
Ive sent you the project via Mail (incuding my last adpation of the make file).
Thanks a lot !
Iam curious what the issue in fact will be.
Hope i was not forgetting something obvious....
Hello Nils, I have replied to the e-mail you have sent me. Kind regards, Franjo
thanks a lot for your commitment !
The code is working like a charm now !
I have a more general question.
I think it should be possible to use other communication protocols than MQTT e.g.: AMQP or OPC-UA ?
What do I would need to consider e.g. to convert the MQTT project to a AMQP project ?
Thanks a lot have a nice weekend !
Hello Nils, it is quite difficult to turn your MQTT project into an AMQP project, since there is no AMQP library on the XDK, and no AMQP demo for the XDK either. The MQTT Paho demo, which you currently use, basically works because the files inside the Paho folder can easily be adapted to any embedded device with a WiFi chip. The MQTT implementation comes from Paho, a third party company, which only needs two files that tell the MQTT implementation how to count time on the device, and how to send and receive messages via TCP. The adaption is done via mqttXDK.c and mqttXDK.h, if you want to check it out. This basically defines functions, which are used inside Paho's MQTT implementation. Additionally, the XDK offers another library in Workbench version 3.1, that also allows implementing an MQTT client. I do not know if there are easily adaptable AMQP implementations available by a third party, such as is the case for MQTT. If you wanted to use AMQP, you'd either have to find such an implementation which you would have to adapt to the XDK, or implement the specification yourself, i.e. sending / receiving packets via TCP for subscribing, publishing, connecting, etc. This would take a lot of time. The same goes for OPC-UA. Overall, I recommend to use libraries that are natively available on the XDK via the SDK. Please tell me if this was helpful, and do not hesitate to ask further questions. Kind regards, Franjo