Microdot error

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
jbar
Posts: 11
Joined: Mon Nov 15, 2021 1:07 pm
Location: Nebraska USA
Contact:

Microdot error

Post by jbar » Thu Feb 10, 2022 4:48 am

When running an example from the microdot_asyncio module I get the following error. Only change I made to the example code was to replace the example code from 'import asyncio' to 'import uasyncio as asyncio'.


Traceback (most recent call last):
File "/lib/microdot_asyncio.py", line 245, in dispatch_request
File "/lib/microdot_asyncio.py", line 287, in _invoke_handler
TypeError: function takes 0 positional arguments but 1 were given
GET / 500

Code: Select all

#import asyncio
# I changed to:
import uasyncio as asyncio

from microdot_asyncio import Microdot

app = Microdot()

@app.route('/')
async def index():
    return 'Hello, world!'

async def main():
    await app.start_server(debug=True)

asyncio.run(main())

Post Reply