WINC soft AP causes crash

The following code crashes the whole board

import network, pyb
wlan = network.WINC(network.WINC.MODE_AP)
pyb.delay(1000)
wlan.start_ap("OpenMV")

when this is run, the board reboots

The line “Running in Access Point mode…” does show up in the terminal, the call to start_ap seems to crash it

I can run the code in serial terminal and it does the exact same thing

Adding delays don’t help

also, setting the soft-ap parameters in the on-board settings file seems to make the board not able to connect via serial port. good thing it was easy to delete the settings file off the board, otherwise the board is kinda… I don’t wanna say bricked…

Version info

MicroPython v1.12-omv OpenMV v3.6.7 2020-07-20; OPENMV4P-STM32H743
WINC firmware is Firmware version: (19, 6, 1, 19, 3, 0, 1377184)

Demo code for scanning WiFi still works

EDIT: Oh and it’s important that it did work once. So maybe I need to clear the DHCP table?

EDIT: running FW update on the WiFi module did not help, still crashing

Hi, it’s seems to be a bug when using an open network (no security). I’ll look into it, in the meantime if you switch to WEP it works:

import time, network, usocket

SSID ='OPENMV_AP'    # Network SSID
KEY  ='1234567890'    # Network key (must be 10 chars)

# Init wlan module in AP mode.
wlan = network.WINC(mode=network.WINC.MODE_AP)
wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)

# You can block waiting for client to connect
print(wlan.wait_for_sta(100000))

print(wlan.connected_sta())

Note you shouldn’t be using an open network anyway.

Fixed.

I noticed that wait_for_sta is pretty much useless, or a disconnected wifi client device has a really really long timeout

wait_for_sta() waits for the client to connect, I used it for testing. The same can be done with accept on a blocking socket.