当前位置:网站首页>Several schemes of building hardware communication technology of Internet of things

Several schemes of building hardware communication technology of Internet of things

2022-07-07 10:18:00 Always pay money

First of all, we realize that the final result is :APP Or applet or website can receive data reported by hardware in real time ,APP Or applet or website can operate and control hardware devices .

Scheme 1   Use MQTT Technical realization

Buy your own servers , Set up on the server MQTT, Background technology development MQTT, Implement publish and subscribe . When the hardware side develops connection communication , Also use mqtt Implement publish and subscribe , This requires the hardware side to write code ,APP Or websites or applets should also realize publishing and subscription functions . As shown in the figure below

Option two   Hardware not developed MQTT, Use TCP Way to connect to the user , Send and receive data directly to the server or hardware

Hardware is about hardware development , Bring their own wifi or WIFI turn 4G、2G、5G Connect to our own server . Hardware and server adopt TCP Two-way communication . Then build it on our server MQTT, Background program development MQTT The client implements the subscription and publish subscription program to connect to the third-party platform MQTT, For example, Alibaba cloud Internet of things platform 、 Tencent Internet of things platform , They are all based on MQTT A platform for pattern development , our APP、 Applet 、 Website , Just go through MQTT Subscription and publish subscription can be completed The communication , As shown in the figure below

Option three  

The hardware is transmitted to the server , You need to install... On the server Swoole, This allows you to use TCP and Websocket service , Of course, we also need to install MQTT service . Hardware and server are through TCP signal communication ,TCP After receiving the data , Execute release ,websocket Execute subscription message , Finally through websocket Send in real time APP Or the applet or website shows . Again APP Or applet website through websocket Communication sends relevant control instructions to the server ,websocket Execute publishing after receiving data ,TCP Subscribe to news over there , In by TCP Send instructions to control hardware , As shown below .

 

Option four   Hardware needs to be developed MQTT agreement function , Directly connect to the third-party platform , For example, Alibaba cloud Internet of things platform or Tencent Internet of things platform MQTT  .APP Directly publish or receive message subscriptions , You can receive data , Control hardware equipment .

 

原网站

版权声明
本文为[Always pay money]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070749171274.html