Quantcast
Viewing all articles
Browse latest Browse all 4938

MicroPython • Re: Raspberry pi pico w wont activate AP

Where do you learn about WLAN.ioctl() ?

It does not seem to be documented here - https://docs.micropython.org/en/latest/ ... .WLAN.html
There are quite a few methods which aren't documented across MicroPython - for 'network' there's '.route()', and for 'network.WLAN' there's '.ioctl()' and '.send_ethernet()'.

Finding where they are defined in source code is often the best way of figuring out what the parameters are, whether the methods are standalone or apply to to a class object, but just finding them can sometimes be a challenge, whether they are in a generic module, a platform or hardware specific one.

For MicroPython on the RP2040 both '.ioctl()' and '.send_ethernet()' are defined in -

https://github.com/micropython/micropython/blob/master/extmod/network_cyw43.c

And both call 'cyw43_*' functions, so you have to dig even deeper to figure out how they actually work, what data items they need, what they do.

Sometimes one gets lucky, finds someone who has insider knowledge or done the leg work of figuring it out, in whole or part, reveals its use in some example code, and, if lucky, describes it. There may be stuff to be gleaned from other implementations which use similar.

Here I would guess the OP had resorted to printing the results of all methods 'dir()' had shown in the hope of revealing useful information, wasn't actually expecting it to work beyond returning a status value when no arguments were used. But that doesn't.
If I comment-out that one inappropriate function call the rest of your script executes and appears to make an association with my home wlan.
I expect it will for everyone who doesn't have this "[CYW43] F2 not ready" issue. I really do think it's a specific issue for the OP rather than a MicroPython issue.

Having the '.ioctl()' shouldn't have affected anything as the failure to connect happens before that causes an error. But might be worth taking it out anyway.

Statistics: Posted by hippy — Fri Nov 08, 2024 6:28 pm



Viewing all articles
Browse latest Browse all 4938

Trending Articles