当前位置:网站首页>Using tcp/udp tools to debug the yeelight ribbon

Using tcp/udp tools to debug the yeelight ribbon

2022-06-25 00:26:00 a10615

Use TCP/UDP Tool debugging Yeelight Lamp with

This article describes how to Windows Next , Use TCP/UDP Tool debugging Yeelight Lamp with

preparation

TCP/UDP Debugging tools
Yeelight WiFi Light Inter-Operation Specification

One 、 Search device

Search device , By sending multicast search commands to the LAN , The device will respond after receiving , Return the current status information of the device

1、 establish UDP Multicast connection

According to the document search command

M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1982
MAN: “ssdp:discover”
ST: wifi_bulb

  • type : choose UDP Multicast
  • The goal is IP: Keep multicast identity IP Group 239.255.255.250
  • port :1982
  • Local port :1982( The device response is this port , Can't change )
     Insert picture description here

2、 Send multicast search command

After creating the connection , Copy the search command to the sending area ( Line break , use Ctrl+Enter)
 Insert picture description here
then “ send out ”, Wait for device response

3、 Device response

After sending , If a device is online , Generally, the response can be received immediately . The receiving area is the response of the device
 Insert picture description here

Two 、 Equipment online notification

If the equipment is equipped with network , When accessing the network, the online notification will be sent through multicast . It's the same as searching , Create the same connection , Wait for the device to go online .

In receiving area , Can receive the notification after the equipment goes online ( When the same device goes online , Maybe several times , I have received 3 Time . Different from the search response , See documentation )
 Insert picture description here

3、 ... and 、 Control equipment

1、 establish TCP Connect

Based on search or online notification ip、port Information , establish tcp Connect
 Insert picture description here

2、 dispatch orders

Input command in the sending area ( The command ends with a new line <Ctrl + Enter>)
Such as : Switch the switch state of the equipment

{
    "id":1,"method":"toggle","params":[]}

 Insert picture description here

3、 Device response

After the device receives the command , Will respond to the operation results of the command , If the operation is successful , Notification messages are also sent

#  Operating results 
{
    "id":1, "result":["ok"]}

#  Notice information 
{
    "method":"props","params":{
    "power":"off"}}

 Insert picture description here

If the Yeelight Interested in , You can contact us :[email protected]

原网站

版权声明
本文为[a10615]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210547079231.html