There are two ways to authorize the secondary development module for connected products:
1. Serial port authorization (also called module production test), suitable for scenarios: mass production stage.
2. Plain text authorization (also called license list authorization or device authorization), suitable for scenarios: suitable for use during development and debugging stage.
Note: Be sure to disable the plain text authorization method in mass production firmware, otherwise the module cannot pass the module production test process during factory production.
I. Serial Port Authorization
Serial port authorization is the module production test, using the Tuya production solution,Cloud Module tool writes module firmware and authorization information into the module through a serial port method of burning + authorization integration. Prerequisite: The program must callmf_init initialization interface.
MF_IMPORT_INTF_S intf = {0};
intf.uart_init= mf_uart_init_callback;
intf.uart_free= mf_uart_free_callback;
intf.uart_send= mf_uart_send_callback;
intf.uart_recv= mf_uart_recv_callback;
intf.mf_user_product_test= mf_user_product_test_callback;
intf.user_callback= mf_user_callback;
intf.user_enter_mf_callback= mf_user_enter_mf_callback;
TUYA_CALL_ERR_RETURN(mf_init(&intf, APP_BIN_NAME, USER_SW_VER, TRUE));
TAL_PR_NOTICE("mf_init successfully");
Required tools: production certificate, cloud module tool, USB to serial port board.
Possible reasons for failure: module connected to the network for more than 15 minutes, incorrect baud rate selection (default is 9600), wiring issues, etc.
II. Plain Text Authorization
Plain text authorization is the method of filling in UUID and KEY in the program, and the authorization information is transmitted throughOPERATE_RET tuya_iot_set_wf_gw_prod_info(IN CONST WF_GW_PROD_INFO_S *wf_prod_info) interface.
Example is as follows:
#define UUID "f998xxxxxxxx2409"
#define AUTHKEY "WEHAxxxxxxxxxxxxxxxxxxxxxxxxVVkf"
WF_GW_PROD_INFO_Sprod_info= {UUID, AUTHKEY};
TUYA_CALL_ERR_RETURN(tuya_iot_set_wf_gw_prod_info(&prod_info));
III. How to Obtain License
1. After receiving and product creation, you can generally receive 2 licenses for free
2. Procurement - Production R&D Procurement