当前位置:网站首页>Hardware connection server TCP communication protocol gateway
Hardware connection server TCP communication protocol gateway
2022-07-25 11:58:00 【hexiaoniao】
The recent demand has killed me . It is a gateway device ( It's like a router ), There's a network , You can also connect wired . And bracelets , Connect to the gateway via Bluetooth
. Demand is : Server gateway Monitor gateway devices . gateway ( Client or terminal device ) and Gateway Connect the . You can send commands to the terminal .
Download locally first Gateway,http://doc2.workerman.net/on-messsge.html
Install locally php , Then add environment variables . Don't forget

windows It's not start.php Of . Double click directly to start the server .start_for_win.bat
1. Plug in the Internet and turn it off . The computer is connected to the gateway network
2. Configure gateway device connection information . Check here tcp agreement .ip Is the local server ip. Ports can be configured randomly . Try not to 8080. Easily occupied .
The port here should be the same as Gateway The configuration ports should be consistent . Otherwise, it can't be connected

3.
3.start.gateway To configure : Last write 0.0.0.0 By default, both internal and external networks can be accessed

4. Two start_for_win.bat
effect :

The representative service has been started
4.events.php Files deal with business code , Automatically generate . Unique . Don't define
public static function onConnect($client_id)
$data="ADBA0001600016AB3A3ACB98A0000566313210767C00FE";// command
Gateway::sendToClient($client_id, pack("H*",$data));pack("H*",$data) With 16 Hexadecimal format to send
}
5. When the client receives a command . It will call back the data to the server
public static function onMessage($client_id, $message)
{
// var_dump($client_id);
var_dump(bin2hex($message));//16 Hexadecimal format conversion
Store the obtained data into the database .
}
Hardware is really troublesome
边栏推荐
- Javescript loop
- 30套中国风PPT/创意PPT模板
- 第4章线性方程组
- Layout management ==pyqt5
- Transformer变体(Routing Transformer,Linformer,Big Bird)
- Teach you how to configure S2E as the working mode of TCP server through MCU
- JS operator
- Teach you how to configure S2E to UDP working mode through MCU
- W5500上传温湿度到oneNET平台
- PHP uploads the FTP path file to the curl Base64 image on the Internet server
猜你喜欢
随机推荐
W5500通过上位机控制实现调节LED灯带的亮度
The JSP specification requires that an attribute name is preceded by whitespace
JaveScript循环
return 和 finally的执行顺序 ?各位大佬请看过来,
JS数据类型以及相互转换
toString()与new String()用法区别
Attendance system based on w5500
What is the difference between session and cookie?? Xiaobai came to tell you
Teach you how to configure S2E to UDP working mode through MCU
各种控件==PYQT5
Differences in usage between tostring() and new string()
A beautiful gift for girls from programmers, H5 cube, beautiful, exquisite, HD
硬件外设=maixpy3
Arrays in JS
The most efficient note taking method in the world (change your old version of note taking method)
Maskgae: masked graph modeling meets graph autoencoders
【高并发】SimpleDateFormat类到底为啥不是线程安全的?(附六种解决方案,建议收藏)
奉劝那些刚参加工作的学弟学妹们:要想进大厂,这些并发编程知识是你必须要掌握的!完整学习路线!!(建议收藏)
JS流程控制
brpc源码解析(六)—— 基础类socket详解







