<class 'OSError'> Avialable Interfaces are down
-
@milan This is how I usually do to get the correct security settings:
wlan = WLAN(mode=WLAN.STA) nets = wlan.scan() for net in nets: if net.ssid == ssidName: print('Network found!') wlan.connect(net.ssid, auth=(net.sec, password), timeout=5000) while not wlan.isconnected(): pass breakJohan
-
@johand When Pycom is in WiFi STA mode everything works fine, but I want to do the same thing when Pycom is in WiFi AP mode, so other Pycom would be able to connect to AP and to send HTTP request.
One Pycom should be HTTP server, listening for HTTP requests with WiFi in AP mode, and other should send HTTP requests with WiFi in STA mode connected to first Pycom WiFi.
Is that even possible? -
@milan said in <class 'OSError'> Avialable Interfaces are down:
When Pycom is in WiFi STA mode everything works fine, but I want to do the same thing when Pycom is in WiFi AP mode
What problem do you have?
It is possible to run one device as HTTP server and one as client. Depending on what you want to transfer, it might be easier to use plain sockets instead.
-
@johand I want to have one device as HTTP server with WiFi in AP mode, and other device as HTTP client with WiFi in STA mode. HTTP client device should be connected to AP from HTTP server. Is that possible?
Are there any example of plain socket communication?
Than you in advance.
-
@milan WiFi connection modes and Client/Server relation are completely independent topics. You can have all devices connected as STA to a separate AP and have a server on one device and clients on all devices.
That's something I would do anyhow: Get a unexpensive AP and use that for interconneting, unless you have other restrictions. -
@robert-hh no, it does not tell me any line or more information, it just shows me that error and continues to execute the code
-
@robert-hh Thank you for your suggestion.
I've tried configuration with three devices:- device 1 - HTTP client with WiFi in STA mode connected to device 3
- device 2 - HTTP server with WiFi in STA mode connected to device 3
- device 3 - WiFi in AP mode
This configuration works ok.
My idea is to have devices 2 and 3 as one device. Is that possible, to have HTTP server which WiFi is in AP mode? -
@milan
I had this exact problem. Roll back to firmware 1.18.0 solved it. -
@milan Yes, as @robert-hh wrote erlier, WIFI mode and what your application does is not related. I guess you have already tried, what problem do you run into?
-
@johand After I've set IP for HTTP server
wlan.ifconfig(id=1, config=('192.168.4.10', '255.255.255.0', '192.168.4.1', '192.168.4.1'))i've tried to read IP address of HTTP Server and that was the problem, it's keep returning me '0.0.0.0'. IP address was set properly to '192.168.4.10' but function returns '0.0.0.0'.
print('Network config:', wlan.ifconfig()) Network config: ('0.0.0.0', '0.0.0.0', '0.0.0.0', '0.0.0.0')Thank you for your help.
@pigamonte I've managed to do it with 1.18.2.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login