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 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