I am using an ESP8266 board with micropython.
I tried to use asyncio, but it doesn't work and says me that :
Traceback (most recent call last):
File "<stdin>", line 10, in <module>
File "<stdin>", line 7, in main
AttributeError: 'module' object has no attribute 'run'
I took a look about what does uasyncio contains and I got this :
>>> import uasyncio as asyncio
>>> asyncio.
__class__ __name__ __path__ DEBUG
log select sleep sleep_ms
time ucollections uerrno utimeq
type_gen set_debug CancelledError TimeoutError
EventLoop SysCall SysCall1 StopLoop
IORead IOWrite IOReadDone IOWriteDone
get_event_loop SleepMs cancel TimeoutObj
wait_for_ms wait_for coroutine ensure_future
Task _socket PollEventLoop StreamReader
StreamWriter open_connection start_server
uasyncio core
After some researches, I have found in this documentation that uasyncio is supposed to get functions like new_event_loop(), run, etc... that I absolutely don't have there...
There is my script :
from robot import *
import uasyncio as asyncio
def main(args):
robot = MicroportalRobot("robotName", "serverAddr", 8266)
asyncio.run(robot.main())
if __name__ == "__main__":
main([])
Why?