Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use this module in Rasspberry Pi #49

Open
JintaoSun opened this issue Mar 6, 2019 · 3 comments
Open

How do I use this module in Rasspberry Pi #49

JintaoSun opened this issue Mar 6, 2019 · 3 comments

Comments

@JintaoSun
Copy link

JintaoSun commented Mar 6, 2019

I can use this module to establish a wifi connection in Windows, my code is as follows:
wifi=PyWiFi()
ifaces=wifi.interfaces()[0]
print(ifaces.name())
print(const.IFACE_CONNECTED)
print(const.IFACE_INACTIVE)

profile = pywifi.Profile()
profile.ssid = ""
profile.auth = const.AUTH_ALG_OPEN
profile.akm.append(const.AKM_TYPE_WPA2PSK)
profile.cipher = const.CIPHER_TYPE_CCMP
profile.key = "
**"

tmp_profile = ifaces.add_network_profile(profile)
ifaces.connect(tmp_profile)
time.sleep(5)

if ifaces.status() == const.IFACE_CONNECTED:
print("OK")
else:
print("ERROR")`
Now I wann make a wifi connection on Raspberry pi,using this code not succeed.
The "Prerequisites" : "On Linux, you will need to run wpa_supplicant to manipulate the wifi devices, and then pywifi can communicate with wpa_supplicant through socket." I think I should start here, but I don't know how to do it in particular. could you give me some advice? Thanks

@SamLangTen
Copy link

I use this module on Raspberry pi and it do not succeed either. However it works on Windows.

@boboyejj
Copy link

Having the same issue. The iface.status() is always 0, but I am sure it already connected to the Network.

@Henrywh15
Copy link

Having the same issue~ Anyone can fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants