Raspberry Pi Asked by Aayush Lakkad on January 4, 2022
I have created an access point on my raspberry pi, now I wish write a python program to check if an access point has been created or not? is it possible to know through command line or python library. If yes, how?
Thank you
I don't know if there is a library function to check if there is an access point created or not. But on the command line you can use iw
or wpa_cli
. iw
is more generic, with wpa_cli
you have to specify the interface name, but you can get more details if needed.
rpi ~$ iw dev | grep 'type AP'
type AP
# or just check for the return code:
rpi ~$ iw dev | grep --quiet 'type AP'
rpi ~$ echo $?
0
rpi ~$ wpa_cli -iwlan0 status | grep 'mode=AP'
mode=AP
# or just check for the return code:
rpi ~$ wpa_cli -iwlan0 status | grep --quiet 'mode=AP'
rpi ~$ echo $?
0
Answered by Ingo on January 4, 2022
0 Asked on October 5, 2021 by synthesis
1 Asked on October 5, 2021 by intexx
0 Asked on October 5, 2021 by pokebab
0 Asked on October 4, 2021
2 Asked on February 17, 2021 by randy
0 Asked on February 15, 2021
4 Asked on February 12, 2021 by adrianboimvaser
1 Asked on February 11, 2021 by alnitak
2 Asked on February 10, 2021 by potatobox
1 Asked on February 10, 2021 by alexandre-a
0 Asked on February 9, 2021 by emanuel-graf
1 Asked on February 8, 2021 by h-h
Get help from others!
Recent Answers
Recent Questions
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP