2 Star 1 Fork 0

SimonShao/vue-mqtt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

mqtt-realtime-chart-client

This project demonstrates the visualization of high-frequency data streams (50Hz+) with Rickshaw.js chart library!

mqtt-realtime-chart-client is a Vue.js client application, which works in conjunction with mqtt-realtime-chart-server.

Alt Text

Features

Client

  • real-time data visualization with a multi-series line chart
  • dynamic slider which controls the chart render frequency (renders chart after N message(s))
    • this is useful for optimization purposes, especially in high-frequency real-time streams, where you can lower the chart render calls in order to lessen the CPU load.

Server

  • publishes and subscribes to MQTT topic (e.g. voltage)
  • forwards the received messages to the client using websockets

Getting Started

Prerequisites

Before you run the client, be sure you have these downloaded/installed on your machine:

Installing

To get started with this project, follow the 3-step installation, described here.

1. Moquette

The following commands will unpack and run the Moquette broker, which listens on port 1883:

tar zxf distribution-0.10-bundle-tar.tar.gz
cd bin
./moquette.sh	

Windows specific:

cd bin
.\moquette.bat 

2. mqtt-realtime-chart-server

Navigate inside the root folder and run:

npm install
npm start

this will install the dependencies and start the express server locally on port 3000.

If the server-app and Moquette are already running in separate terminals, you can see the data stream inside the terminal. You can also check out the stream with a 3rd party MQTT client (e.g. MQTTfx) by connecting to 0.0.0.0:1883 and subscribing to topic voltage.

3. mqtt-realtime-chart-client *(this repo)*

Before running the client, be sure you have already completed steps 1 and 2, and have both Moquette and mqtt-realtime-chart-server running in separate terminal windows.

Open a new terminal window and navigate inside the root folder of the client application, then run:

npm install
npm start

After compilation, you will see the link in the terminal (e.g. http://localhost:8081) where the application is currently running. Use your browser to navigate to that link.

If everything went smoothly, you should see a real-time chart with data frequency of around 50Hz.

Built With

Client

  • Vue.js - JavaScript framework for building UI on the web.
  • Rickshaw.js - JavaScript toolkit for creating interactive real-time graphs
  • Socket.io-client - real-time bidirectional event-based communication using websockets (client)
  • Bootstrap - HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Server

  • Express.js - minimalist web framework for node.
  • Socket.io - real-time bidirectional event-based communication using websockets
  • MQTT.js - MQTT client for Node.js and the browser

Authors

License

This project is licensed under the MIT License.

Acknowledgments

  • God bless the creators and contributors of Moquette for their 1 minute set up!
MIT License Copyright (c) 2018 Nick Jokic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/simon9124/vue-mqtt.git
git@gitee.com:simon9124/vue-mqtt.git
simon9124
vue-mqtt
vue-mqtt
master

搜索帮助