p2p_group_add setting own password and ssid

13 篇文章 2 订阅
1 篇文章 0 订阅

want to ask help, for setting the desired password for p2p_group_add command,

if we run p2p_group_add on wpa_cli, it will generate random ssid and passphrase

P2P-GROUP-STARTED p2p-wlan0-3 GO ssid="DIRECT-uv" freq=2437 passphrase="UqZ76VLR" go_dev_addr=0a:a1:12:84:45:6e

How can we set our own password ?

 

To setup your autonomous group owner, started with p2p_group_add, with a custom ssid and password you have to make it persistent and have a network block inserted in /etc/wpa_supplicant/wpa_supplicant.conf. The easiest way to get the network block in wpa_supplicant.conf is to let it do wpa_supplicant itself. Just start the p2p group with p2p_group_addas usual but persistent and remove it just after that again:

rpi ~$ wpa_cli -ip2p-dev-wlan0
> p2p_group_add persistent
> p2p_group_remove p2p-wlan0-0
> quit
rpi ~$

Now you should find the persistent network block in /etc/wpa_supplicant/wpa_supplicant.conf. From my test it looks like this:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
device_name=DIRECT-RasPi1
p2p_go_ht40=1
country=DE

network={
        ssid="DIRECT-Ca"
        bssid=56:1d:c5:95:c2:e9
        psk="yfmyjT8o"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
        mode=3
        disabled=2
}

Now just edit this and set ssid and psk as you like. When ready then restart your wpa_supplicant to make the change available.

The first network block has number 0 and so on. Now start the persistent autonomous group owner by addressing this network block with:

rpi ~$ wpa_cli -ip2p-dev-wlan0
> p2p_group_add persistent=0

That's it.


Reference:
[1] want to generate own password while running p2p_group_add in wpa_cli

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值