mosquitto

微信小程序 阿里云服务器 非物联网平台自建MQTT代理服务器控制树莓派LED

本秂侑毒 提交于 2020-08-11 11:28:42
微信小程序 阿里云服务器 非物联网平台自建MQTT代理服务器控制树莓派LED 本人大三,临近毕业季,日后希望从事物联网和嵌入式相关工作,所以自己构想了一个项目来练手,之前做大创的时候学了一点微信小程序,大二的时候玩过一段时间的树莓派,寒假的时候买没顶住阿里云服务器的学生优惠买了一年的阿里云的服务器。之前的大创也是一个物联网的相关项目,当时使用的是中国移动的OneNet的物联网平台。 所以我灵机一动,就想到了自己搭建MQTT的代理通过微信小程序来控制树莓派的IO口的项目( •̀ ω •́ )✧ 前排提示:我也是个萌新,可能走了很多弯路,如果有迷惑操作欢迎指正相互学习哦(~ ̄▽ ̄)~ 前期准备 1.硬件准备 首先说一下完成这个项目我们所需要的硬件 1. 手机一台(IOS/Android皆可) 2. 树莓派(我用的4B 4G版,理论上其他型号也无所谓) 3. LED灯、杜邦线若干 我的成品如图 2.软件准备 下载微信开发者工具 直接下载对应版本 微信开发者工具 给树莓派安装系统 树莓派官网系统 我使用的是树莓派官方系统(之前用Ubuntu20.04 64位碰了很多壁⊙﹏⊙∥),这个地方萌新推荐安装 Raspberry Pi OS (32-bit) with desktop and recommended software 这个带推荐软件的版本,虽然大但啥都装好了对萌新友好

iTOP-4412开发板-mqtt移植教程(一)

a 夏天 提交于 2020-07-24 16:13:35
移植环境 Ubuntu :迅为提供的 ubuntu16.04 编译器:arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 MOTT 介绍 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基 于发布/订阅(publish/subscribe)模式的轻量级协议,该协议构建于 TCP/IP 协议之上, MQTT 最大优点在于,可以以极少的代码和有限的带宽,为连接远程设备提供实时可靠的消 息服务。作为一种低开销、低带宽占用的即时通讯协议,使其在 物联网 、小型设备、移动应用 等方面有较广泛的应用。 我们这里使用的是 Mosquitto,Mosquitto 是 MQTT 的实现方法,因为 MQTT 是一种 协议,就好比 Linux 和 Ubuntu 的关系。Ubuntu 是 Linux 的发行版之一,而 Mosquitto 是 MQTT 的实现方法之一,为什么我们的这里使用的是 Mosquitto 而不是其他的实现方法呢, 因为 Mosquitto 功能强大,不仅可以作为消息的发布者和订阅者,也可以做为服务器。其他 工具有的功能他基本都有,所以我们使用的是 Mosquitto。 一.在 X86 上安装 mosquitto 使用 apt-get 安装

Usage of MQTT protocol in React

空扰寡人 提交于 2020-07-19 04:40:49
问题 I'm kinda new to react and trying to understand how to make MQTT work with it. i've tried to follow the code sample published here: https://www.npmjs.com/package/mqtt-react but had no success. for some reason it's just don't do anything. here's my code: App.js class: import React, { Component } from 'react'; import './App.css'; import PostMqtt from './PostMessage.js'; import {Connector} from "mqtt-react"; class App extends Component { render() { return ( <div className="App"> <PostMqtt/> <

Usage of MQTT protocol in React

假装没事ソ 提交于 2020-07-19 04:38:01
问题 I'm kinda new to react and trying to understand how to make MQTT work with it. i've tried to follow the code sample published here: https://www.npmjs.com/package/mqtt-react but had no success. for some reason it's just don't do anything. here's my code: App.js class: import React, { Component } from 'react'; import './App.css'; import PostMqtt from './PostMessage.js'; import {Connector} from "mqtt-react"; class App extends Component { render() { return ( <div className="App"> <PostMqtt/> <

Paho MQTT not connecting Android studio to the Mosquitto broker

