openwrt makefile for eclipse paho

716 views
Skip to first unread message

prem singhania

unread,
Sep 17, 2015, 8:18:29 AM9/17/15
to MQTT
Hello,
      I am trying to use eclipse paho's C client library on a openwrt system with a locally installed apollo broker. In order to run the c program in the openwrt environment, I need to first make its make file. Now I have searched a lot in internet but I did not find anything that could work on an openwrt system. So if anyone could help me with the makefile that is suitable for openwrt system, I will be highly thankful.

P.S: By suitable makefile I mean a makefile that contains the link to download eclipse paho library.

Frank Pagliughi

unread,
Sep 17, 2015, 10:32:03 AM9/17/15
to mq...@googlegroups.com
Do you have an example of another project that works the way you want?

- Frank
--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

Karl Palsson

unread,
Sep 17, 2015, 11:59:19 AM9/17/15
to mq...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> On 09/17/2015 08:18 AM, prem singhania wrote:
> > Hello,
> > I am trying to use eclipse paho's C client library on a openwrt
> > system with a locally installed apollo broker. In order to run the c
> > program in the openwrt environment, I need to first make its make
> > file. Now I have searched a lot in internet but I did not find
> > anything that could work on an openwrt system. So if anyone could help
> > me with the makefile that is suitable for openwrt system, I will be
> > highly thankful.

Is there anything particularly wrong with libmosquitto? I've been
maintaining mosquitto packages for openwrt for a couple of years now,
and expect to continue doing so. If you particularly _must_ use paho
instead, then the mosquitto package makefiles should be a more than
sufficient example.

https://github.com/openwrt/packages/tree/master/net/mosquitto

> >
> > P.S: By suitable makefile I mean a makefile that contains the link to
> > download eclipse paho library.

You mean an openwrt package makefile, not a project makefile, but that's
ok.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJV+uMJAAoJEBmotQ/U1cr2LsMP+gOEffl6mfGzw5QQTxoFpllS
EsF937ZsW7ea1dO2gZ0+1OjpNYTYj4D0pZa1utBWTRPZcXFButNfJk57mc0mGX2+
9Ii8+3v7J1jedMA1OyHY6x54B7htPiYgeC36D5tNrjqebziQg3gbmlNUx2cGLkm9
kkn1pnV5qnHbcDJCoJh4vXOQlkg6iSRUWtBPQgnCvqJMnAuIRFY2jE55Gtmmi8NZ
jyNTgKG9UGo2VmaQEsAoFfH7oL1BB+fD4MlgHzduJz49RuqkQ1WL50gG6NEY2aJ3
rPZMfWyULTSQust4Bj9IsYzPJtKxTI9UTaMQhpGCmbxqy29sKPoQCO5+pSTqW3eM
HhXNL76TmjJkqKH6xE65xnmrEunH5wU4DLRP9oFbCYIRlxP0U4gGeZuEpD3hj73N
T7434sGHTmd26vhWQ54qpuzsXhkSHX498XLRIs9v8W/AoiGwUuQUkxWnqxXfR7fc
aG2zSU/shpfba8S/1r/BdQ9fJkxpXId8UYEnLcTk6EHhOzAWvKtVF0/Dslt6JCxK
VDQwt9UM0mHlnzqWGRYdKyr6LXmWAvsYqiOkuhpjTZIkmU2ick+nScGnz4BVQN1A
fr5g2w9YeGoHo/pe7R9nJIoNCY8WIsRpPkzJVdicoOJTcSr5hfE6apqBcS6ubtnd
b+qrEM1/Jf95J3craGrU
=6Uum
-----END PGP SIGNATURE-----

prem singhania

unread,
Sep 18, 2015, 1:16:54 AM9/18/15
to MQTT
Thanks for the reply.
        Yes there is, I used libmosquitto library and it worked, but there were some errors which I could not understand and hence was planning to test out eclipse paho for once. You can download libmosquitto's makefile may be then you will get a better picture of what I am asking.

