diff --git a/docs/en/uiflow/advanced.md b/docs/en/uiflow/advanced.md index 2a0811d7..7289d347 100644 --- a/docs/en/uiflow/advanced.md +++ b/docs/en/uiflow/advanced.md @@ -36,6 +36,99 @@ Display information, you can choose some built-in label types, or enter custom t > +# Dashboard + +#### Function Description + +> In addition to the remote control features that are consistent with Remote, Remote-Beta provides a more powerful data panel function. Currently supports two data chart styles of polyline/column, the layout style of the page can be freely adjusted, and will be based on The user API Key is saved to achieve the persistence of the layout style. + +> + +* __Create Chart__ +A data chart program that generates data for the specified chart style. + +* __Remote Button__ +Remote button control, each time the button is clicked, the program in Block is executed once. + +* __Remote Slider__ +Slider control (click the gear button on the block to add a variable X before use, and pass the X to the integer from 0 to 100) + +* __Remote Switch__ +Remote switch control, please click the gear button on the block to add a variable X before use. When controlling, close X to pass 1 and disconnect X to pass 0. + +Note: When naming blocks, avoid spaces and special symbols + +#### Instructions + +> Drag the data chart program to the programming area and fill in the relevant information of the chart in the option box. (Name: chart name, ChartType: polyline/column, DataType: data type of the chart, temporarily only support the number, key: the key of the data Word, Value: Data Source, Interval: Interval Refresh Time) + +__Note: A table can only use one data source. If multiple tables with the same name appear, the data source will use the last data in the order in which the program is executed. + +> + +>The buttons, sliders, and switches are used in the same way as the Remote function. For details, see the function description of the upper block. After editing, click Run Program. Click the QR code option on the right side of the page to scan or copy the data page. Link, use a browser to access. + +> + + +> After entering the control page, keep the M5 device running normally, you can see the data in the chart is refreshed according to the interval we configured. Drag the arrow in the lower right corner of the chart to zoom the entire chart. Click the upper left corner to open the side. Navigation, providing shades of theme color switching and layout switches. (After opening the layout switch, the user is free to modify the position of the chart and other elements placed on the page) + +> +> + + + +# ESP-NOW + +#### Function Description + +>ESP-NOW is a short-range, low-power communication protocol that enables multiple devices to communicate without or without Wi-Fi. This protocol is similar to the low-power 2.4GHz wireless connection found in wireless mice—devices are paired before communicating. After pairing, the connections between devices are continuous, peer-to-peer, and do not require a handshake protocol. + +> + +* __Get mac addr__ +Get the mac address of this machine. + +* __Add peer ff as id__ +Add the specified mac address and set it to id + +* __Set pmk__ +Set the pairing key + +* __Broadcast data__ +Broadcast specified data + +* __Receive mac_addr data__ +Receive data, get the sender's mac address and the data content carried + +* __After send message flag__ +Send a callback function, automatically execute the callback function after executing the send message, and return whether the flag bit flag is successfully sent. The success is True and the failure is False. + +* __Send message id with data__ +Send data to the device with the specified id. + + +#### Instructions + +

Receiver

+ +> Display the local mac address on the screen, use the data receiving block and create two variables for receiving the sender's address and data content. The data is processed inside the receiving block function for display or judgment and other operations. For example, the lower program controls the LED light switch by judging whether the received data is "1". + +__Note: The created variable name is not allowed to be consistent with the parameter name, ie variables with the names "addr" and "data" are not allowed to be used for data acquisition __ + +> + +

Sender

+ +> Add the mac address of the receiving device, fill in the sent data content in the sending program, select the id of the receiving device. Use the button program to control the data transmission. Using the callback function can help us determine whether the data is successfully sent from the machine. We need to use a variable to get its return result. + +__Note: The created variable name is not allowed to be consistent with the parameter name, ie variables with the name "flag" are not allowed to be used for data acquisition __ + +> + +>Complete the program editing, respectively run the receiver and transmitter programs, you can achieve ESP-NOW short-range wireless communication. + + # MQTT communication __________________________ diff --git a/docs/image/ESP_now/esp_now_02.jpg b/docs/image/ESP_now/esp_now_02.jpg new file mode 100644 index 00000000..b3bcd6f0 Binary files /dev/null and b/docs/image/ESP_now/esp_now_02.jpg differ diff --git a/docs/image/ESP_now/esp_now_03.jpg b/docs/image/ESP_now/esp_now_03.jpg new file mode 100644 index 00000000..b5e08cdd Binary files /dev/null and b/docs/image/ESP_now/esp_now_03.jpg differ diff --git a/docs/zh_CN/uiflow/advanced.md b/docs/zh_CN/uiflow/advanced.md index 79526633..61962547 100644 --- a/docs/zh_CN/uiflow/advanced.md +++ b/docs/zh_CN/uiflow/advanced.md @@ -2,7 +2,7 @@ **[数据面板](#数据面板)** - +**[ESP-NOW](#ESP-NOW)** **[MQTT通讯](#MQTT通讯)** @@ -24,8 +24,6 @@ - - # 远程控制 __________________________ @@ -107,7 +105,7 @@ __注意:一个的表格只能使用一个数据来源,若是出现多个相 > - +> +>完成程序编辑,分别运行接收端与发射端程序,即可实现ESP-NOW短程无线通信. # MQTT通讯 __________________________