Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicroWebSrv2 with urequests -- Wont' resolve FQDN while MicroWebSrv2 is running #93

Open
interconnectix opened this issue May 29, 2023 · 0 comments

Comments

@interconnectix
Copy link

I am running Micropython 1.20 on a ESP32-WROOM microcontroller with MiroWebSrv2 and urequests.

When MicroWebSrv2 is running (mws2.StartManaged()) I cannot use urequests to POST JSON to a FQDN domain. It will return an error of OSError(16,)

Code example below:


import urequests
def sendInfo():
data = {
"key:vaule"
}
try:
response = urequests.post(http://somedomain.com/data/api, json=data)
print("Response status code:", response.status_code)
print("Response content:", response.content)
except Exception as e:
print("Error occurred during the request:")
print(repr(e))

If I replace the FQDN domain with a IP address (random example IP below), it works as expected while MicroWebSrv2 is running. (mws2.StartManaged())


import urequests
def sendInfo():
data = {
"key:vaule"
}
try:
response = urequests.post(http://8.8.8.8/data/api, json=data)
print("Response status code:", response.status_code)
print("Response content:", response.content)
except Exception as e:
print("Error occurred during the request:")
print(repr(e))

Any suggestions on a resolution as it seems that it won't resolve DNS. (note: when I stop MicroWebSrv2 (mws2.Stop()), urequests can resolve a FQDN.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant