Request algorithm library and place the algorithm library to ${SDK}/vendor/amlogic/aml_csi/alg_lib/libaaisdk.so
. And place related header files to following path: ${SDK}/vendor/amlogic/aml_csi/alg_lib/include/iva/iva_wisense_ppd.hpp
${SDK}/vendor/amlogic/aml_csi/alg_lib/include/iva/iva.hpp
${SDK}/vendor/amlogic/aml_csi/alg_lib/include/iva/iva_wisense_ppd.hpp
${SDK}/vendor/amlogic/aml_csi/main.cpp
adaptation wisense_led_init()& wisense_led_set() function.
Take ba401 as an example, add the following configuration to ${SDK}/buildroot/configs/amlogic/a4_ba401.config
file:
BR2_PACKAGE_AML_CSI=y
run the following command to compile:
make aml-csi-rebuild && make
Start the system and then close system log(Optional):
echo 1 4 1 7 > /proc/sys/kernel/printk
Connect to wifi:
wpa_cli -iwlan0 remove_network 0 wpa_cli -iwlan0 add_network 0 wpa_cli -iwlan0 set_network 0 ssid '"WiFi name"' wpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK wpa_cli -iwlan0 set_network 0 psk '"password"' wpa_cli -iwlan0 set_network 0 pairwise CCMP TKIP wpa_cli -iwlan0 set_network 0 group CCMP TKIP wpa_cli -iwlan0 set_network 0 proto RSN wpa_cli -iwlan0 enable_network 0 wpa_cli -iwlan0 status wpa_cli -iwlan0 save dhcpcd wlan0
aml_wisense -l level
level represents the detection sensitivity level, and the specified parameters are 1, 2, 3, and 4. The larger of the number, the higher the detection sensitivity of the algorithm.
csi data csi data wi_out_ret
wifi driver ---------> aml_wisense --------> wisense alg ----------> result
aml_wisense will automatically obtain csi data and send it to the algorithm interface, and the algorithm will return the operation result(wi_out_ret).
wi_out_ret as follows:
wi_out_ret.motion_status(int):
wi_out_ret.motion_class(int): The motion level detected by the algorithm, the larger of the value, the smaller the motion.
wi_out_ret.motion_value(float): Motion complex value. Float value from 0 to 1, it reflects the complexity of the current motion environment. The larger of the value, the more complex of the current motion environment is.