"Remote control Mqtt && Protobuffer" for Android development notes

Source: Internet
Author: User

MQTT Official website: http://mqtt.org/
MQTT protocol Précis-writers: http://www.cnblogs.com/caca/p/mqtt.html

MQTT is an Instant Messaging protocol developed by IBM. MQTT is a connectivity protocol for both the machine and the internet of Things, with lightweight publishing and subscription messaging. The Mosquitto is an MQTT v3 implementation. The 1 Protocol's Open source message agent software provides lightweight, support for publish/ Subscribe message push mode, making device-to-device short message communication easy to use. In the first contact with the MQTT protocol, the following concepts are understood: "MQTT protocol Features"--the MQTT protocol provides better remote control than the restful architecture of the IoT system, with messaging push capabilities. The MQTT protocol role-The IoT system in the RESTful architecture, contains two role clients and server-side, while the MQTT protocol includes publishers, agents (servers), and Subscribers. The messages in the MQTT protocol message--MQTT can be understood as the content (payload) exchanged by the Publisher and Subscribers, which contain specific content that can be used by subscribers. The topic in the MQTT protocol topic--mqtt can be understood as a message collection of the same type or similar type listens for the port by default:1883: Mqtt, unencrypted 8883: mqtt, encryption  8884: MQTT, encryption, customer service requires authentication 8080: Mqtt through WebSockets, unencrypted

Mosquitto ubuntu under compilation and Installation

Mosquitto installation, configuration, testing (* * including stress test method * *): http://blog.csdn.net/skykingf/article/details/46459857

First to the official website http://mosquitto.org/download/Let's download the latest package: http://mosquitto.org/files/source/mosquitto-1.4.8.tar.gzSwitch to ~, execute wget http://mosquitto.org/files/source/mosquitto-1.4.8.tar.gzThen chmod777mosquitto-1.4.8. tar.gz then tar-ZXF mosquitto-1.4.8. TAR.GZCD Mosquitto-1.4.8then execute make may not find the UUID header file, sudo apt-GetInstall uuid-Dev then perform makesudo make install after installation in~directory Input: MoS then tab Press 2 to appear: Mosquitto mosquitto_passwd mosquitto_pub mosquitto_sub Note: May not be found when performing mosquit So:sudo CP/usr/local/lib/libmosquitto.so.1


To open MQTT:

$ Mosquitto Start

To stop MQTT:

$ Mosquitto Stop

To view the MQTT status:

$ Mosquitto Status

To view the monitored ports:

$ NETSTAT-ANPLT | grep 1883

Under Test,

$ mosquitto_sub-h test.mosquitto.org-t "#"-V

Mosquitto Test

Test:
One, open the first terminal window, directly run Mosquitto can: second, open another terminal window, run the subscription program mosquitto_sub: NOTE: Message push publish and subscribe to have a theme, options [--t Subject to specify User name add option [-1 ---T topic 1-i Release-' I'm the publisher, Hello. '-T Mqtt's terminal will appear: End of Test.

"Remote control Mqtt && Protobuffer" for Android development notes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.