# JS+微信小程序mqtt示例 **Repository Path**: cutee/js_wechat-mini-program-mqtt-demo ## Basic Information - **Project Name**: JS+微信小程序mqtt示例 - **Description**: emqx中的微信小程序和js接入mqtt的示例 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-01 - **Last Updated**: 2024-04-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: 微信小程序 ## README ## a、说明 - 这是从github上导入的mqtt的示例仓库,原仓库地址:https://github.com/iAoe444/WeChatMiniEsp8266 ## b、参考资料 - **使用微信小程序接入mqtt:** https://www.emqx.io/docs/zh/latest/connect-emqx/wechat-miniprogram.html - **使用 JavaScript SDK 连接mqtt:** https://www.emqx.io/docs/zh/latest/connect-emqx/javascript.html - **mqtt js CDN:** https://unpkg.com/mqtt/dist/mqtt.min.js - **支持 TLS/SSL 的免费公共 MQTT 消息服务器:** https://www.emqx.com/zh/mqtt/public-mqtt5-broker - **mqttx客户端工具:** https://mqttx.app/zh - **mqtt教程:** https://www.emqx.com/zh/mqtt-guide ## c、免费的mqtt服务器 - **EMQX Cloud Serverless:** https://www.emqx.com/zh/cloud - **微信小程序中使用 MQTT.js 连接到 EMQX Cloud 部署:** https://docs.emqx.com/zh/cloud/latest/connect_to_deployments/wechat_miniprogram.html ------------------ #### 以下为原仓库原文 ------------------

Banner

## 一、前言 - 这是一个开源的可连接**非微信服务器**的```mqtt.js```的代码工程,本工程的配置文件如下图所示```index.js```,在里面修改为您的搭建好的MQTT服务器以及想要订阅的主题,想要连接更多关于微信小程序控制智能硬件(包括```esp8266、esp32```),包括,请移步:https://blog.csdn.net/xh870189248/article/details/84070944 ## 二、版本迭代 |版本|更新说明|更新时间| | :---- | :---- | :----- | |1|首次提交|2018-11-18| |2| phao mqtt底层库移除,更换为 mqtt.js!修复稳定性问题!|2019-2-20| ## 三、特别注意 - 还是要特别提醒,默认的是```443```端口!以及连接的链接不能带端口号!连接格式:```wsx:www.domain.com/mqtt```,不用带端口号! - 移植来自 https://github.com/mqttjs/MQTT.js 更多使用技巧访问其使用文档!或者阅读我本仓库提供的代码!共勉! ## 四、加群将免费提供服务器连接测试! - 福利多多,请加QQ群:434878850 --------------------------- ![Alt text](png/screen.png)