319 Star 2.1K Fork 1K

OpenHarmony / kernel_liteos_a

 / 详情

How to set up WiFi in Hi3518EV300 DIY IP Camera?

已完成
任务
创建于  
2020-10-06 15:55

Hello,

I have Hi3518EV300 DIY IP Camera board running recent OpenHarmony. How can I configure wifi to connect to an existing network or to set up an access point? Can I use the existing ifconfig or hi3881 shell commands?

谢谢~

评论 (3)

WojciechZmuda 创建了任务
展开全部操作日志

samples of hostapd and wpa_supplicant are in this directory: applications/sample/camera/communication, you can edit the BUILD.gn and hostapd/config/hostapd.conf or wpa_supplicant/config/wpa_supplicant.conf in this directory.

example of BUILD.gn:

lite_component("sample") {
    features = [
        "wpa_supplicant:wpa_sample", #station
        "hostapd:hostapd_sample" #ap
        #"wpa_cli:wpa_cli_sample" #wpa client
    ]
}

example of hostapd/config/hostapd.conf:

interface=wlan0
driver=hdf wifi
ctrl_interface=udp
# name of this ap
ssid=testap
hw_mode=g
channel=1
ignore_broadcast_ssid=0
# following use wpa2-psk encrypt type
# you can omit this if going to setup an open ap
auth_algs=1
wpa=2
wpa_passphrase=12345678
rsn_pairwise=CCMP

example of wpa_supplicant/config/wpa_supplicant.conf:

country=GB
ctrl_interface=udp
network={
    #which SSID to connect to
    ssid="example"
    # key_mgmt=NONE if connect to an open ssid
    #key_mgmt=NONE
    # or use psk to suply the password of that ssid
    psk="12345678" 
}

Suppose the wireless interface is wlan0, after build and burn the new image to your device, you can then execute the following command to connect to an existing network:
exec /bin/wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
or execute this command to connect to an existing network:
exec /bin/hostapd -i wlan0 /etc/hostapd.conf

hope this would be helpful.

@Caoruihong thank you very much. I will test this next week and will let you know.

Denny 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
7989137 caoruihong 1601432415
C
1
https://gitee.com/openharmony/kernel_liteos_a.git
git@gitee.com:openharmony/kernel_liteos_a.git
openharmony
kernel_liteos_a
kernel_liteos_a

搜索帮助