Feather ESP 32-2 OSError-2

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
blakebr
 
Posts: 957
Joined: Tue Apr 17, 2012 6:23 pm

Re: Feather ESP 32-2 OSError-2

Post by blakebr »

Hello,

Where can I get these libraries?

Code: Select all

import wifi
import ipaddress
I am runnning:

Code: Select all

Adafruit CircuitPython 8.0.0-alpha.1-89-gb38109c48 on 2022-08-02; Raspberry Pi Pico with rp2040
on a RP2040 Pico W.

TIA,
Bruce

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Feather ESP 32-2 OSError-2

Post by tannewt »

CircuitPython is not supported on the Pico W. wifi and ipaddress are native modules that are currently only available on ESP chips.

Issue tracking Pico W support is here: https://github.com/adafruit/circuitpython/issues/6558

User avatar
fruito
 
Posts: 40
Joined: Thu Jul 07, 2022 11:40 pm

Re: Feather ESP 32-2 OSError-2

Post by fruito »

So the OSError -2 is DNS error.

It can be reproduced by:

Code: Select all

>>> requests.get('http://not_a_dns_name')
Traceback (most recent call last):
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_requests.py", line 726, in get
  File "adafruit_requests.py", line 667, in request
  File "adafruit_requests.py", line 509, in _get_socket
OSError: -2

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Feather ESP 32-2 OSError-2

Post by mikeysklar »

Good find @fruito. That will be really helpful knowing that a bad DNS server can be a culprit.

User avatar
fruito
 
Posts: 40
Joined: Thu Jul 07, 2022 11:40 pm

Re: Feather ESP 32-2 OSError-2

Post by fruito »

  • Would be nice if we had better diagnostics
  • The DNS client should try more than once to send the DNS query to account for possible packet loss.

User avatar
blakebr
 
Posts: 957
Joined: Tue Apr 17, 2012 6:23 pm

Re: Feather ESP 32-2 OSError-2

Post by blakebr »

Hello,

Having a secondary DNS option would be very useful too. Most home routers provide for them,

Bruce

User avatar
fruito
 
Posts: 40
Joined: Thu Jul 07, 2022 11:40 pm

Re: Feather ESP 32-2 OSError-2

Post by fruito »

Link to the code where -2 is originated:

https://github.com/adafruit/circuitpyth ... ool.c#L130


Passed without any changes to CP

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”