Skip to content

Access point status function return error #12497

Answered by peterhinch
sabeehalam asked this question in ESP8266
Discussion options

You must be logged in to vote

That code works fine here on an ESP8266. In my testing .status() returns -1 every time, but no exception is thrown.

When posting code samples, if you enclose the sample in triple backtick () characters, indentation is preserved. If the opening triple backtick is followed by py` then syntax colouring is also added:

import network
import time

ap_interface = network.WLAN(network.AP_IF)
ap_interface.active(True)
ap_interface.config(essid="rats", password="password")
while ap_interface.active() == False:
    pass
print('Access Point enabled successfully')
print(ap_interface.ifconfig())
while True:
    print(ap_interface.status())
    time.sleep(1)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@sabeehalam
Comment options

Comment options

You must be logged in to vote
1 reply
@sabeehalam
Comment options

Answer selected by peterhinch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants