Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] RaspberryPi and mqtt

Hi Vasudha,

I've just tried this on my Raspberry Pi 2 running Raspbian and it worked connecting to iot.eclipse.org, using this command:

LD_LIBRARY_PATH=. ./a.out x --host iot.eclipse.org

One thing that comes to mind is that depending on the combination of OS and hardware you might need the -DREVERSED compile flag to switch bitfield ordering when the library is compiled, although I'm not sure those are the symptoms I would expect.

You can get protocol information trace out by setting the environment variables:

MQTT_C_CLIENT_TRACE=ON
MQTT_C_CLIENT_TRACE_LEVEL=PROTOTOL

which for me shows:

=========================================================
                   Trace Output
Product name: Paho Synchronous MQTT C Client Library
Version: 1.0.3
Build level: Sun Apr 24 20:36:14 UTC 2016
/proc/version: Linux version 3.18.7-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015

=========================================================
Connecting
20160424 205451.721 3 publisher -> CONNECT cleansession: 1 (0)
20160424 205451.860 3 publisher <- CONNACK rc: 0
Connected



Ian

On 04/23/2016 06:16 AM, Vasudha Madugula (vamadugu) wrote:

Hi Ian,

 

We are using /test/abcd as the publish topic. It won’t be taking --host as the topic name. Has connecting to a public broker on for anyone on a raspberry pi?

 

Regards,
Vasudha

 

From: paho-dev-bounces@xxxxxxxxxxx [mailto:paho-dev-bounces@xxxxxxxxxxx] On Behalf Of Ian Craggs
Sent: Friday, April 22, 2016 4:19 PM
To: paho-dev@xxxxxxxxxxx
Subject: Re: [paho-dev] RaspberryPi and mqtt

 

Hi,

that's because the first parameter of pahopub is the topic to publish on, and it's mandatory as it stands, so it's taking "--host" as the topic name.  I'll look into fixing that parsing.  If you use:

./a.out /test/abcd <publish_topic> --host iot.eclipse.org --port 1883

it should work, it does for me.

Ian

On 04/22/2016 07:40 AM, Vasudha Madugula (vamadugu) wrote:

Hi,

 

I am trying to connect to an online broker using the mqtt c client library from my raspberry pi. I compile (gcc pahopub.c -lpaho-mqtt3c) and then run it (./a.out /test/abcd --host iot.eclipse.org --port 1883). It refuses to connect, with a return code of 1 (0x01 Connection Refused, unacceptable protocol version). I have tried the same with other online brokers as well.

What is to be done when “the server does not support the level of the mqtt protocol requested by the client”?

 

Regards,

Vasudha




_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto
 


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


Back to the top