WINC soft AP causes crash

General discussion about topics related to OpenMV.
frank26080115
Posts: 32
Joined: Tue Jul 28, 2020 2:32 am

WINC soft AP causes crash

Postby frank26080115 » Fri Aug 07, 2020 3:47 am

The following code crashes the whole board

Code: Select all

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

Code: Select all

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
User avatar
iabdalkader
Posts: 1229
Joined: Sun May 24, 2015 3:53 pm

Re: WINC soft AP causes crash

Postby iabdalkader » Fri Aug 07, 2020 12:12 pm

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:

Code: Select all

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.
User avatar
iabdalkader
Posts: 1229
Joined: Sun May 24, 2015 3:53 pm

Re: WINC soft AP causes crash

Postby iabdalkader » Fri Aug 07, 2020 12:51 pm

Fixed.
frank26080115
Posts: 32
Joined: Tue Jul 28, 2020 2:32 am

Re: WINC soft AP causes crash

Postby frank26080115 » Fri Aug 07, 2020 5:16 pm

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.

Return to “General Topics”

Who is online

Users browsing this forum: GL-ITC and 2 guests