吃可爱长大的小学妹 提交于 2020-06-23 13:20:12
问题 I hosted Mosquitto MQTT broker on Digital Ocean Cloud. Now, I am trying to connect it to the android studio. But it is not connecting to the MQTT broker. I have printed the throwable exception details so the error could be debugged.Please guide me on how this error could be solved. I tried with the following code. public class MainActivity extends AppCompatActivity { public MqttAndroidClient CLIENT; public MqttConnectOptions MQTT_CONNECTION_OPTIONS; @Override protected void onCreate(Bundle

Paho MQTT not connecting Android studio to the Mosquitto broker

99封情书 提交于 2020-06-23 13:20:11
问题 I hosted Mosquitto MQTT broker on Digital Ocean Cloud. Now, I am trying to connect it to the android studio. But it is not connecting to the MQTT broker. I have printed the throwable exception details so the error could be debugged.Please guide me on how this error could be solved. I tried with the following code. public class MainActivity extends AppCompatActivity { public MqttAndroidClient CLIENT; public MqttConnectOptions MQTT_CONNECTION_OPTIONS; @Override protected void onCreate(Bundle

Paho MQTT not connecting Android studio to the Mosquitto broker

前提是你 提交于 2020-06-23 13:18:58
问题 I hosted Mosquitto MQTT broker on Digital Ocean Cloud. Now, I am trying to connect it to the android studio. But it is not connecting to the MQTT broker. I have printed the throwable exception details so the error could be debugged.Please guide me on how this error could be solved. I tried with the following code. public class MainActivity extends AppCompatActivity { public MqttAndroidClient CLIENT; public MqttConnectOptions MQTT_CONNECTION_OPTIONS; @Override protected void onCreate(Bundle

Mosquitto vs eclipse paho client library

霸气de小男生 提交于 2020-06-14 04:07:08
问题 I'm just looking into the details of Eclipse PAHO and Mosquitto client libraries (MQTT C++ libraries). It looks like the PAHO uses the mosquitto MQTT broker but provides its own MQTT client libraries. Also the Mosquitto library provides a way to implement client libraries for Mosquitto MQTT broker. I would like to understand what's the main difference between these two client libraries. Here it is discussed but that does not answer my question. Which is preferred over another and why? and why

Mosquitto vs eclipse paho client library

坚强是说给别人听的谎言 提交于 2020-06-14 04:06:57
问题 I'm just looking into the details of Eclipse PAHO and Mosquitto client libraries (MQTT C++ libraries). It looks like the PAHO uses the mosquitto MQTT broker but provides its own MQTT client libraries. Also the Mosquitto library provides a way to implement client libraries for Mosquitto MQTT broker. I would like to understand what's the main difference between these two client libraries. Here it is discussed but that does not answer my question. Which is preferred over another and why? and why

Ubuntu 16.04安装测试MQTT Mosquitto

主宰稳场 提交于 2020-05-01 02:48:43
环境:Ubuntu 16.04 介绍MQTT MQTT 是一种机器到机器的消息传递协议,旨在为“物联网”设备提供轻量级的发布/订阅通信。它通常用于地理跟踪车队,家庭自动化,环境传感器网络和公用事业规模数据收集。 Mosquitto 是一种流行的MQTT服务器(或MQTT中的 代理 ),具有出色的社区支持,易于安装和配置的特点。 在本教程中,我们将安装Mosquitto并设置我们的代理以使用SSL来保护受密码保护的MQTT通信。 MQTT 是一个轻量级即时通信协议,使用基于 TCP/IP 协议的发布/订阅消息转发模式, MQTT 协议的中心是 broker( 服务器/代理),客户端通过订阅消息和发布消息进行数据交互。 若初次接触MQTT协议,可先理解以下概念: 【MQTT协议特点】——相比于RESTful架构的物联网系统,MQTT协议借助消息推送功能,可以更好地实现远程控制。 【MQTT协议角色】——在RESTful架构的物联网系统,包含两个角色客户端和服务器端,而在MQTT协议中包括发布者,代理器(服务器)和订阅者。 【MQTT协议消息】——MQTT中的消息可理解为发布者和订阅者交换的内容(负载),这些消息包含具体的内容,可以被订阅者使用。 【MQTT协议主题】——MQTT中的主题可理解为相同类型或相似类型的消息集合。 Mosquitto是一款实现了 MQTT v3.1