prem singhania

unread,
Sep 18, 2015, 1:30:29 AM9/18/15
to MQTT
Thanks for the reply,actually @karl palsson, I have spent some time trying to study mosquitto library, I wrote a small independent program that just publishes messages to an apollo broker. Now here is the thing, this small program when i run in the openwrt environment, it works smoothly without any error. My team is working on another project and my work is to include mqtt support in it. This program i included in that project and there is when errors started popping out. The messages are not publishing and the broker throws different errors at different time, I have no idea where the error is, with my C code, broker or the library itself and that is why I was trying to test it out using other libraries. For your reference im attaching my C code. See if you can find any error in it.

P.S : As i said earlier, the code that i am attaching works, if you run it independently on any openwrt system(the openwrt system I am talking about is a cloudgate to be precise).
test_mqtt.c

Karl Palsson

unread,
Sep 18, 2015, 8:39:05 AM9/18/15
to mq...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you would like help, please try describing exactly what errors you
get, in which cases. If I understand correctly,
the program attached works, but some other program you have doesn't. You need to explain _what_ doesn't work if anyone is to have any chance of helping you. Switching to paho is unlikely to help you in any meaningful way, and you would still need to be able to describe your problems.

A common trap is that you have the same clientid in multiple
applications.

Sincerely,
Karl Palsson
- --
Sent using Mailpile, Free Software from www.mailpile.is

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJV/AWSAAoJEBmotQ/U1cr2VcsP/iJkzI4xyrTHgZAfWPG8RsuX
2LO+exig4gz+UAC8KbY1oXSKKRgzjcAPmnCbKWJy+Whi1qek5rmQv5NnJRgZb7PJ
7wfG06XXkoh9Xu90IFTAJEBfocDEFaWG0mb//otikf6F4u5tYDkfJWZzP9tdfnY2
7LFLCVqq5ninY3CiFGTu8xHqpZpiv09tkywueqsWlebnwxvLHHJccUc/juOazSmW
sgE1wWx913MYi7mfFMgNrNlQP7HEzUaFWaLh0l4Vt9oxW0I2T7D5+ak4snCpAKLp
anNsJ4xfO9GerLQ3P8EinbLRVmNND64q4Ol3Er79rKxSzWAl2Rh06VaT46Teh5M5
biq82O88UZCmoGD3J9JXtKtWCHgPxplK4dx+LtTTDkZIYZNCCCMHL5MwAdHcuPaj
PXTisbafdifWZpMLgZUS2W2neZfrDKdEzNLYbCPEpqKcQ+9GuB0RLxx32Ousu58p
hH2n53TzbKnuh7+cRx1h9pYgG06owMEdU9UkPuUJsLQE3bA8O2UHV2K4cIuezKtN
CPn8wxGhuROVAiggkSZNHEZY0MKDRmcg9vrUpifh0tiqcGtwIc1Y1Cx7t8U94Fwb
PgHtR5anVzCkb/kBFkh/LqpP5j3F3P9OUTWKc3AWGSL5EaMnIgQa3aWrCoUjbqKM
lz0YIdgGct/auTllhLka
=8ip5
-----END PGP SIGNATURE-----

prem singhania

unread,
Sep 21, 2015, 2:46:54 AM9/21/15
to MQTT

I am using an apollo broker and these are the two major errors that I get when I try running the already attached program with my project's source code.
 error: Internal Server Error: java.lang.ArrayIndexOutOfBoundsException: 3 and
 error: Invalid MQTT message type: 15
            both these errors come for the same program, and sometimes no error is displayed and the message isn't published either and there is this other thing, I somehow sometimes(out of pure luck) get this program running by making some changes, but once it has started running, the program kind of becomes hard coded meaning if again I make any kind of changes on that program(say I added a new line in the program to print logs in my log file). The program will stop working again.
       I hope I made the problems clear this time, if its still not clear, please do tell ill try my best again.

Regards
Prem Singhania
Reply all
Reply to author
Forward
0 new messages