MQTT Paho Demo Problems
Answer
11/10/17 11:00 AM

Dear Community,

for a university project i want to send data from the XDK to a broker via the MQTT protocol. Similar to the MQTT Paho Demo Project. For this i received a (modified?) version of the Project which i cant compile due to various errors in the code. I tried three different versions of the Workbench (2.0.1/3.0.1/3.1.0) with no success.

The errors are mainly caused by "symbols" (FAILURE/SUCCESS) that could not be resolved in the MQTTClient.c . Following the guide, I tried to replace all of the files in src/paho with the new ones from the github project with no success as well. (https://github.com/eclipse/paho.mqtt.embedded-c). I also executed the steps from the "Getting Started" guide for the MQTT Paho Demo.

When compiling i get the following 3 errors:
"make: *** mixed implicit and static pattern rules."     application.mk

"mingw32-make: *** [debug] Error 2 "

"recipe for target 'debug' failed"    Makefile 

From warnings i noticed 7 of the Includes greyed-out. Are they missing and might this be the cause of the problem?
-BoschXDKCloudConnectivity/SDK/xdk110/Common/config/HW_XDK_v1
-.../Common/config/MiscDrivers
-.../Libraries/WiFi/TI/simplelink/include
-.../Plattform/Basics/include
-.../Plattform/MiscDrivers/include
-.../Plattform/Peripherals/include
-.../Plattform/Power/include

Could someone supply me with the original MQTT Paho Demo so i can retry it from scratch with the older Workbench version or give me a hint on how to get rid of the errors?

Thank You in advance.

0 (0 Votes)
RE: MQTT Paho Demo Problems
Answer
11/13/17 1:14 PM as a reply to Jannis Richard.

Hello Jannis,

First I'd like to welcome you to the XDK community.

Regarding your modified MQTT paho demo project, the MQTT paho demo is no longer supported, nor available for download in the XDK community, due to incompatibilities with the latest XDK-Workbench 3.1.0.

But I will try to help you as well as I can. Could you go more into detail about where you received the modified MQTT paho demo from, which you mentioned?

Regarding the unsolved variables FAILURE and SUCCESS. The indexing system of the XDK-Workbench finds these variables in other files as well and therefore cannot uniquely identify them.

But this shouldn't influence the build process since the compiler should be able to find the correct variables anyway.

Regarding your second issue mixed implicit and static pattern rules, could you go into more detail about what changes you made within makefiles of the project?

Regarding replacing the MQTT paho files within the MQTT paho demo project, please note that you need a different set of files to be compatible with the implementation, which enables the connection to the CC3100 Wi-Fi chip of the XDK. For more information, please refer to this thread here.

As for your last error, this seems to be caused by a bad import of the project, since you are using the MQTT paho demo project and not the BoschXDKCloudConnectivity example.

Did you follow the import instructions from the workbench installation guide?

Kind regards,
Franjo

0 (0 Votes)
RE: MQTT Paho Demo Problems
Answer
11/13/17 8:54 AM as a reply to Franjo Stjepandic.

Hi Franjo,

first of all thank you for your fast aswer!

I got this project from my professor but since I can't compare the modified version to the original one, I sadly can not go into any detail, what kind of modifications were made.  This goes for the changes in the makefile as well.

I'm happy the unsolved variables should not be a problem.

Do you mean the files I got from the linked github project are not the right ones? If this is the case, could you please provide me with the right ones, because the link posted various times in the community and also in the Guides is unfortunately not containing any files anymore.

What do you mean by bad import? I'm pretty sure I followed every guide regarding my issue but I might missed some instructions. Do you think the BoschXDKCloudConnectivity project would be better for my needs? (I would like to send measured data from the XDK into the IBM Bluemix Cloud)

Still I would like to kindly ask if you could maybe provide me with the unmodified MQTT Demo Project so I can possible resolve the issue myself.

 

Thank You in advance!

0 (0 Votes)
RE: MQTT Paho Demo Problems
Answer
11/13/17 5:06 PM as a reply to Jannis Richard.

Hello Jannis,

Thank you for providing additional information. You can find the information about where to download the MQTT paho files, which are compatible with the MQTT XDK implementation of the MQTT paho demo project, in this thread here. I explained in the third post where to find the correct files in the corresponding GitHub repository.

Regarding the bad import, I concluded your MQTT paho demo project has a wrong build directory since you told me that you received warnings, which are pointing to the BoschXDKCloudConnectivity example. But since these are only warnings, they should not be a problem. In this case, they are actually pointing to missing includes, which are either outdated or not relevant.

Furthermore, I would like to provide a working non-modified MQTT paho demo. But as I mentioned earlier the demo is no longer supported and available for download. In fact, I have no access to a version, which is updated to the latest XDK-Workbench 3.1.0.

But maybe you could use the demo project from Felipe Neves here. He used the MQTT paho demo as starting point to build up his application onto it. I guess with some modification, it could suit your use case as well.

Please let me know if that was helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

+1 (1 Vote)
RE: MQTT Paho Demo Problems
Answer
11/21/17 2:24 PM as a reply to Franjo Stjepandic.

Hi Franjo,

first of all, I would like to apologize for the long time not answering your post. I'm still very thankfull that you are helping me in dealing with my problem.

Especially the demo project (by Felipe Neves) you provided really helped me out. I was able to build the project and flash it onto the XDK. I modified the project so the device would be able to access my home wifi and it worked, at least partially. The problem is, after successfully completing the initialization, and connecting to the wifi, the connection always gets interrupted by the XDK. I can modify the duration until the timeout by changing the variable "WDG_TIMEOUT" in the mqttConfig.h but I would really like to have the device stay connected to the network the whole time. Do you have any suggestions on how I could possibly solve this problem?

Another member of my team, who is working with the IBM Bluemix Cloud is able to see very small peaks of data traffic when the XDK is running but we are not able to identify the nature or content of this data. I printed out the return code of the function "MQTTConnect" and got "5". As far as I was able to find out, that means the connection was refused by the broker. Do you have any idea what could be the cause of this problem?

Furthermore, after initialization I tried to print out the pressed button in the callback function but I saw no action so I think the callback function is never called. Unfortunately, I can not find the Buttons Guide anymore, is it deactivated?

 

Once again your help is really appreciated, thank you in advance!

0 (0 Votes)
RE: MQTT Paho Demo Problems
Answer
11/21/17 5:32 PM as a reply to Jannis Richard.

Hello Jannis,

That is no problem, I am glad to help.

I assume your issue could have multiple causes of failure. We should clarify some things first. As far as I know, the implementation of Felipe Neves is currently working on the XDK-Workbench 2.0.1 only. Thus, I assume you are using the project on the XDK-Workbench 2.0.1?

If that is the case, then I assume the XDK is getting stuck and that is the reason why the watchdog is triggered and the XDK restarts. This could point to a non established MQTT connection to the IBM Bluemix MQTT broker. The connection refusal of the MQTT broker can have multiple reasons too, unfortunately. Here you should analyze if any additional information is required to establish a connection to it.

Regarding the Wi-Fi implementation, the demo does not implement a reconnect routine, which reconnects to the local Wi-Fi after a connection loss. That you would need to implement manually. That implementation could be done within the period task, which sends data to the MQTT broker as follows:

if(CONNECTED_AND_IPV4_ACQUIRED != WlanConnect_GetCurrentNwStatus()){
WlanConnect_WPA(connectSSID, connectPassPhrase, NULL);
}


Regarding the buttons: I would ask you to go more into detail about how you implemented this functionality. It would like to indicate if the XDK gets stuck and thus the printf() will not be executed.

About the button guide, could you be more specific what kind of document or link you mean? As far as I know, there is currently no button guide available in the guide section of the XDK community.

Please let me know if that was helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)