Search found 11 matches

by ajvperth
Wed Jul 20, 2022 2:41 pm
Forum: General Discussion and Questions
Topic: Slow asyncio.open_connection
Replies: 1
Views: 2695

Re: Slow asyncio.open_connection

The turn around time is improved from 430 down to 220 mSec by adding encode() and decode() async def contactServer(ip, port, msg): try: reader, writer = await asyncio.open_connection(ip, port) writer.write(msg.encode()) await writer.drain() r = await reader.read(1024) r = r.decode() except: r = None...
by ajvperth
Wed Jul 20, 2022 2:12 pm
Forum: General Discussion and Questions
Topic: Slow asyncio.open_connection
Replies: 1
Views: 2695

Slow asyncio.open_connection

I use an ESP32 to communicate over WiFi with a linux desktop. If the ESP32 is configured as an asyncio echo server and the PC as a client the average go around time is 30 mSec If the ESP32 is configured as an asyncio client contacting the PC running an echo server $ socat tcp-l:5000,fork exec:'bin/c...
by ajvperth
Sat Jul 16, 2022 4:31 pm
Forum: General Discussion and Questions
Topic: asyncio.open_connection no exception
Replies: 3
Views: 2725

Re: asyncio.open_connection no exception

I did found a way around by leaving asyncio and replacing it with a blocked mode function, this works as expected: # Returns True if port available def isPortOpen2(ip, port): try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = sock.connect((ip, port)) sock.close() return True exce...
by ajvperth
Fri Jul 15, 2022 5:07 pm
Forum: General Discussion and Questions
Topic: asyncio.open_connection no exception
Replies: 3
Views: 2725

asyncio.open_connection no exception

Hello, I try to check if an TCP port is open on a ESP32 and use following function to achieve this import uasyncio as asyncio # Returns True if port available async def isPortOpen(ip, port): try: print('Testing:', ip, port) reader, writer = await asyncio.open_connection(ip, port) print(reader, write...
by ajvperth
Tue Jul 12, 2022 11:14 am
Forum: General Discussion and Questions
Topic: Class destructor. Implementation error?
Replies: 3
Views: 1704

Re: Class destructor. Implementation error?

Thanks, for pointing me to the page with core language limitations.
I did read it but did not realize the consequences.
by ajvperth
Tue Jul 12, 2022 7:50 am
Forum: General Discussion and Questions
Topic: Class destructor. Implementation error?
Replies: 3
Views: 1704

Class destructor. Implementation error?

Hello, possibly I found an implementation error in micropython? on CPython this code: class Controller: def __init__(self): print('__init__()') def __del__(self): print('__del__()') def run(self): print('run()') try: Controller().run() except KeyboardInterrupt: print('\nTerminated, Ctrl-C pressed') ...
by ajvperth
Mon Jul 11, 2022 8:00 am
Forum: ESP8266 boards
Topic: Flash write stutter
Replies: 8
Views: 5689

Re: Flash write stutter

Dear Roberthh and Jimmo,
thank you both very much for your answers, it increased certainly my insight in micropython.
the solution I will try is a external I2C flash to store my log data and using a async driver to communicate with it.

Thanks.
by ajvperth
Fri Jul 08, 2022 2:17 pm
Forum: ESP8266 boards
Topic: Flash write stutter
Replies: 8
Views: 5689

Re: Flash write stutter

My ESP-01s with 1 MB x 8 storage through SPI is of type 25S80. Erase time, depending on sector size is between 40 and 250 mSec, the page programming time is 1 mSec. During the write and erase cycle its status register can be read where bit 0 indicates ready / busy. So, it is possible to implement re...
by ajvperth
Fri Jul 08, 2022 12:26 pm
Forum: ESP8266 boards
Topic: Flash write stutter
Replies: 8
Views: 5689

Re: Flash write stutter

I do not think a feature to check the availability of the flash is implemented.
I looked at the class pyb.Flash method Flash.ioctl implementing os.AbstractBlockDev
Possibly op=3 can be used if sync returns True or False on busy
by ajvperth
Fri Jul 08, 2022 11:59 am
Forum: ESP8266 boards
Topic: Flash write stutter
Replies: 8
Views: 5689

Re: Flash write stutter

Hello Roberthh, thank you for your answer, as these erase times are hardware design related I have to accept this. But what I can not accept is that micropython is stuttering, as you say up to 1200 mSec. I would like these erase times to be integrated in the asyncio module so my processing can conti...