Search found 23 matches

by enzo
Wed Jan 13, 2021 3:45 pm
Forum: General Discussion and Questions
Topic: ESP8266 WiFi client
Replies: 12
Views: 966

Re: ESP8266 WiFi client

Thanks, I'll do so. Two notes. I do not recommend a busy wait in the loop for wait connected. better add a small delay, like: import time def connectToWifi(SSID, PW): print(ubinascii.hexlify(network.WLAN().config('mac'),':').decode()) client = network.WLAN(network.STA_IF) client.active(True) print(c...
by enzo
Tue Jan 12, 2021 11:00 pm
Forum: General Discussion and Questions
Topic: ESP8266 WiFi client
Replies: 12
Views: 966

Re: ESP8266 WiFi client

Forget it: it is my router's DHCP pool not releasing unconnected devices. There were no more IP addresses left for the new boards: once deleted the unused ones the new boards connect.
Thanks.
by enzo
Tue Jan 12, 2021 7:57 pm
Forum: General Discussion and Questions
Topic: ESP8266 WiFi client
Replies: 12
Views: 966

Re: ESP8266 WiFi client

Ok, now I disabled the Micropython debugger and don't see all those messages anymore. Only #6 ets_task(4020ee60, 28, 3fff8e18, 10) still appears but that's not an issue (however I'd like to be able to understand what is tells!). But can anyone please suggest me why this code: def connectToWifi(SSID,...
by enzo
Sun Jan 03, 2021 3:54 pm
Forum: General Discussion and Questions
Topic: ESP8266 WiFi client
Replies: 12
Views: 966

Re: ESP8266 WiFi client

bitninja wrote:
Sun Jan 03, 2021 3:35 pm
Ah, I see what you mean.

Yes, that would a problem if enzo is not expecting the disconnect/connects.
That isn't an issue if the messages don't interfere with the software, i.e. I can ignore them in production.
by enzo
Wed Dec 30, 2020 10:26 pm
Forum: General Discussion and Questions
Topic: ESP8266 WiFi client
Replies: 12
Views: 966

ESP8266 WiFi client

Hi everybody, please, can anyone explain why this code: def connectToWifi(SSID, PW): wlan = network.WLAN(network.STA_IF) wlan.active(True) if not wlan.isconnected(): print("Connecting to network...") wlan.connect(SSID, PW) while not wlan.isconnected(): pass print('Connection successful') mac = ubina...
by enzo
Tue Dec 22, 2020 12:31 am
Forum: General Discussion and Questions
Topic: poll.poll return list decode
Replies: 8
Views: 318

Re: poll.poll return list decode

pythoncoder wrote:
Mon Dec 21, 2020 6:41 pm
I think @Damien is developing improvements to the poll mechanism.
I'll check for this.
Thanks again.
by enzo
Mon Dec 21, 2020 2:13 pm
Forum: General Discussion and Questions
Topic: poll.poll return list decode
Replies: 8
Views: 318

Re: poll.poll return list decode

@enzo here is an example of the use of the poll mechanism from the MicroPython source. Thanks a lot Peter, that is what I was searching for! Not easy, I see. I need to study it carefully and hope to work it out! It seems strange to me there's no exhaustive official microPython documentation for suc...
by enzo
Sun Dec 20, 2020 6:09 pm
Forum: General Discussion and Questions
Topic: poll.poll return list decode
Replies: 8
Views: 318

Re: poll.poll return list decode

but I can't find these constants anywhere.. The constants are defined in the `select` module, and are described briefly in that same document (https://docs.micropython.org/en/latest/library/uselect.html#uselect.poll.register). They mean the same thing as the corresponding values in regular Python; ...
by enzo
Sat Dec 19, 2020 7:02 pm
Forum: General Discussion and Questions
Topic: poll.poll return list decode
Replies: 8
Views: 318

Re: poll.poll return list decode

Thanks Larsks, The `poll` method doesn't return a string. The documentation (https://docs.micropython.org/en/latest/library/uselect.html#uselect.poll.poll) says that it returns: Sorry I meant a list! [a] list of (obj, event, …) tuples. There may be other elements in tuple, depending on a platform an...
by enzo
Thu Dec 17, 2020 4:03 am
Forum: General Discussion and Questions
Topic: poll.poll return list decode
Replies: 8
Views: 318

poll.poll return list decode

Hello, I'm trying to code a simple server with some non blocking listeners waiting for incoming socket streams. I started with this code from RealPython and began modifying it: import socket, utime host = "10.0.0.191" port = 15000 from uselect import poll, select mySocket = socket.socket(socket.AF_I...