This program includes two parts: 1. MqttPhp Used to connect to the MQTT server and provide websocket services. The program uses two open source libraries: Sskaje/MQTT: used to connect the MQTT server, publish and subscribe topics (https://github.com/sskaje/mqtt) Workerman: PHP socket server framework, used to provide websocket services for web client-sides (http://www.workerman.net/) 2. CaysnWeb For Web clients, pure static pages Deployment instructions: MqttPhp needs to be deployed in a Linux environment (php7.1.7 CentOS7.3 tested). If you want to deploy in Windows, you need to replace workerman with a Windows version. Refer to the official workerman documentation for details, and Windows is not recommended as a production environment. The websocket uses port 2345 by default, please open the firewall on this port Linux users can run the following script to check whether the local environment meets the requirements of WorkerMan The curl - Ss http://www.workerman.net/check.php | PHP The MQTT server deployment is available at http://emqtt.com/ Deployment steps: 1. In the MqttPhp/test/test.Inc.php configuration, change the MQTT server address and user name password to your own 2. Put MqttPhp on the Linux server 3. Enter to MqttPhp/test directory, and run PHP work.php start to enter the debug mode or PHP work.php start-d to enter the daemon mode (that is Official online operation mode, and that's not affected when close the terminal). 4. In CaysnWeb\js/main.js, ws = new WebSocket("ws:/ 127.0.0.1:2345");Change to the server IP and WebSocket service port where MqttPhp is located (2345 by default) 5. Open CaysnWeb\index.html directly with a browser or deploy it on a web server 6. If the connection to the websocket server is successful, the browser Console prints "connection is successful". 7. Enter the Topic subscribed by the printer in Topic and click Punish to publish the message to the printer