Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] How to publish and Subscriber MQTT in Wide area network using mosquitto

Hi Peiyuan,
 
What programming language are you trying to use? I'll assume Java for now as I think your previous questions were about that.
 
There is a good article here about the basics of the Java client here: http://www.hivemq.com/blog/mqtt-client-library-encyclopedia-eclipse-paho-java
I've attached a quick and dirty sample I just threw together showing how to subscribe to a topic and print incoming messages to the console which should help as well.
 
If you've got Mosquitto installed on your local machine, you can always use the mosquitto_sub command to test that the route to the broker is working (http://mosquitto.org/man/mosquitto_sub-1.html) e.g. mosquitto_sub -h iot.eclipse.org -t /test
 
Hope that's of some help!
 
Kind regards,
 
James Sutton
Software Engineer - IoT Foundation - MQTT Open Source Projects
Technical Trojan - Wimbledon Project

Phone: 01962 815438 | Extension: x372454
E-mail: james.sutton@xxxxxxxxxx
Personal Website: www.jsutton.co.uk
Find me on:      
IBM

Hursley Park
HursleySO212JN
United Kingdom
 
IBM United Kingdom Limited Registered in England and Wales with number 741598 Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU
 
 
----- Original message -----
From: fang peiyuan <fang_peiyuan@xxxxxxxxx>
Sent by: paho-dev-bounces@xxxxxxxxxxx
To: "paho-dev@xxxxxxxxxxx" <paho-dev@xxxxxxxxxxx>
Cc:
Subject: [paho-dev] How to publish and Subscriber MQTT in Wide area network using mosquitto
Date: Tue, Oct 13, 2015 6:19 AM
 
hi sir/ mdm 
 
my name is peiyuan, currently i need to write a programming using MQTT to publish and subscriber to wide area network using mosquitto .
 
i am able to publish the data to the wide area network but i am unable to subscriber. using my wan addpress to reterieve my meesage through MQTT 
 
is there any tutorial i can follow and learn from it? thank you 
 
from 
peiyuan 
_______________________________________________
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
 

Attachment: MqttSubscribeSample.java
Description: Binary data


Back to the top