• SDK configuration
    Here WIFI refers to the WIFI provided by the original factory, the model is ssw01b, and the driver module of this WIFI is included in the SDK, which is located in project/release/nvr/i2m/common/glibc/8.2.1/wifi/modules/ssw101b_wifi_HT40_usb.ko.
    According to project/image/configs/i2m/rootfs.mk, interface_wlan=enable needs to be configured:
    #vi project/image/configs/i2m/rootfs.mk

    interface_wlan is configured in project/release/customer_tailor/nvr_i2m_display_glibc_tailor.mk:
    #vi project/release/customer_tailor/nvr_i2m_display_glibc_tailor.mk

    The kernel turns on Ethernet Bridging

    After compilation, bridge.ko, llc.ko and stp.ko will be generated in the kernel/modules directory:
    • Load the driver
      Copy the three drivers generated by Ethernet Bridging to the /config/wifi directory:

      Before loading the WIFI driver, we need to reset the WIFI chip:
      #echo ON > /dev/wifi_reset
      #echo OFF> /dev/wifi_reset
      After the reset is complete, execute the script ssw01bInit.sh to load the driver:
      #insmod /opt/wifi/llc.ko
      #insmod /opt/wifi/stp.ko
      #insmod /opt/wifi/bridge.ko
      #/config/wifi/ssw01bInit.sh
      After the driver is loaded, you can see the device node wlan0:
      #ifconfig wlan0 up
      #ifconfig wlan0

      Add environment variables:
      #export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/lib:/config/wifi
      Configure bridging:
      #ifconfig p2p0 up
      #ifconfig wlan0 0.0.0.0
      #ifconfig p2p0 0.0.0.0
      #brctl addbr br0
      #brctl addif br0 wlan0
      #brctl addif br0 p2p0
      #ifconfig br0 up
  • STA mode
    Create a new file /appconfigs/wpa_supplicant.conf and set hotspot information:

    Start connecting to the hotspot:
    #/config/wifi/wpa_supplicant -Dnl80211 -i wlan0 -c /appconfigs/wpa_supplicant.conf &
    After the connection is successful, you can see that the wlan0 node is assigned an IP:
  • AP Mode
    Edit the AP configuration file /config/wifi/hostapd.conf and set the hotspot name and password and other information:
    #vi /config/wifi/hostapd.conf

    Open AP mode:
    #/config/wifi/hostapd -B /config/wifi/hostapd.conf
    #ifconfig wlan0 192.168.1.1
    #/config/wifi/dnsmasq -i p2p0 --no-daemon -C /config/wifi/dnsmasq.conf &
文档更新时间: 2020-10-24 20:10   作者:admin