Skip to content

Errors using ap mode. #5

@beyonlo

Description

@beyonlo

Hello, all works fine when used by net (sta) mode - the default mode. But in the ap mode, sometimes some errors happen. I can't tell you exactly how to reproduce that errors because sometimes works and sometimes do not works.

I just used ap mode in this way:

from controllers import net, ap

ap.config(essid='APTEST')
ap.config(max_clients=5)
ap.active(True)
time.sleep(2)
print(ap.ifconfig())
print('AP configured.')

Ps: sometimes using more than one browser simultaneously, but the same test was done with net (sta) mode and no errors.

Error test 1:

b'Accept-Encoding: gzip, deflate\r\n'
b'Accept-Language: en-US,en;q=0.9,pt;q=0.8\r\n'
Handling: ["CMD","send_message",[""]]
route: /
Route found?: True
Handling: ["CMD","send_message",[""]]
b'GET /static/img1.jpg HTTP/1.1\r\n'
b'Host: 192.168.4.1\r\n'
unregister
b'Connection: keep-alive\r\n'
Task exception wasn't retrieved
future: <Task> coro= <generator object 'add_client' at 3fcac4c0>
Traceback (most recent call last):
  File "uasyncio/core.py", line 1, in run_until_complete
  File "ws.py", line 227, in add_client
OSError: Wifi Invalid Mode
Task exception wasn't retrieved
future: <Task> coro= <generator object 'run_fake_interface' at 3fca9300>
Traceback (most recent call last):
  File "uasyncio/core.py", line 1, in run_until_complete
  File "ws.py", line 138, in run_fake_interface
  File "ws.py", line 26, in send
  File "uasyncio/funcs.py", line 1, in gather
  File "uasyncio/core.py", line 1, in run_until_complete
  File "websockets/protocol.py", line 193, in send
  File "uasyncio/stream.py", line 1, in drain
OSError: [Errno 128] ENOTCONN
b'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36\r\n'
b'GET /static/jquery.js HTTP/1.1\r\n'
b'Accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8\r\n'
b'Host: 192.168.4.1\r\n'
b'Referer: http://192.168.4.1/\r\n'
b'Connection: keep-alive\r\n'

Error test 2:

Route found?: True
b'Connection: keep-alive\r\n'
b'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36\r\n'
b'Accept: */*\r\n'
b'Referer: http://192.168.4.1/\r\n'
b'Accept-Encoding: gzip, deflate\r\n'
b'Accept-Language: en-US,en;q=0.9,pt;q=0.8\r\n'
route: /static/jquery.js
Route found?: True
Client Connection to b'/'
register
Handling: ["GET","wifi",[]]
Handling: ["CMD","hal",[]]
Handling: ["CMD","start_interface",[]]
Task exception wasn't retrieved
future: <Task> coro= <generator object 'run_fake_interface' at 3fca69b0>
StopIteration: 
Task exception wasn't retrieved
future: <Task> coro= <generator object 'add_client' at 3fca9850>
StopIteration: 
Task exception wasn't retrieved
future: <Task> coro= <generator object '_serve' at 3fca71d0>
StopIteration: 

I'm using ESP32-S3 with MicroPython 1.18.

Any idea what is the problem?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions