Comments (8)
Microdot now defaults to running requests synchronously, so this shouldn't be a problem anymore. Please give the latest release of microdot.py a try and reopen if you still have problems.
from microdot.
Without the error I cannot really tell you what the problem is.
from microdot.
sorry, here is the full output. I could also imagine that it is more an issue on the port of Micropython to the RP2-Family.
Starting async server on 0.0.0.0:5000...
Traceback (most recent call last):
File "<stdin>", line 48, in <module>
File "microdot_asyncio.py", line 216, in run
File "uasyncio/core.py", line 1, in run
File "uasyncio/core.py", line 1, in run_until_complete
File "uasyncio/core.py", line 1, in run_until_complete
File "microdot_asyncio.py", line 177, in start_server
File "uasyncio/stream.py", line 1, in start_server
AttributeError: 'module' object has no attribute 'SOL_SOCKET'
from microdot.
The error is in the start_server
function of the uasyncio
module. Not sure what kind of networking the MicroPython builds for this device have, but it appears uasyncio
isn't compatible with it at this time.
from microdot.
Thanks for your reply. I already tried with the threaded version, but had no luck there too. I could start the server, but the first request (using curl) kicked the following issue:
Starting threaded server on 0.0.0.0:80...
Traceback (most recent call last):
File "<stdin>", line 21, in <module>
File "microdot.py", line 770, in run
OSError: -1
�>Traceback (most recent call last):
File "microdot.py", line 811, in dispatch_request
File "microdot.py", line 257, in create
File "microdot.py", line 318, in _safe_readline
OSError: [Errno 1] EPERM
Unhandled exception in thread started by <closure>
Traceback (most recent call last):
File "microdot.py", line 36, in run
File "microdot.py", line 860, in dispatch_request
File "microdot.py", line 407, in write
OSError: [Errno 1] EPERM
The minimum example-code is:
import network
SSID ='My_Nano_RP2040_Connect' # Network SSID
KEY ='1234567890' # Network key (must be 10 chars)
wlan = network.WLAN(network.AP_IF)
wlan.active(True)
wlan.config(essid=SSID, key=KEY, security=wlan.WEP, channel=2)
print("AP mode started. SSID: {} IP: {}".format(SSID, wlan.ifconfig()[0]))
from microdot import Microdot
app = Microdot()
@app.route('/')
def hello(request):
return 'Hello, world!'
app.run(port=80, debug=True)
I would love to use your package on the RP2040 connect as it is exactly what I was searching for.
from microdot.
Unfortunately I have nothing comparable to your device to test on.
from microdot.
Can I provide you anything useful? Trying something to give you a clue what could go wrong?
from microdot.
You should ask the MicroPython people, because the build that you are using is missing things. This is unlikely to be a problem with this project.
from microdot.
Related Issues (20)
- Microdot + ssl socket connection HOT 30
- render_template hangs when using microdot_asyncio HOT 5
- Errors with esp32 HOT 5
- second call of send_file method does not serve complete file. HOT 7
- ImportError: can't import name Microdot on helloworld sample for RP2040
- microdot hangs when aborting static file serve HOT 7
- Async server does not run on Python 3.12 HOT 1
- Websocket example doesn't work on CPython / Linux: invalid start byte HOT 2
- send_file hangs when using microdot_asyncio bug HOT 1
- websocket: limit maximum message length HOT 1
- Hang on python 3.10.4 HOT 3
- ws is not working HOT 1
- Client ECONNRESET errors when POSTing to micropython microdot from micropython aiohttp HOT 2
- Shutdown not completing request HOT 11
- Some crashes cause the server to exit
- long/complex URLs cause recursion limit HOT 9
- ".." in URL path resolves correctly, "//" does not HOT 4
- signal module doesnt exist in micropython HOT 4
- Integer-type dynamic path component does not match 0 HOT 3
- CircuitPython support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microdot.