Test procedures of Wifi functions of general platform
Notes: product test is used only in production, and it is mainly used to test the Wifi function of modules and the communication capability of module and control panel. <br />
The test requires no network connection, and the product test process is triggered by pressing button. The test process takes about 5s.<br />
Note: <br />
1. There shall be as less routers as possible to speed up test of products.<br /> 2、Please wait for 2 seconds after the system is connected to the power supply so that the module is started.<br /> 3、Product test is not required in daily use. <br />

1. Preparation

One 2.4G wireless router and power supply, and network connection is not required. The SSID of router will be set to tuya_mdev_test, and it will be placed in the workshop of the production line.

2. Connect the device to be tested to the power supply.

3. Trigger the product test.

mcu will press button and hold it to trigger product test (the trigger mode is realized by mcu, it is recommended to use key combination that is uncommon or press some keys for a long period to trigger product test function).
Then the following interfaces will be invoked to trigger product test:

4.Check results of test

The following methods can be used to check test results based on whether the mcu_sdk provided by Tuya is used.

4.1 mcu_sdk is used.

Check results of tests in the wifi_test_result()function of the protocol.c file.
void wifi_test_result(unsigned char result,unsigned char rssi)
	#error "Please add your own codes for successful or failed Wifi function test and delete this line when codes are added."

	if(result == 0)
		//Test failed
		if(rssi == 0x00)
  			//The tuya_mdev_test router is not found in the scanning, please check it
		else if(rssi == 0x01)
  			//The module is not authorized
		//Test succeeded
		//rssi represents signal strength (0-100, 0 represents the weakest signal, and 100 represents the strongest signal)

4.2 mcu_sdk is not used

Check results of tests according to received data.

5 Display test results

The tests have three kinds of test results, and test results will be displayed on the display screen of the control panel.
  1. Signal strength
  2. The tuya_mdev_test router is not found in the scanning, please check it
  3. he module is not authorized

Production test